Skip to content

Commit

Permalink
Council test (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
Raj-RR1 authored Dec 15, 2023
1 parent 99de122 commit 6946dd8
Show file tree
Hide file tree
Showing 3 changed files with 301 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/src/substrate_dispatch_V2.c
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ __Z_INLINE parser_error_t _readMethod_council_vote_V2(
__Z_INLINE parser_error_t _readMethod_council_propose_V2(
parser_context_t *c, pd_council_propose_V2_t *m)
{
CHECK_ERROR(_readMemberCount_V2(c, &m->threshold))
CHECK_ERROR(_readCompactu32(c, &m->threshold))
CHECK_ERROR(_readProposal(c, &m->proposal))
CHECK_ERROR(_readCompactu32(c, &m->length_bound))
return parser_ok;
Expand Down Expand Up @@ -5464,7 +5464,7 @@ parser_error_t _getMethod_ItemValue_V2(
switch (itemIdx)
{
case 0: /* council_propose_V2 - threshold */;
return _toStringMemberCount_V2(
return _toStringCompactu32(
&m->nested.council_propose_V2.threshold,
outValue, outValueLen,
pageIdx, pageCount);
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 @@ -614,7 +614,7 @@ typedef struct {

#define PD_CALL_COUNCIL_PROPOSE_V2 2
typedef struct {
pd_MemberCount_V2_t threshold;
pd_Compactu32_t threshold;
pd_Proposal_t proposal;
pd_Compactu32_t length_bound;
} pd_council_propose_V2_t;
Expand Down
298 changes: 298 additions & 0 deletions tests/testcases_current.json
Original file line number Diff line number Diff line change
Expand Up @@ -13884,6 +13884,304 @@
"8 | Block [2/2] : d9568058982dad9d5a7a135c5b"
]
},
{
"index": 676,
"name": "Council_Execute",
"blob": "0b010f006d0f00decd3e78683cdb7568c3135cd412b54b57930e0b9c7ee4c7a64762ba1ed613efb104d5030033158139ae28a3dfaac5fe1560a5e9e05c3500000002000000742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b",
"output": [
"0 | Council : Execute",
"1 | Proposal [1/4] : Propose spend",
"1 | Proposal [2/4] : EDG 0.000000000000000987",
"1 | Proposal [3/4] : nYkQnG2wt4rPg6coxLF8U2ZdLYYW9L2Nkv1YC5",
"1 | Proposal [4/4] : 6dyKjVhjr",
"2 | Length bound : 300",
"3 | Tip [1/2] : EDG 123456789012345678901.234567890123",
"3 | Tip [2/2] : 456789"
],
"output_expert": [
"0 | Council : Execute",
"1 | Proposal [1/4] : Propose spend",
"1 | Proposal [2/4] : EDG 0.000000000000000987",
"1 | Proposal [3/4] : nYkQnG2wt4rPg6coxLF8U2ZdLYYW9L2Nkv1YC5",
"1 | Proposal [4/4] : 6dyKjVhjr",
"2 | Length bound : 300",
"3 | Chain : Edgeware",
"4 | Nonce : 0",
"5 | Tip [1/2] : EDG 123456789012345678901.234567890123",
"5 | Tip [2/2] : 456789",
"6 | Era Phase : 61",
"7 | Era Period : 64",
"8 | Block [1/2] : 742a2ca70c2fda6cee4f8df98d64c4c670a052",
"8 | Block [2/2] : d9568058982dad9d5a7a135c5b"
]
},
{
"index": 677,
"name": "Council_Execute",
"blob": "0b010000e6c0a1432103d503ae1103008ed73e0d3500000002000000742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b",
"output": [
"0 | Council : Execute",
"1 | Proposal [1/2] : Fill block",
"1 | Proposal [2/2] : 113.4674150%",
"2 | Length bound : 200",
"3 | Tip : EDG 0.000000000055555555"
],
"output_expert": [
"0 | Council : Execute",
"1 | Proposal [1/2] : Fill block",
"1 | Proposal [2/2] : 113.4674150%",
"2 | Length bound : 200",
"3 | Chain : Edgeware",
"4 | Nonce : 50283",
"5 | Tip : EDG 0.000000000055555555",
"6 | Era Phase : 61",
"7 | Era Period : 64",
"8 | Block [1/2] : 742a2ca70c2fda6cee4f8df98d64c4c670a052",
"8 | Block [2/2] : d9568058982dad9d5a7a135c5b"
]
},
{
"index": 678,
"name": "Council_Execute",
"blob": "0b01060200e8cff52e875507c312404c20e4de224fb73502fdd1dbde726a8de357a119e30e003ccf4e8f06004e01dafdda581d9d33a9fc1ef57a1d7923ce926d7d381758bb2a8ed73e0ded01d5039101003500000002000000742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b",
"output": [
"0 | Council : Execute",
"1 | Proposal [1/6] : Force transfer",
"1 | Proposal [2/6] : nmshJxrHb1dMQgheWmPWVwpeutwdep55tWa9GJ",
"1 | Proposal [3/6] : xLgJTcagc",
"1 | Proposal [4/6] : itMGQ4fPquMQqxN2i5i3UxKLjLYQNnDyLbPLMe",
"1 | Proposal [5/6] : rWMeyMVYL",
"1 | Proposal [6/6] : EDG 0.000000000055555555",
"2 | Length bound : 123"
],
"output_expert": [
"0 | Council : Execute",
"1 | Proposal [1/6] : Force transfer",
"1 | Proposal [2/6] : nmshJxrHb1dMQgheWmPWVwpeutwdep55tWa9GJ",
"1 | Proposal [3/6] : xLgJTcagc",
"1 | Proposal [4/6] : itMGQ4fPquMQqxN2i5i3UxKLjLYQNnDyLbPLMe",
"1 | Proposal [5/6] : rWMeyMVYL",
"1 | Proposal [6/6] : EDG 0.000000000055555555",
"2 | Length bound : 123",
"3 | Chain : Edgeware",
"4 | Nonce : 100",
"5 | Era Phase : 61",
"6 | Era Period : 64",
"7 | Block [1/2] : 742a2ca70c2fda6cee4f8df98d64c4c670a052",
"7 | Block [2/2] : d9568058982dad9d5a7a135c5b"
]
},
{
"index": 679,
"name": "Council_Execute",
"blob": "0b010b02040000e6c0a143802103d503046d0f3500000002000000742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b",
"output": [
"0 | Council : Execute",
"1 | Proposal [1/5] : Propose",
"1 | Proposal [2/5] : 1",
"1 | Proposal [3/5] : Fill block",
"1 | Proposal [4/5] : 113.4674150%",
"1 | Proposal [5/5] : 32",
"2 | Length bound : 200",
"3 | Tip : EDG 0.000000000000000987"
],
"output_expert": [
"0 | Council : Execute",
"1 | Proposal [1/5] : Propose",
"1 | Proposal [2/5] : 1",
"1 | Proposal [3/5] : Fill block",
"1 | Proposal [4/5] : 113.4674150%",
"1 | Proposal [5/5] : 32",
"2 | Length bound : 200",
"3 | Chain : Edgeware",
"4 | Nonce : 1",
"5 | Tip : EDG 0.000000000000000987",
"6 | Era Phase : 61",
"7 | Era Period : 64",
"8 | Block [1/2] : 742a2ca70c2fda6cee4f8df98d64c4c670a052",
"8 | Block [2/2] : d9568058982dad9d5a7a135c5b"
]
},
{
"index": 680,
"name": "Council_Execute",
"blob": "0b01060000decd3e78683cdb7568c3135cd412b54b57930e0b9c7ee4c7a64762ba1ed613ef8ed73e0d0104d5038d2403d20296493500000002000000742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b",
"output": [
"0 | Council : Execute",
"1 | Proposal [1/4] : Transfer",
"1 | Proposal [2/4] : nYkQnG2wt4rPg6coxLF8U2ZdLYYW9L2Nkv1YC5",
"1 | Proposal [3/4] : 6dyKjVhjr",
"1 | Proposal [4/4] : EDG 0.000000000055555555",
"2 | Length bound : 256",
"3 | Tip : EDG 0.00000000123456789"
],
"output_expert": [
"0 | Council : Execute",
"1 | Proposal [1/4] : Transfer",
"1 | Proposal [2/4] : nYkQnG2wt4rPg6coxLF8U2ZdLYYW9L2Nkv1YC5",
"1 | Proposal [3/4] : 6dyKjVhjr",
"1 | Proposal [4/4] : EDG 0.000000000055555555",
"2 | Length bound : 256",
"3 | Chain : Edgeware",
"4 | Nonce : 2339",
"5 | Tip : EDG 0.00000000123456789",
"6 | Era Phase : 61",
"7 | Era Period : 64",
"8 | Block [1/2] : 742a2ca70c2fda6cee4f8df98d64c4c670a052",
"8 | Block [2/2] : d9568058982dad9d5a7a135c5b"
]
},
{
"index": 681,
"name": "Council_Propose",
"blob": "0b020400002a6d4b149101d5030033158139ae28a3dfaac5fe1560a5e9e05c3500000002000000742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b",
"output": [
"0 | Council : Propose",
"1 | Threshold : 1",
"2 | Proposal [1/2] : Fill block",
"2 | Proposal [2/2] : 34.0487466%",
"3 | Length bound : 100",
"4 | Tip [1/2] : EDG 123456789012345678901.234567890123",
"4 | Tip [2/2] : 456789"
],
"output_expert": [
"0 | Council : Propose",
"1 | Threshold : 1",
"2 | Proposal [1/2] : Fill block",
"2 | Proposal [2/2] : 34.0487466%",
"3 | Length bound : 100",
"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": 682,
"name": "Council_Propose",
"blob": "0b02080f006d0f00decd3e78683cdb7568c3135cd412b54b57930e0b9c7ee4c7a64762ba1ed613efa10fd503ae1103008ed73e0d3500000002000000742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b",
"output": [
"0 | Council : Propose",
"1 | Threshold : 2",
"2 | Proposal [1/4] : Propose spend",
"2 | Proposal [2/4] : EDG 0.000000000000000987",
"2 | Proposal [3/4] : nYkQnG2wt4rPg6coxLF8U2ZdLYYW9L2Nkv1YC5",
"2 | Proposal [4/4] : 6dyKjVhjr",
"3 | Length bound : 1000",
"4 | Tip : EDG 0.000000000055555555"
],
"output_expert": [
"0 | Council : Propose",
"1 | Threshold : 2",
"2 | Proposal [1/4] : Propose spend",
"2 | Proposal [2/4] : EDG 0.000000000000000987",
"2 | Proposal [3/4] : nYkQnG2wt4rPg6coxLF8U2ZdLYYW9L2Nkv1YC5",
"2 | Proposal [4/4] : 6dyKjVhjr",
"3 | Length bound : 1000",
"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": 683,
"name": "Council_Propose",
"blob": "0b020c060000decd3e78683cdb7568c3135cd412b54b57930e0b9c7ee4c7a64762ba1ed613ef8ed73e0d0110d5039101003500000002000000742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b",
"output": [
"0 | Council : Propose",
"1 | Threshold : 3",
"2 | Proposal [1/4] : Transfer",
"2 | Proposal [2/4] : nYkQnG2wt4rPg6coxLF8U2ZdLYYW9L2Nkv1YC5",
"2 | Proposal [3/4] : 6dyKjVhjr",
"2 | Proposal [4/4] : EDG 0.000000000055555555",
"3 | Length bound : 1024"
],
"output_expert": [
"0 | Council : Propose",
"1 | Threshold : 3",
"2 | Proposal [1/4] : Transfer",
"2 | Proposal [2/4] : nYkQnG2wt4rPg6coxLF8U2ZdLYYW9L2Nkv1YC5",
"2 | Proposal [3/4] : 6dyKjVhjr",
"2 | Proposal [4/4] : EDG 0.000000000055555555",
"3 | Length bound : 1024",
"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": 684,
"name": "Council_Propose",
"blob": "0b0214060300decd3e78683cdb7568c3135cd412b54b57930e0b9c7ee4c7a64762ba1ed613ef6d0fa11fd503046d0f3500000002000000742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b",
"output": [
"0 | Council : Propose",
"1 | Threshold : 5",
"2 | Proposal [1/4] : Transfer keep alive",
"2 | Proposal [2/4] : nYkQnG2wt4rPg6coxLF8U2ZdLYYW9L2Nkv1YC5",
"2 | Proposal [3/4] : 6dyKjVhjr",
"2 | Proposal [4/4] : EDG 0.000000000000000987",
"3 | Length bound : 2024",
"4 | Tip : EDG 0.000000000000000987"
],
"output_expert": [
"0 | Council : Propose",
"1 | Threshold : 5",
"2 | Proposal [1/4] : Transfer keep alive",
"2 | Proposal [2/4] : nYkQnG2wt4rPg6coxLF8U2ZdLYYW9L2Nkv1YC5",
"2 | Proposal [3/4] : 6dyKjVhjr",
"2 | Proposal [4/4] : EDG 0.000000000000000987",
"3 | Length bound : 2024",
"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": 685,
"name": "Council_Propose",
"blob": "0b0228060000decd3e78683cdb7568c3135cd412b54b57930e0b9c7ee4c7a64762ba1ed613ef6d0fa11fd5038d2403d20296493500000002000000742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b",
"output": [
"0 | Council : Propose",
"1 | Threshold : 10",
"2 | Proposal [1/4] : Transfer",
"2 | Proposal [2/4] : nYkQnG2wt4rPg6coxLF8U2ZdLYYW9L2Nkv1YC5",
"2 | Proposal [3/4] : 6dyKjVhjr",
"2 | Proposal [4/4] : EDG 0.000000000000000987",
"3 | Length bound : 2024",
"4 | Tip : EDG 0.00000000123456789"
],
"output_expert": [
"0 | Council : Propose",
"1 | Threshold : 10",
"2 | Proposal [1/4] : Transfer",
"2 | Proposal [2/4] : nYkQnG2wt4rPg6coxLF8U2ZdLYYW9L2Nkv1YC5",
"2 | Proposal [3/4] : 6dyKjVhjr",
"2 | Proposal [4/4] : EDG 0.000000000000000987",
"3 | Length bound : 2024",
"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"
]
},
{
"index": 756,
"name": "Elections_Clean_Defunct_Voters",
Expand Down

0 comments on commit 6946dd8

Please sign in to comment.