Skip to content

Commit

Permalink
add storage deposit limit argument
Browse files Browse the repository at this point in the history
  • Loading branch information
Raj-RR1 committed Oct 3, 2023
1 parent 157c860 commit 8674e00
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 18 deletions.
10 changes: 9 additions & 1 deletion app/src/substrate_dispatch_V2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1273,6 +1273,7 @@ __Z_INLINE parser_error_t _readMethod_contracts_call_V2(
CHECK_ERROR(_readLookupasStaticLookupSource_V2(c, &m->dest))
CHECK_ERROR(_readCompactBalance(c, &m->value))
CHECK_ERROR(_readCompactu64(c, &m->gas_limit))
CHECK_ERROR(_readCompactBalance(c, &m->storage_deposit_limit))
CHECK_ERROR(_readBytes(c, &m->data))
return parser_ok;
}
Expand Down Expand Up @@ -4363,6 +4364,8 @@ const char *_getMethod_ItemName_V2(uint8_t moduleIdx, uint8_t callIdx, uint8_t i
case 2:
return STR_IT_gas_limit;
case 3:
return STR_IT_storage_deposit_limit;
case 4:
return STR_IT_data;
default:
return NULL;
Expand Down Expand Up @@ -6954,7 +6957,12 @@ parser_error_t _getMethod_ItemValue_V2(
&m->basic.contracts_call_V2.gas_limit,
outValue, outValueLen,
pageIdx, pageCount);
case 3: /* contracts_call_V2 - data */;
case 3: /* contracts_call_V2 - storage_deposit_limit */;
return _toStringCompactBalance(
&m->basic.contracts_call_V2.storage_deposit_limit,
outValue, outValueLen,
pageIdx, pageCount);
case 4: /* contracts_call_V2 - data */;
return _toStringBytes(
&m->basic.contracts_call_V2.data,
outValue, outValueLen,
Expand Down
1 change: 1 addition & 0 deletions app/src/substrate_methods_V2.h
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ typedef struct {
pd_LookupasStaticLookupSource_V2_t dest;
pd_CompactBalance_t value;
pd_Compactu64_t gas_limit;
pd_CompactBalance_t storage_deposit_limit;
pd_Bytes_t data;
} pd_contracts_call_V2_t;

Expand Down
36 changes: 19 additions & 17 deletions tests/testcases_current.json
Original file line number Diff line number Diff line change
Expand Up @@ -8834,19 +8834,20 @@
{
"index": 376,
"name": "Contracts_Call",
"blob": "100000decd3e78683cdb7568c3135cd412b54b57930e0b9c7ee4c7a64762ba1ed613ef33158139ae28a3dfaac5fe1560a5e9e05c00010141685f8f7a6b927b36a04dadb2ee07b3b7d9ff17558ae7d2b0b00f8883cc148529b3479cbb429b3f22ad32e7405544f7f9e2ddd7c3273297b7e4d92168ceb158d50391010b63ce64c10c053500000002000000742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b",
"blob": "100000decd3e78683cdb7568c3135cd412b54b57930e0b9c7ee4c7a64762ba1ed613ef33158139ae28a3dfaac5fe1560a5e9e05c00010141685f8f7a6b927b36a04dadb2ee07b3b7d9ff17558ae7d2b0b00f8883cc148529b3479cbb429b3f22ad32e7405544f7f9e2ddd7c3273297b7e4d92168ceb158012cd50391010b63ce64c10c053500000002000000742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b",
"output": [
"0 | Contracts : Call",
"1 | Dest [1/2] : nYkQnG2wt4rPg6coxLF8U2ZdLYYW9L2Nkv1YC5",
"1 | Dest [2/2] : 6dyKjVhjr",
"2 | Amount [1/2] : EDG 123456789012345678901.234567890123",
"2 | Amount [2/2] : 456789",
"3 | Gas limit : 0",
"4 | Data [1/4] : 41685f8f7a6b927b36a04dadb2ee07b3b7d9ff",
"4 | Data [2/4] : 17558ae7d2b0b00f8883cc148529b3479cbb42",
"4 | Data [3/4] : 9b3f22ad32e7405544f7f9e2ddd7c3273297b7",
"4 | Data [4/4] : e4d92168ceb158",
"5 | Tip : EDG 0.000005552342355555"
"4 | Storage deposit limit : 11",
"5 | Data [1/4] : 41685f8f7a6b927b36a04dadb2ee07b3b7d9ff",
"5 | Data [2/4] : 17558ae7d2b0b00f8883cc148529b3479cbb42",
"5 | Data [3/4] : 9b3f22ad32e7405544f7f9e2ddd7c3273297b7",
"5 | Data [4/4] : e4d92168ceb158",
"6 | Tip : EDG 0.000005552342355555"
],
"output_expert": [
"0 | Contracts : Call",
Expand All @@ -8855,17 +8856,18 @@
"2 | Amount [1/2] : EDG 123456789012345678901.234567890123",
"2 | Amount [2/2] : 456789",
"3 | Gas limit : 0",
"4 | Data [1/4] : 41685f8f7a6b927b36a04dadb2ee07b3b7d9ff",
"4 | Data [2/4] : 17558ae7d2b0b00f8883cc148529b3479cbb42",
"4 | Data [3/4] : 9b3f22ad32e7405544f7f9e2ddd7c3273297b7",
"4 | Data [4/4] : e4d92168ceb158",
"5 | Chain : Edgeware",
"6 | Nonce : 100",
"7 | Tip : EDG 0.000005552342355555",
"8 | Era Phase : 61",
"9 | Era Period : 64",
"10 | Block [1/2] : 742a2ca70c2fda6cee4f8df98d64c4c670a052",
"10 | Block [2/2] : d9568058982dad9d5a7a135c5b"
"4 | Storage deposit limit : 11",
"5 | Data [1/4] : 41685f8f7a6b927b36a04dadb2ee07b3b7d9ff",
"5 | Data [2/4] : 17558ae7d2b0b00f8883cc148529b3479cbb42",
"5 | Data [3/4] : 9b3f22ad32e7405544f7f9e2ddd7c3273297b7",
"5 | Data [4/4] : e4d92168ceb158",
"6 | Chain : Edgeware",
"7 | Nonce : 100",
"8 | Tip : EDG 0.000005552342355555",
"9 | Era Phase : 61",
"10 | Era Period : 64",
"11 | Block [1/2] : 742a2ca70c2fda6cee4f8df98d64c4c670a052",
"11 | Block [2/2] : d9568058982dad9d5a7a135c5b"
]
},
{
Expand Down

0 comments on commit 8674e00

Please sign in to comment.