Chris Segura 2019-10-29 20:02:38 -07:00
Родитель 15863b54cf 3c54b5b54f
Коммит a40021cf4f
1 изменённых файлов: 6 добавлений и 12 удалений

Просмотреть файл

@ -6,8 +6,7 @@ contract Base {
address public Responder;
}
contract HelloBlockchain is Base
{
contract HelloBlockchain is Base {
enum StateType { Request, Respond }
enum SwitcherEnum { On, Off }
@ -16,23 +15,19 @@ contract HelloBlockchain is Base
string public RequestMessage;
string public ResponseMessage;
constructor(string memory message) public
{
constructor(string memory message) public {
Requestor = msg.sender;
RequestMessage = message;
State = StateType.Request;
}
function SendRequest(string memory requestMessage, StateType state) public
{
function SendRequest(string memory requestMessage, StateType state) public {
RequestMessage = requestMessage;
State = state;
}
function SendResponse(StateType state, SwitcherEnum flag) public
{
if (flag == SwitcherEnum.On)
{
function SendResponse(StateType state, SwitcherEnum flag) public {
if (flag == SwitcherEnum.On) {
Responder = msg.sender;
}
@ -40,8 +35,7 @@ contract HelloBlockchain is Base
}
function SwitcheToOff(uint completed) public {
if(completed > 0)
{
if(completed > 0) {
Flag = SwitcherEnum.Off;
}
}