- SendRequest and SendResponse do not satisfy its specifications.
|
function SendRequest(string memory requestMessage) public |
|
{ |
|
if (Requestor != msg.sender) |
|
{ |
|
revert(); |
|
} |
|
|
|
RequestMessage = requestMessage; |
|
State = StateType.Request; |
|
} |
|
function SendResponse(string memory responseMessage) public |
|
{ |
|
Responder = msg.sender; |
|
|
|
// call ContractUpdated() to record this action |
|
ResponseMessage = responseMessage; |
|
State = StateType.Respond; |
|
} |
As documented by its following specification, SendRequest is only available when previous message has been responded, a.k.a., Respond state while SendResponse is only available when there is a request message, a.k.a., Request state.
|
"States": [ |
|
{ |
|
"Name": "Request", |
|
"DisplayName": "Request", |
|
"Description": "...", |
|
"PercentComplete": 50, |
|
"Value": 0, |
|
"Style": "Success", |
|
"Transitions": [ |
|
{ |
|
"AllowedRoles": ["Responder"], |
|
"AllowedInstanceRoles": [], |
|
"Description": "...", |
|
"Function": "SendResponse", |
|
"NextStates": [ "Respond" ], |
|
"DisplayName": "Send Response" |
|
} |
|
] |
|
}, |
|
{ |
|
"Name": "Respond", |
|
"DisplayName": "Respond", |
|
"Description": "...", |
|
"PercentComplete": 90, |
|
"Value": 1, |
|
"Style": "Success", |
|
"Transitions": [ |
|
{ |
|
"AllowedRoles": [], |
|
"AllowedInstanceRoles": ["Requestor"], |
|
"Description": "...", |
|
"Function": "SendRequest", |
|
"NextStates": [ "Request" ], |
|
"DisplayName": "Send Request" |
|
} |
|
] |
|
} |
|
] |
|
} |
|
] |
blockchain/blockchain-workbench/application-and-smart-contract-samples/hello-blockchain/HelloBlockchain.sol
Lines 25 to 34 in 1b712d6
blockchain/blockchain-workbench/application-and-smart-contract-samples/hello-blockchain/HelloBlockchain.sol
Lines 37 to 44 in 1b712d6
As documented by its following specification, SendRequest is only available when previous message has been responded, a.k.a.,
Respondstate while SendResponse is only available when there is a request message, a.k.a.,Requeststate.blockchain/blockchain-workbench/application-and-smart-contract-samples/hello-blockchain/HelloBlockchain.json
Lines 108 to 147 in 1b712d6