Skip to content

Bug report in digital-locker smart contract #279

@academic-starter

Description

@academic-starter

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions