Merge branch 'master' of https://github.com/microsoft/vscode-azure-blockchain-ethereum
This commit is contained in:
Коммит
a40021cf4f
|
@ -6,8 +6,7 @@ contract Base {
|
||||||
address public Responder;
|
address public Responder;
|
||||||
}
|
}
|
||||||
|
|
||||||
contract HelloBlockchain is Base
|
contract HelloBlockchain is Base {
|
||||||
{
|
|
||||||
enum StateType { Request, Respond }
|
enum StateType { Request, Respond }
|
||||||
enum SwitcherEnum { On, Off }
|
enum SwitcherEnum { On, Off }
|
||||||
|
|
||||||
|
@ -16,23 +15,19 @@ contract HelloBlockchain is Base
|
||||||
string public RequestMessage;
|
string public RequestMessage;
|
||||||
string public ResponseMessage;
|
string public ResponseMessage;
|
||||||
|
|
||||||
constructor(string memory message) public
|
constructor(string memory message) public {
|
||||||
{
|
|
||||||
Requestor = msg.sender;
|
Requestor = msg.sender;
|
||||||
RequestMessage = message;
|
RequestMessage = message;
|
||||||
State = StateType.Request;
|
State = StateType.Request;
|
||||||
}
|
}
|
||||||
|
|
||||||
function SendRequest(string memory requestMessage, StateType state) public
|
function SendRequest(string memory requestMessage, StateType state) public {
|
||||||
{
|
|
||||||
RequestMessage = requestMessage;
|
RequestMessage = requestMessage;
|
||||||
State = state;
|
State = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
function SendResponse(StateType state, SwitcherEnum flag) public
|
function SendResponse(StateType state, SwitcherEnum flag) public {
|
||||||
{
|
if (flag == SwitcherEnum.On) {
|
||||||
if (flag == SwitcherEnum.On)
|
|
||||||
{
|
|
||||||
Responder = msg.sender;
|
Responder = msg.sender;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,8 +35,7 @@ contract HelloBlockchain is Base
|
||||||
}
|
}
|
||||||
|
|
||||||
function SwitcheToOff(uint completed) public {
|
function SwitcheToOff(uint completed) public {
|
||||||
if(completed > 0)
|
if(completed > 0) {
|
||||||
{
|
|
||||||
Flag = SwitcherEnum.Off;
|
Flag = SwitcherEnum.Off;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче