-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #978 from Zilliqa/addfunds_test
Add AddFunds test, to be used from the blockchain unit tests
- Loading branch information
Showing
25 changed files
with
385 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
scilla_version 0 | ||
|
||
library SimpleImpl | ||
|
||
contract SimpleImpl() | ||
|
||
transition AddFunds(initiator: ByStr20) | ||
accept; | ||
e = { _eventname : "Funds deposit "; funder : initiator }; | ||
event e | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
scilla_version 0 | ||
|
||
library SimpleProxy | ||
|
||
let one_msg = | ||
fun (m: Message) => | ||
let e = Nil {Message} in | ||
Cons {Message} m e | ||
|
||
contract SimpleProxy( | ||
init_implementation: ByStr20 | ||
) | ||
|
||
field implementation: ByStr20 = init_implementation | ||
|
||
transition AddFunds() | ||
current_impl <- implementation; | ||
accept; | ||
msg = {_tag: "AddFunds"; _recipient: current_impl; _amount: _amount; initiator: _sender}; | ||
msgs = one_msg msg; | ||
send msgs | ||
end | ||
|
||
transition SelfAddFunds() | ||
accept; | ||
e = { _eventname : "Self Add Funds deposit "; funder : _sender; amount: _amount }; | ||
event e | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[ { "vname": "BLOCKNUMBER", "type": "BNum", "value": "100" } ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[ | ||
{ | ||
"vname" : "_scilla_version", | ||
"type" : "Uint32", | ||
"value" : "0" | ||
}, | ||
{ | ||
"vname" : "_this_address", | ||
"type" : "ByStr20", | ||
"value" : "0xabfeccdc9012345678901234567890f777567890" | ||
}, | ||
{ | ||
"vname" : "_creation_block", | ||
"type" : "BNum", | ||
"value" : "1" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"_tag": "AddFunds", | ||
"_amount": "100", | ||
"_sender": "0x12345678901234567890123456789012345678ab", | ||
"params": [ | ||
{ | ||
"vname" : "initiator", | ||
"type" : "ByStr20", | ||
"value" : "0x52345678901234567890123456789012345678ab" | ||
} | ||
], | ||
"_origin": "0x12345678901234567890123456789012345678ab" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"scilla_major_version": "0", | ||
"gas_remaining": "7944", | ||
"_accepted": "true", | ||
"messages": [], | ||
"states": [ { "vname": "_balance", "type": "Uint128", "value": "100" } ], | ||
"events": [ | ||
{ | ||
"_eventname": "Funds deposit ", | ||
"params": [ | ||
{ | ||
"vname": "funder", | ||
"type": "ByStr20", | ||
"value": "0x52345678901234567890123456789012345678ab" | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[ | ||
{ | ||
"vname": "_balance", | ||
"type": "Uint128", | ||
"value": "0" | ||
}, | ||
{ | ||
"vname": "_external", | ||
"type": "Unit", | ||
"value": [ | ||
{ | ||
"address": "0x12345678901234567890123456789012345678ab", | ||
"state": [ | ||
{ "vname": "_balance", "type": "Uint128", "value": "142" } | ||
] | ||
} | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[ { "vname": "BLOCKNUMBER", "type": "BNum", "value": "100" } ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[ { "vname": "BLOCKNUMBER", "type": "BNum", "value": "100" } ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[ | ||
{ | ||
"vname" : "_scilla_version", | ||
"type" : "Uint32", | ||
"value" : "0" | ||
}, | ||
{ | ||
"vname" : "_this_address", | ||
"type" : "ByStr20", | ||
"value" : "0xabfeccdc9012345678901234567890f777567890" | ||
}, | ||
{ | ||
"vname" : "_creation_block", | ||
"type" : "BNum", | ||
"value" : "1" | ||
}, | ||
{ | ||
"vname": "init_implementation", | ||
"type": "ByStr20", | ||
"value": "0xff345678901234567890123456789012345678ab" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"_tag": "AddFunds", | ||
"_amount": "100", | ||
"_sender": "0x12345678901234567890123456789012345678ab", | ||
"params": [], | ||
"_origin": "0x12345678901234567890123456789012345678ab" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"_tag": "SelfAddFunds", | ||
"_amount": "100", | ||
"_sender": "0x12345678901234567890123456789012345678ab", | ||
"params": [], | ||
"_origin": "0x12345678901234567890123456789012345678ab" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"scilla_major_version": "0", | ||
"gas_remaining": "7951", | ||
"_accepted": "true", | ||
"messages": [ | ||
{ | ||
"_tag": "AddFunds", | ||
"_amount": "100", | ||
"_recipient": "0xff345678901234567890123456789012345678ab", | ||
"params": [ | ||
{ | ||
"vname": "initiator", | ||
"type": "ByStr20", | ||
"value": "0x12345678901234567890123456789012345678ab" | ||
} | ||
] | ||
} | ||
], | ||
"states": [ | ||
{ "vname": "_balance", "type": "Uint128", "value": "0" }, | ||
{ | ||
"vname": "implementation", | ||
"type": "ByStr20", | ||
"value": "0xff345678901234567890123456789012345678ab" | ||
} | ||
], | ||
"events": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"scilla_major_version": "0", | ||
"gas_remaining": "7958", | ||
"_accepted": "true", | ||
"messages": [], | ||
"states": [ | ||
{ "vname": "_balance", "type": "Uint128", "value": "100" }, | ||
{ | ||
"vname": "implementation", | ||
"type": "ByStr20", | ||
"value": "0xff345678901234567890123456789012345678ab" | ||
} | ||
], | ||
"events": [ | ||
{ | ||
"_eventname": "Self Add Funds deposit ", | ||
"params": [ | ||
{ | ||
"vname": "funder", | ||
"type": "ByStr20", | ||
"value": "0x12345678901234567890123456789012345678ab" | ||
}, | ||
{ "vname": "amount", "type": "Uint128", "value": "100" } | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[ | ||
{ | ||
"vname": "_balance", | ||
"type": "Uint128", | ||
"value": "0" | ||
}, | ||
{ | ||
"vname": "implementation", | ||
"type": "ByStr20", | ||
"value": "0xff345678901234567890123456789012345678ab" | ||
}, | ||
{ | ||
"vname": "_external", | ||
"type": "Unit", | ||
"value": [ | ||
{ | ||
"address": "0x12345678901234567890123456789012345678ab", | ||
"state": [ | ||
{ "vname": "_balance", "type": "Uint128", "value": "142" } | ||
] | ||
} | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[ | ||
{ | ||
"vname": "_balance", | ||
"type": "Uint128", | ||
"value": "0" | ||
}, | ||
{ | ||
"vname": "implementation", | ||
"type": "ByStr20", | ||
"value": "0xff345678901234567890123456789012345678ab" | ||
}, | ||
{ | ||
"vname": "_external", | ||
"type": "Unit", | ||
"value": [ | ||
{ | ||
"address": "0x12345678901234567890123456789012345678ab", | ||
"state": [ | ||
{ "vname": "_balance", "type": "Uint128", "value": "142" } | ||
] | ||
} | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"scilla_major_version": "0", | ||
"gas_remaining": "7915", | ||
"_accepted": "true", | ||
"messages": [ | ||
{ | ||
"_tag": "b_accept_callC", | ||
"_amount": "50", | ||
"_recipient": "0x22345678901234567890123456789012345678ab", | ||
"params": [ | ||
{ | ||
"vname": "addrC", | ||
"type": "ByStr20", | ||
"value": "0x32345678901234567890123456789012345678ab" | ||
} | ||
] | ||
} | ||
], | ||
"states": [ { "vname": "_balance", "type": "Uint128", "value": "100" } ], | ||
"events": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,23 @@ | ||
[ | ||
{ "vname": "_balance", "type": "Uint128", "value": "100" } | ||
{ | ||
"vname": "_balance", | ||
"type": "Uint128", | ||
"value": "100" | ||
}, | ||
{ | ||
"vname": "_external", | ||
"type": "Unit", | ||
"value": [ | ||
{ | ||
"address": "0x02345678901234567890123456789012345678ab", | ||
"state": [ | ||
{ | ||
"vname": "_balance", | ||
"type": "Uint128", | ||
"value": "100" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"scilla_major_version": "0", | ||
"gas_remaining": "7939", | ||
"_accepted": "true", | ||
"messages": [ | ||
{ | ||
"_tag": "c_noaccept", | ||
"_amount": "50", | ||
"_recipient": "0x32345678901234567890123456789012345678ab", | ||
"params": [] | ||
} | ||
], | ||
"states": [ { "vname": "_balance", "type": "Uint128", "value": "100" } ], | ||
"events": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,23 @@ | ||
[ | ||
{ "vname": "_balance", "type": "Uint128", "value": "100" } | ||
{ | ||
"vname": "_balance", | ||
"type": "Uint128", | ||
"value": "100" | ||
}, | ||
{ | ||
"vname": "_external", | ||
"type": "Unit", | ||
"value": [ | ||
{ | ||
"address": "0x12345678901234567890123456789012345678ab", | ||
"state": [ | ||
{ | ||
"vname": "_balance", | ||
"type": "Uint128", | ||
"value": "100" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] |
Oops, something went wrong.