Skip to content

Commit

Permalink
test council execute
Browse files Browse the repository at this point in the history
add nesting support for democracy external propose majority and test cases for council execute
  • Loading branch information
Raj-RR1 committed May 6, 2024
1 parent fa894a0 commit 819ea64
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 164 deletions.
5 changes: 2 additions & 3 deletions app/src/substrate_dispatch_V2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,7 @@ parser_error_t _readMethod_V2(
CHECK_ERROR(_readMethod_democracy_external_propose_V2(c, &method->basic.democracy_external_propose_V2))
break;
case 2565: /* module 10 call 5 */
CHECK_ERROR(_readMethod_democracy_external_propose_majority_V2(c, &method->basic.democracy_external_propose_majority_V2))
CHECK_ERROR(_readMethod_democracy_external_propose_majority_V2(c, &method->nested.democracy_external_propose_majority_V2))
break;
case 2566: /* module 10 call 6 */
CHECK_ERROR(_readMethod_democracy_external_propose_default_V2(c, &method->basic.democracy_external_propose_default_V2))
Expand Down Expand Up @@ -3849,7 +3849,7 @@ parser_error_t _getMethod_ItemValue_V2(
switch (itemIdx) {
case 0: /* democracy_external_propose_majority_V2 - proposal_hash */;
return _toStringHash(
&m->basic.democracy_external_propose_majority_V2.proposal_hash,
&m->nested.democracy_external_propose_majority_V2.proposal_hash,
outValue, outValueLen,
pageIdx, pageCount);
default:
Expand Down Expand Up @@ -4935,7 +4935,6 @@ bool _getMethod_IsNestingSupported_V2(uint8_t moduleIdx, uint8_t callIdx)
case 2562: // Democracy:Vote
case 2563: // Democracy:Emergency cancel
case 2564: // Democracy:External propose
case 2565: // Democracy:External propose majority
case 2566: // Democracy:External propose default
case 2567: // Democracy:Fast track
case 2568: // Democracy:Veto external
Expand Down
2 changes: 1 addition & 1 deletion app/src/substrate_methods_V2.h
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,6 @@ typedef union {
pd_democracy_vote_V2_t democracy_vote_V2;
pd_democracy_emergency_cancel_V2_t democracy_emergency_cancel_V2;
pd_democracy_external_propose_V2_t democracy_external_propose_V2;
pd_democracy_external_propose_majority_V2_t democracy_external_propose_majority_V2;
pd_democracy_external_propose_default_V2_t democracy_external_propose_default_V2;
pd_democracy_fast_track_V2_t democracy_fast_track_V2;
pd_democracy_veto_external_V2_t democracy_veto_external_V2;
Expand Down Expand Up @@ -928,6 +927,7 @@ typedef union {
pd_council_execute_V2_t council_execute_V2;
pd_council_propose_V2_t council_propose_V2;
pd_recovery_as_recovered_V2_t recovery_as_recovered_V2;
pd_democracy_external_propose_majority_V2_t democracy_external_propose_majority_V2;
#endif
} pd_MethodNested_V2_t;

Expand Down
197 changes: 37 additions & 160 deletions tests/testcases_current.json
Original file line number Diff line number Diff line change
Expand Up @@ -14736,15 +14736,15 @@
"output": [
"0 | Council : Execute",
"1 | Proposal [1/2] : Remark",
"1 | Proposal [2/2] : 1427452",
"1 | Proposal [2/2] : 31343237343532",
"2 | Length bound : 165465456",
"3 | Tip [1/2] : EDG 123456789012345678901.234567890123",
"3 | Tip [2/2] : 456789"
],
"output_expert": [
"0 | Council : Execute",
"1 | Proposal [1/2] : Remark",
"1 | Proposal [2/2] : 1427452",
"1 | Proposal [2/2] : 31343237343532",
"2 | Length bound : 165465456",
"3 | Chain : Edgeware",
"4 | Nonce : 0",
Expand All @@ -14759,19 +14759,21 @@
{
"index": 711,
"name": "Council_Execute",
"blob": "0b01000110333434361e46f02ed503ae1103008ed73e0d3500000002000000742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b",
"blob": "0b010a05742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5bc2357327d503ae1103008ed73e0d3500000002000000742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b",
"output": [
"0 | Council : Execute",
"1 | Proposal [1/2] : Remark",
"1 | Proposal [2/2] : 3446",
"2 | Length bound : 196874631",
"1 | Proposal [1/3] : External propose majority",
"1 | Proposal [2/3] : 742a2ca70c2fda6cee4f8df98d64c4c670a052",
"1 | Proposal [3/3] : d9568058982dad9d5a7a135c5b",
"2 | Length bound : 165465456",
"3 | Tip : EDG 0.000000000055555555"
],
"output_expert": [
"0 | Council : Execute",
"1 | Proposal [1/2] : Remark",
"1 | Proposal [2/2] : 3446",
"2 | Length bound : 196874631",
"1 | Proposal [1/3] : External propose majority",
"1 | Proposal [2/3] : 742a2ca70c2fda6cee4f8df98d64c4c670a052",
"1 | Proposal [3/3] : d9568058982dad9d5a7a135c5b",
"2 | Length bound : 165465456",
"3 | Chain : Edgeware",
"4 | Nonce : 50283",
"5 | Tip : EDG 0.000000000055555555",
Expand All @@ -14788,13 +14790,13 @@
"output": [
"0 | Council : Execute",
"1 | Proposal [1/2] : Remark",
"1 | Proposal [2/2] : 49845474",
"1 | Proposal [2/2] : 3439383435343734",
"2 | Length bound : 57464654"
],
"output_expert": [
"0 | Council : Execute",
"1 | Proposal [1/2] : Remark",
"1 | Proposal [2/2] : 49845474",
"1 | Proposal [2/2] : 3439383435343734",
"2 | Length bound : 57464654",
"3 | Chain : Edgeware",
"4 | Nonce : 100",
Expand All @@ -14807,19 +14809,19 @@
{
"index": 713,
"name": "Council_Execute",
"blob": "0b010001143131323532991fd503046d0f3500000002000000742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b",
"blob": "0b010000e6c0a1433a5db30dd503046d0f3500000002000000742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b",
"output": [
"0 | Council : Execute",
"1 | Proposal [1/2] : Remark",
"1 | Proposal [2/2] : 11252",
"2 | Length bound : 2022",
"1 | Proposal [1/2] : Fill block",
"1 | Proposal [2/2] : 113.4674150%",
"2 | Length bound : 57464654",
"3 | Tip : EDG 0.000000000000000987"
],
"output_expert": [
"0 | Council : Execute",
"1 | Proposal [1/2] : Remark",
"1 | Proposal [2/2] : 11252",
"2 | Length bound : 2022",
"1 | Proposal [1/2] : Fill block",
"1 | Proposal [2/2] : 113.4674150%",
"2 | Length bound : 57464654",
"3 | Chain : Edgeware",
"4 | Nonce : 1",
"5 | Tip : EDG 0.000000000000000987",
Expand All @@ -14832,19 +14834,27 @@
{
"index": 714,
"name": "Council_Execute",
"blob": "0b01000114303030303108d5038d2403d20296493500000002000000742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b",
"blob": "0b01060200decd3e78683cdb7568c3135cd412b54b57930e0b9c7ee4c7a64762ba1ed613ef00decd3e78683cdb7568c3135cd412b54b57930e0b9c7ee4c7a64762ba1ed613ef0b63ce64c10c053a5db30dd5038d2403d20296493500000002000000742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b",
"output": [
"0 | Council : Execute",
"1 | Proposal [1/2] : Remark",
"1 | Proposal [2/2] : 00001",
"2 | Length bound : 2",
"1 | Proposal [1/6] : Force transfer",
"1 | Proposal [2/6] : nYkQnG2wt4rPg6coxLF8U2ZdLYYW9L2Nkv1YC5",
"1 | Proposal [3/6] : 6dyKjVhjr",
"1 | Proposal [4/6] : nYkQnG2wt4rPg6coxLF8U2ZdLYYW9L2Nkv1YC5",
"1 | Proposal [5/6] : 6dyKjVhjr",
"1 | Proposal [6/6] : EDG 0.000005552342355555",
"2 | Length bound : 57464654",
"3 | Tip : EDG 0.00000000123456789"
],
"output_expert": [
"0 | Council : Execute",
"1 | Proposal [1/2] : Remark",
"1 | Proposal [2/2] : 00001",
"2 | Length bound : 2",
"1 | Proposal [1/6] : Force transfer",
"1 | Proposal [2/6] : nYkQnG2wt4rPg6coxLF8U2ZdLYYW9L2Nkv1YC5",
"1 | Proposal [3/6] : 6dyKjVhjr",
"1 | Proposal [4/6] : nYkQnG2wt4rPg6coxLF8U2ZdLYYW9L2Nkv1YC5",
"1 | Proposal [5/6] : 6dyKjVhjr",
"1 | Proposal [6/6] : EDG 0.000005552342355555",
"2 | Length bound : 57464654",
"3 | Chain : Edgeware",
"4 | Nonce : 2339",
"5 | Tip : EDG 0.00000000123456789",
Expand All @@ -14853,140 +14863,7 @@
"8 | Block [1/2] : 742a2ca70c2fda6cee4f8df98d64c4c670a052",
"8 | Block [2/2] : d9568058982dad9d5a7a135c5b"
]
},
{
"index": 715,
"name": "Council_Propose",
"blob": "0b02ec00000c000000c2585115d5030033158139ae28a3dfaac5fe1560a5e9e05c3500000002000000742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b",
"output": [
"0 | Council : Propose",
"1 | Threshold : 59",
"2 | Proposal [1/2] : Fill block",
"2 | Proposal [2/2] : 12%",
"3 | Length bound : 89413168",
"4 | Tip [1/2] : EDG 123456789012345678901.234567890123",
"4 | Tip [2/2] : 456789"
],
"output_expert": [
"0 | Council : Propose",
"1 | Threshold : 59",
"2 | Proposal [1/2] : Fill block",
"2 | Proposal [2/2] : 12%",
"3 | Length bound : 89413168",
"4 | Chain : Edgeware",
"5 | Nonce : 0",
"6 | Tip [1/2] : EDG 123456789012345678901.234567890123",
"6 | Tip [2/2] : 456789",
"7 | Era Phase : 61",
"8 | Era Period : 64",
"9 | Block [1/2] : 742a2ca70c2fda6cee4f8df98d64c4c670a052",
"9 | Block [2/2] : d9568058982dad9d5a7a135c5b"
]
},
{
"index": 716,
"name": "Council_Propose",
"blob": "0b02cdbd00060444302e3136353436343839343436353438344e683001d503ae1103008ed73e0d3500000002000000742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b",
"output": [
"0 | Council : Propose",
"1 | Threshold : 12147",
"2 | Proposal [1/2] : Kill storage",
"2 | Proposal [2/2] : 0.165464894465484",
"3 | Length bound : 4987411",
"4 | Tip : EDG 0.000000000055555555"
],
"output_expert": [
"0 | Council : Propose",
"1 | Threshold : 12147",
"2 | Proposal [1/2] : Kill storage",
"2 | Proposal [2/2] : 0.165464894465484",
"3 | Length bound : 4987411",
"4 | Chain : Edgeware",
"5 | Nonce : 50283",
"6 | Tip : EDG 0.000000000055555555",
"7 | Era Phase : 61",
"8 | Era Period : 64",
"9 | Block [1/2] : 742a2ca70c2fda6cee4f8df98d64c4c670a052",
"9 | Block [2/2] : d9568058982dad9d5a7a135c5b"
]
},
{
"index": 717,
"name": "Council_Propose",
"blob": "0b021d020003303136373631333231363537344a0b0300d5039101003500000002000000742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b",
"output": [
"0 | Council : Propose",
"1 | Threshold : 135",
"2 | Proposal [1/2] : Set code",
"2 | Proposal [2/2] : 167613216574",
"3 | Length bound : 49874"
],
"output_expert": [
"0 | Council : Propose",
"1 | Threshold : 135",
"2 | Proposal [1/2] : Set code",
"2 | Proposal [2/2] : 167613216574",
"3 | Length bound : 49874",
"4 | Chain : Edgeware",
"5 | Nonce : 100",
"6 | Era Phase : 61",
"7 | Era Period : 64",
"8 | Block [1/2] : 742a2ca70c2fda6cee4f8df98d64c4c670a052",
"8 | Block [2/2] : d9568058982dad9d5a7a135c5b"
]
},
{
"index": 718,
"name": "Council_Propose",
"blob": "0b02100006042c302e313635343634353634f578d503046d0f3500000002000000742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b",
"output": [
"0 | Council : Propose",
"1 | Threshold : 4",
"2 | Proposal [1/2] : Kill storage",
"2 | Proposal [2/2] : 0.165464564",
"3 | Length bound : 7741",
"4 | Tip : EDG 0.000000000000000987"
],
"output_expert": [
"0 | Council : Propose",
"1 | Threshold : 4",
"2 | Proposal [1/2] : Kill storage",
"2 | Proposal [2/2] : 0.165464564",
"3 | Length bound : 7741",
"4 | Chain : Edgeware",
"5 | Nonce : 1",
"6 | Tip : EDG 0.000000000000000987",
"7 | Era Phase : 61",
"8 | Era Period : 64",
"9 | Block [1/2] : 742a2ca70c2fda6cee4f8df98d64c4c670a052",
"9 | Block [2/2] : d9568058982dad9d5a7a135c5b"
]
},
{
"index": 719,
"name": "Council_Propose",
"blob": "0b02014700060444302e30303030303030303030353436353416c98113d5038d2403d20296493500000002000000742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b",
"output": [
"0 | Council : Propose",
"1 | Threshold : 4544",
"2 | Proposal [1/2] : Kill storage",
"2 | Proposal [2/2] : 0.000000000054654",
"3 | Length bound : 81818181",
"4 | Tip : EDG 0.00000000123456789"
],
"output_expert": [
"0 | Council : Propose",
"1 | Threshold : 4544",
"2 | Proposal [1/2] : Kill storage",
"2 | Proposal [2/2] : 0.000000000054654",
"3 | Length bound : 81818181",
"4 | Chain : Edgeware",
"5 | Nonce : 2339",
"6 | Tip : EDG 0.00000000123456789",
"7 | Era Phase : 61",
"8 | Era Period : 64",
"9 | Block [1/2] : 742a2ca70c2fda6cee4f8df98d64c4c670a052",
"9 | Block [2/2] : d9568058982dad9d5a7a135c5b"
]
}


]

0 comments on commit 819ea64

Please sign in to comment.