Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug report in digital-locker smart contract #279

Open
academic-starter opened this issue Feb 22, 2024 · 1 comment
Open

Bug report in digital-locker smart contract #279

academic-starter opened this issue Feb 22, 2024 · 1 comment

Comments

@academic-starter
Copy link

As documented by its following specification, Constructor funtion should finish with Requested state instead of DocumentReview.

  • Other implementation bugs according to contract specification.
    "States": [
    {
    "Name": "Requested",
    "DisplayName": "Requested",
    "Description": "...",
    "PercentComplete": 0,
    "Style": "Success",
    "Transitions": [
    {
    "AllowedRoles": [
    "BankAgent"
    ],
    "AllowedInstanceRoles": [],
    "Description": "...",
    "Function": "BeginReviewProcess",
    "NextStates": [
    "DocumentReview"
    ],
    "DisplayName": "Begin Review Process"
    }
    ]
    },
    {
    "Name": "DocumentReview",
    "DisplayName": "DocumentReview",
    "Description": "...",
    "PercentComplete": 20,
    "Style": "Success",
    "Transitions": [
    {
    "AllowedRoles": [],
    "AllowedInstanceRoles": [ "BankAgent" ],
    "Description": "...",
    "Function": "UploadDocuments",
    "NextStates": [ "AvailableToShare" ],
    "DisplayName": "Upload Documents Placeholder"
    }
    ]
    },
    {
    "Name": "AvailableToShare",
    "DisplayName": "Available To Share",
    "Description": "...",
    "PercentComplete": 30,
    "Style": "Success",
    "Transitions": [
    {
    "AllowedRoles": [],
    "AllowedInstanceRoles": [ "Owner" ],
    "Description": "...",
    "Function": "ShareWithThirdParty",
    "NextStates": ["SharingWithThirdParty" ],
    "DisplayName": "Share With Third Party"
    },
    {
    "AllowedRoles": [],
    "AllowedInstanceRoles": [ "Owner" ],
    "Description": "...",
    "Function": "Terminate",
    "NextStates": [ "Terminated" ],
    "DisplayName": "Terminate"
    },
    {
    "AllowedRoles": [ "ThirdPartyRequestor" ],
    "AllowedInstanceRoles": [],
    "Description": "...",
    "Function": "RequestLockerAccess",
    "NextStates": [ "SharingRequestPending" ],
    "DisplayName": "Request Locker Access"
    }
    ]
    },
    {
    "Name": "SharingRequestPending",
    "DisplayName": "Sharing Request Pending",
    "Description": "...",
    "PercentComplete": 40,
    "Style": "Success",
    "Transitions": [
    {
    "AllowedRoles": [],
    "AllowedInstanceRoles": [ "Owner" ],
    "Description": "...",
    "Function": "AcceptSharingRequest",
    "NextStates": [
    "SharingWithThirdParty"
    ],
    "DisplayName": "Accept Sharing Request"
    },
    {
    "AllowedRoles": [],
    "AllowedInstanceRoles": [ "Owner" ],
    "Description": "...",
    "Function": "RejectSharingRequest",
    "NextStates": [ "AvailableToShare" ],
    "DisplayName": "Reject Sharing Request"
    },
    {
    "AllowedRoles": [],
    "AllowedInstanceRoles": [ "Owner" ],
    "Description": "...",
    "Function": "Terminate",
    "NextStates": [ "Terminated" ],
    "DisplayName": "Terminate"
    }
    ]
    },
    {
    "Name": "SharingWithThirdParty",
    "DisplayName": "Sharing With Third Party",
    "Description": "...",
    "PercentComplete": 45,
    "Style": "Success",
    "Transitions": [
    {
    "AllowedRoles": [],
    "AllowedInstanceRoles": [ "Owner" ],
    "Description": "...",
    "Function": "RevokeAccessFromThirdParty",
    "NextStates": [ "AvailableToShare" ],
    "DisplayName": "Revoke Access From Third Party"
    },
    {
    "AllowedRoles": [],
    "AllowedInstanceRoles": [ "Owner" ],
    "Description": "...",
    "Function": "Terminate",
    "NextStates": [ "Terminated" ],
    "DisplayName": "Terminate"
    },
    {
    "AllowedRoles": [],
    "AllowedInstanceRoles": [ "ThirdPartyRequestor" ],
    "Description": "...",
    "Function": "ReleaseLockerAccess",
    "NextStates": [ "AvailableToShare" ],
    "DisplayName": "Release Locker Access"
    }
    ]
    },
    {
    "Name": "Terminated",
    "DisplayName": "Terminated",
    "Description": "...",
    "PercentComplete": 100,
    "Style": "Failure",
    "Transitions": []
    }
    ]
    }
  1. BeginReviewProcess function should begin with Requested state.

  2. UploadDocuments function should begin with DocumentReview state.

    function UploadDocuments(string memory lockerIdentifier, string memory image) public

  3. ShareWithThirdParty should begin with AvailableToShare state.

    function ShareWithThirdParty(address thirdPartyRequestor, string memory expirationDate, string memory intendedPurpose) public

  4. AcceptSharingRequest should begin with SharingRequestPending state.

  5. RejectSharingRequest should begin with SharingRequestPending state.

  6. RequestLockerAccess should begin with AvailableToShare state.

    function RequestLockerAccess(string memory intendedPurpose) public

  7. ReleaseLockerAccess should begin with SharingWithThirdParty state.
    https://github.com/Azure-Samples/blockchain/blob/1b712d6d05cca8da17bdd1894de8c3d25905685d/blockchain-workbench/application-and-smart-contract-samples/digital-locker/ethereum/DigitalLocker.sol#118

  8. RevokeAccessFromThirdParty should begin with SharingWithThirdParty state.

  9. Terminate should begin with AvailableToShare|SharingRequestPending|SharingWithThirdParty state.

@SimonGareis
Copy link

SimonGareis commented Feb 22, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants