-
Notifications
You must be signed in to change notification settings - Fork 686
Description
- Constructor function does not satisfy its specification
Lines 18 to 24 in 1b712d6
constructor(string memory lockerFriendlyName, address bankAgent) public { Owner = msg.sender; LockerFriendlyName = lockerFriendlyName; State = StateType.DocumentReview; //////////////// should be StateType.Requested?
As documented by its following specification, Constructor funtion should finish with Requested state instead of DocumentReview.
Line 31 in 1b712d6
| "StartState": "Requested", |
- Other implementation bugs according to contract specification.
Lines 272 to 421 in 1b712d6
"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": [] } ] }
-
BeginReviewProcess function should begin with
Requestedstate.
Line 29 in 1b712d6
function BeginReviewProcess() public -
UploadDocuments function should begin with
DocumentReviewstate.
Line 56 in 1b712d6
function UploadDocuments(string memory lockerIdentifier, string memory image) public -
ShareWithThirdParty should begin with
AvailableToSharestate.
Line 68 in 1b712d6
function ShareWithThirdParty(address thirdPartyRequestor, string memory expirationDate, string memory intendedPurpose) public -
AcceptSharingRequest should begin with
SharingRequestPendingstate.
Line 84 in 1b712d6
function AcceptSharingRequest() public -
RejectSharingRequest should begin with
SharingRequestPendingstate.
Line 95 in 1b712d6
function RejectSharingRequest() public -
RequestLockerAccess should begin with
AvailableToSharestate.
Line 106 in 1b712d6
function RequestLockerAccess(string memory intendedPurpose) public -
ReleaseLockerAccess should begin with
SharingWithThirdPartystate.
https://github.com/Azure-Samples/blockchain/blob/1b712d6d05cca8da17bdd1894de8c3d25905685d/blockchain-workbench/application-and-smart-contract-samples/digital-locker/ethereum/DigitalLocker.sol#118 -
RevokeAccessFromThirdParty should begin with
SharingWithThirdPartystate.
Line 132 in 1b712d6
function RevokeAccessFromThirdParty() public -
Terminate should begin with
AvailableToShare|SharingRequestPending|SharingWithThirdPartystate.
Line 143 in 1b712d6
function Terminate() public