Skip to content

Commit

Permalink
refactoring + test updates
Browse files Browse the repository at this point in the history
  • Loading branch information
alyn509 committed Jan 31, 2025
1 parent 6b3c29d commit 640729b
Show file tree
Hide file tree
Showing 19 changed files with 339 additions and 276 deletions.
16 changes: 7 additions & 9 deletions contracts/examples/digital-cash/scenarios/claim-egld.scen.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,9 @@
"storage": {
"str:deposit|0x487bd4010b50c24a02018345fe5171edf4182e6294325382c75ef4c4409f01bd": {
"0-depositor_address": "address:acc2",
"1-esdt_funds": "u32:1|nested:str:CASHTOKEN-123456|u64:0|biguint:50",
"2-egld_funds": "biguint:0",
"3-valability": "u64:100",
"4-expiration_round": "u64:16",
"1-funds": "u32:1|nested:str:CASHTOKEN-123456|u64:0|biguint:50",
"2-valability": "u64:100",
"3-expiration_round": "u64:16",
"5-fees": {
"0-num_token_to_transfer": "u32:1",
"1-value": {
Expand All @@ -147,11 +146,10 @@
},
"str:deposit|0x885532043a061e0c779e4064b85193f72cffd22c5bcc208c209128e60f21bf0d": {
"0-depositor_address": "address:acc3",
"1-esdt_funds": "u32:3|nested:str:CASHTOKEN-112233|u64:0|biguint:50|nested:str:CASHTOKEN-445566|u64:0|biguint:50|nested:str:CASHTOKEN-778899|u64:0|biguint:50",
"2-egld_funds": "biguint:0",
"3-valability": "u64:100",
"4-expiration_round": "u64:16",
"5-fees": {
"1-funds": "u32:3|nested:str:CASHTOKEN-112233|u64:0|biguint:50|nested:str:CASHTOKEN-445566|u64:0|biguint:50|nested:str:CASHTOKEN-778899|u64:0|biguint:50",
"2-valability": "u64:100",
"3-expiration_round": "u64:16",
"4-fees": {
"0-num_token_to_transfer": "u32:3",
"1-value": {
"0-tokenIdentifier": "nested:str:EGLD",
Expand Down
16 changes: 7 additions & 9 deletions contracts/examples/digital-cash/scenarios/claim-esdt.scen.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,10 @@
"storage": {
"str:deposit|0xdb474a3a065d3f0c0a62ae680ef6435e48eb482899d2ae30ff7a3a4b0ef19c60": {
"0-depositor_address": "address:acc1",
"1-esdt_funds": "u32:0",
"2-egld_funds": "biguint:1,000",
"3-valability": "u64:60",
"4-expiration_round": "u64:10",
"5-fees": {
"1-funds": "u32:1|nested:str:EGLD|u64:0|biguint:1,000",
"2-valability": "u64:60",
"3-expiration_round": "u64:10",
"4-fees": {
"0-num_token_to_transfer": "u32:1",
"1-value": {
"0-tokenIdentifier": "nested:str:EGLD",
Expand All @@ -147,10 +146,9 @@
"str:deposit|0x885532043a061e0c779e4064b85193f72cffd22c5bcc208c209128e60f21bf0d": {
"0-depositor_address": "address:acc3",
"1-esdt_funds": "u32:3|nested:str:CASHTOKEN-112233|u64:0|biguint:50|nested:str:CASHTOKEN-445566|u64:0|biguint:50|nested:str:CASHTOKEN-778899|u64:0|biguint:50",
"2-egld_funds": "biguint:0",
"3-valability": "u64:100",
"4-expiration_round": "u64:16",
"5-fees": {
"2-valability": "u64:100",
"3-expiration_round": "u64:16",
"4-fees": {
"0-num_token_to_transfer": "u32:3",
"1-value": {
"0-tokenIdentifier": "nested:str:EGLD",
Expand Down
18 changes: 8 additions & 10 deletions contracts/examples/digital-cash/scenarios/claim-fees.scen.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,10 @@
"storage": {
"str:deposit|0x487bd4010b50c24a02018345fe5171edf4182e6294325382c75ef4c4409f01bd": {
"0-depositor_address": "address:acc2",
"1-esdt_funds": "u32:1|nested:str:CASHTOKEN-123456|u64:0|biguint:50",
"2-egld_funds": "biguint:0",
"3-valability": "u64:100",
"4-expiration_round": "u64:16",
"5-fees": {
"1-funds": "u32:1|nested:str:CASHTOKEN-123456|u64:0|biguint:50",
"2-valability": "u64:100",
"3-expiration_round": "u64:16",
"4-fees": {
"0-num_token_to_transfer": "u32:1",
"1-value": {
"0-tokenIdentifier": "nested:str:EGLD",
Expand All @@ -84,11 +83,10 @@
},
"str:deposit|0x885532043a061e0c779e4064b85193f72cffd22c5bcc208c209128e60f21bf0d": {
"0-depositor_address": "address:acc3",
"1-esdt_funds": "u32:3|nested:str:CASHTOKEN-112233|u64:0|biguint:50|nested:str:CASHTOKEN-445566|u64:0|biguint:50|nested:str:CASHTOKEN-778899|u64:0|biguint:50",
"2-egld_funds": "biguint:0",
"3-valability": "u64:100",
"4-expiration_round": "u64:16",
"5-fees": {
"1-funds": "u32:3|nested:str:CASHTOKEN-112233|u64:0|biguint:50|nested:str:CASHTOKEN-445566|u64:0|biguint:50|nested:str:CASHTOKEN-778899|u64:0|biguint:50",
"2-valability": "u64:100",
"3-expiration_round": "u64:16",
"4-fees": {
"0-num_token_to_transfer": "u32:3",
"1-value": {
"0-tokenIdentifier": "nested:str:EGLD",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,10 @@
"storage": {
"str:deposit|0xdb474a3a065d3f0c0a62ae680ef6435e48eb482899d2ae30ff7a3a4b0ef19c60": {
"0-depositor_address": "address:acc1",
"1-esdt_funds": "u32:0",
"2-egld_funds": "biguint:1,000",
"3-valability": "u64:60",
"4-expiration_round": "u64:10",
"5-fees": {
"1-funds": "u32:1|nested:str:EGLD|u64:0|biguint:1,000",
"2-valability": "u64:60",
"3-expiration_round": "u64:10",
"4-fees": {
"0-num_token_to_transfer": "u32:1",
"1-value": {
"0-tokenIdentifier": "nested:str:EGLD",
Expand All @@ -144,11 +143,10 @@
},
"str:deposit|0x487bd4010b50c24a02018345fe5171edf4182e6294325382c75ef4c4409f01bd": {
"0-depositor_address": "address:acc2",
"1-esdt_funds": "u32:1|nested:str:CASHTOKEN-123456|u64:0|biguint:50",
"2-egld_funds": "biguint:0",
"3-valability": "u64:100",
"4-expiration_round": "u64:16",
"5-fees": {
"1-funds": "u32:1|nested:str:CASHTOKEN-123456|u64:0|biguint:50",
"2-valability": "u64:100",
"3-expiration_round": "u64:16",
"4-fees": {
"0-num_token_to_transfer": "u32:1",
"1-value": {
"0-tokenIdentifier": "nested:str:EGLD",
Expand Down
27 changes: 12 additions & 15 deletions contracts/examples/digital-cash/scenarios/forward.scen.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,10 @@
"storage": {
"str:deposit|0xa40e72cdac3580e7203a4c2565c932f7691c35e624bcfd82718d7f559c88f440": {
"0-depositor_address": "address:acc2",
"1-esdt_funds": "u32:0",
"2-egld_funds": "biguint:1,000",
"3-valability": "u64:60",
"4-expiration_round": "u64:10",
"5-fees": {
"1-funds": "u32:1|nested:str:EGLD|u64:0|biguint:1,000",
"2-valability": "u64:60",
"3-expiration_round": "u64:10",
"4-fees": {
"0-num_token_to_transfer": "u32:1",
"1-value": {
"0-tokenIdentifier": "nested:str:EGLD",
Expand All @@ -177,11 +176,10 @@
},
"str:deposit|0x487bd4010b50c24a02018345fe5171edf4182e6294325382c75ef4c4409f01bd": {
"0-depositor_address": "address:acc2",
"1-esdt_funds": "u32:1|nested:str:CASHTOKEN-123456|u64:0|biguint:50",
"2-egld_funds": "biguint:0",
"3-valability": "u64:100",
"4-expiration_round": "u64:16",
"5-fees": {
"1-funds": "u32:1|nested:str:CASHTOKEN-123456|u64:0|biguint:50",
"2-valability": "u64:100",
"3-expiration_round": "u64:16",
"4-fees": {
"0-num_token_to_transfer": "u32:1",
"1-value": {
"0-tokenIdentifier": "nested:str:EGLD",
Expand All @@ -192,11 +190,10 @@
},
"str:deposit|0x8dc17613990e9b7476401a36d112d1a4d31190dec21e7e9a3c933872a27613ee": {
"0-depositor_address": "address:acc2",
"1-esdt_funds": "u32:3|nested:str:CASHTOKEN-112233|u64:0|biguint:50|nested:str:CASHTOKEN-445566|u64:0|biguint:50|nested:str:CASHTOKEN-778899|u64:0|biguint:50",
"2-egld_funds": "biguint:0",
"3-valability": "u64:100",
"4-expiration_round": "u64:16",
"5-fees": {
"1-funds": "u32:3|nested:str:CASHTOKEN-112233|u64:0|biguint:50|nested:str:CASHTOKEN-445566|u64:0|biguint:50|nested:str:CASHTOKEN-778899|u64:0|biguint:50",
"2-valability": "u64:100",
"3-expiration_round": "u64:16",
"4-fees": {
"0-num_token_to_transfer": "u32:3",
"1-value": {
"0-tokenIdentifier": "nested:str:EGLD",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,10 @@
"storage": {
"str:deposit|0xdb474a3a065d3f0c0a62ae680ef6435e48eb482899d2ae30ff7a3a4b0ef19c60": {
"0-depositor_address": "address:acc1",
"1-esdt_funds": "u32:0",
"2-egld_funds": "biguint:1,000",
"3-valability": "u64:60",
"4-expiration_round": "u64:10",
"5-fees": {
"1-funds": "u32:1|nested:str:EGLD|u64:0|biguint:1000",
"2-valability": "u64:60",
"3-expiration_round": "u64:10",
"4-fees": {
"0-num_token_to_transfer": "u32:1",
"1-value": {
"0-tokenIdentifier": "nested:str:EGLD",
Expand Down Expand Up @@ -201,11 +200,10 @@
"storage": {
"str:deposit|0xdb474a3a065d3f0c0a62ae680ef6435e48eb482899d2ae30ff7a3a4b0ef19c60": {
"0-depositor_address": "address:acc1",
"1-esdt_funds": "u32:0",
"2-egld_funds": "biguint:1,000",
"3-valability": "u64:60",
"4-expiration_round": "u64:10",
"5-fees": {
"1-funds": "u32:1|nested:str:EGLD|u64:0|biguint:1000",
"2-valability": "u64:60",
"3-expiration_round": "u64:10",
"4-fees": {
"0-num_token_to_transfer": "u32:1",
"1-value": {
"0-tokenIdentifier": "nested:str:EGLD",
Expand All @@ -216,8 +214,7 @@
},
"str:deposit|0x487bd4010b50c24a02018345fe5171edf4182e6294325382c75ef4c4409f01bd": {
"0-depositor_address": "address:acc2",
"1-esdt_funds": "u32:1|nested:str:CASHTOKEN-123456|u64:0|biguint:50",
"2-egld_funds": "biguint:0",
"1-funds": "u32:1|nested:str:CASHTOKEN-123456|u64:0|biguint:50",
"3-valability": "u64:100",
"4-expiration_round": "u64:16",
"5-fees": {
Expand Down Expand Up @@ -407,11 +404,10 @@
"storage": {
"str:deposit|0xdb474a3a065d3f0c0a62ae680ef6435e48eb482899d2ae30ff7a3a4b0ef19c60": {
"0-depositor_address": "address:acc1",
"1-esdt_funds": "u32:0",
"2-egld_funds": "biguint:1,000",
"3-valability": "u64:60",
"4-expiration_round": "u64:10",
"5-fees": {
"1-funds": "u32:1|nested:str:EGLD|u64:0|biguint:1,000",
"2-valability": "u64:60",
"3-expiration_round": "u64:10",
"4-fees": {
"0-num_token_to_transfer": "u32:1",
"1-value": {
"0-tokenIdentifier": "nested:str:EGLD",
Expand All @@ -422,11 +418,10 @@
},
"str:deposit|0x487bd4010b50c24a02018345fe5171edf4182e6294325382c75ef4c4409f01bd": {
"0-depositor_address": "address:acc2",
"1-esdt_funds": "u32:1|nested:str:CASHTOKEN-123456|u64:0|biguint:50",
"2-egld_funds": "biguint:0",
"3-valability": "u64:100",
"4-expiration_round": "u64:16",
"5-fees": {
"1-funds": "u32:1|nested:str:CASHTOKEN-123456|u64:0|biguint:50",
"2-valability": "u64:100",
"3-expiration_round": "u64:16",
"4-fees": {
"0-num_token_to_transfer": "u32:1",
"1-value": {
"0-tokenIdentifier": "nested:str:EGLD",
Expand All @@ -437,11 +432,10 @@
},
"str:deposit|0x885532043a061e0c779e4064b85193f72cffd22c5bcc208c209128e60f21bf0d": {
"0-depositor_address": "address:acc3",
"1-esdt_funds": "u32:3|nested:str:CASHTOKEN-112233|u64:0|biguint:50|nested:str:CASHTOKEN-445566|u64:0|biguint:50|nested:str:CASHTOKEN-778899|u64:0|biguint:50",
"2-egld_funds": "biguint:0",
"3-valability": "u64:100",
"4-expiration_round": "u64:16",
"5-fees": {
"1-funds": "u32:3|nested:str:CASHTOKEN-112233|u64:0|biguint:50|nested:str:CASHTOKEN-445566|u64:0|biguint:50|nested:str:CASHTOKEN-778899|u64:0|biguint:50",
"2-valability": "u64:100",
"3-expiration_round": "u64:16",
"4-fees": {
"0-num_token_to_transfer": "u32:3",
"1-value": {
"0-tokenIdentifier": "nested:str:EGLD",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"from": "address:acc3",
"to": "sc:the_digital_cash_contract",
"egldValue": "10",
"function": "payFeeAndFundEGLD",
"function": "payFeeAndFund",
"arguments": [
"0xdb474a3a065d3f0c0a62ae680ef6435e48eb482899d2ae30ff7a3a4b0ef19c60",
"u64:100"
Expand All @@ -36,7 +36,7 @@
"from": "address:acc3",
"to": "sc:the_digital_cash_contract",
"egldValue": "1,000",
"function": "payFeeAndFundEGLD",
"function": "payFeeAndFund",
"arguments": [
"0xdb474a3a065d3f0c0a62ae680ef6435e48eb482899d2ae30ff7a3a4b0ef19c60",
"u64:100"
Expand All @@ -62,11 +62,10 @@
"storage": {
"str:deposit|0xdb474a3a065d3f0c0a62ae680ef6435e48eb482899d2ae30ff7a3a4b0ef19c60": {
"0-depositor_address": "address:acc3",
"1-esdt_funds": "u32:0",
"2-egld_funds": "biguint:990",
"3-valability": "u64:100",
"4-expiration_round": "u64:16",
"5-fees": {
"1-funds": "u32:1|nested:str:EGLD|u64:0|biguint:990",
"2-valability": "u64:100",
"3-expiration_round": "u64:16",
"4-fees": {
"0-num_token_to_transfer": "u32:1",
"1-value": {
"0-tokenIdentifier": "nested:str:EGLD",
Expand Down
Loading

0 comments on commit 640729b

Please sign in to comment.