Skip to content

Commit

Permalink
Merge pull request #162 from Zondax/update-9330
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosala authored Nov 29, 2022
2 parents a971ea4 + 68e835f commit ca90361
Show file tree
Hide file tree
Showing 33 changed files with 56,435 additions and 55,425 deletions.
57 changes: 29 additions & 28 deletions README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions app/Makefile.version
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This is the `transaction_version` field of `Runtime`
APPVERSION_M=16
APPVERSION_M=17
# This is the `spec_version` field of `Runtime`
APPVERSION_N=9310
APPVERSION_N=9330
# This is the patch version of this release
APPVERSION_P=0
34 changes: 17 additions & 17 deletions app/src/substrate/substrate_dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ parser_error_t _readMethod(
pd_Method_t* method)
{
switch (c->tx_obj->transactionVersion) {
case 17:
return _readMethod_V17(c, moduleIdx, callIdx, &method->V17);
case 16:
return _readMethod_V16(c, moduleIdx, callIdx, &method->V16);
case 15:
return _readMethod_V15(c, moduleIdx, callIdx, &method->V15);
default:
return parser_tx_version_not_supported;
}
Expand All @@ -38,10 +38,10 @@ parser_error_t _readMethod(
uint8_t _getMethod_NumItems(uint32_t transactionVersion, uint8_t moduleIdx, uint8_t callIdx)
{
switch (transactionVersion) {
case 17:
return _getMethod_NumItems_V17(moduleIdx, callIdx);
case 16:
return _getMethod_NumItems_V16(moduleIdx, callIdx);
case 15:
return _getMethod_NumItems_V15(moduleIdx, callIdx);
default:
return parser_tx_version_not_supported;
}
Expand All @@ -50,10 +50,10 @@ uint8_t _getMethod_NumItems(uint32_t transactionVersion, uint8_t moduleIdx, uint
const char* _getMethod_ModuleName(uint32_t transactionVersion, uint8_t moduleIdx)
{
switch (transactionVersion) {
case 17:
return _getMethod_ModuleName_V17(moduleIdx);
case 16:
return _getMethod_ModuleName_V16(moduleIdx);
case 15:
return _getMethod_ModuleName_V15(moduleIdx);
default:
return NULL;
}
Expand All @@ -62,10 +62,10 @@ const char* _getMethod_ModuleName(uint32_t transactionVersion, uint8_t moduleIdx
const char* _getMethod_Name(uint32_t transactionVersion, uint8_t moduleIdx, uint8_t callIdx)
{
switch (transactionVersion) {
case 17:
return _getMethod_Name_V17(moduleIdx, callIdx);
case 16:
return _getMethod_Name_V16(moduleIdx, callIdx);
case 15:
return _getMethod_Name_V15(moduleIdx, callIdx);
default:
return 0;
}
Expand All @@ -74,10 +74,10 @@ const char* _getMethod_Name(uint32_t transactionVersion, uint8_t moduleIdx, uint
const char* _getMethod_ItemName(uint32_t transactionVersion, uint8_t moduleIdx, uint8_t callIdx, uint8_t itemIdx)
{
switch (transactionVersion) {
case 17:
return _getMethod_ItemName_V17(moduleIdx, callIdx, itemIdx);
case 16:
return _getMethod_ItemName_V16(moduleIdx, callIdx, itemIdx);
case 15:
return _getMethod_ItemName_V15(moduleIdx, callIdx, itemIdx);
default:
return NULL;
}
Expand All @@ -88,12 +88,12 @@ parser_error_t _getMethod_ItemValue(uint32_t transactionVersion, pd_Method_t* m,
uint8_t pageIdx, uint8_t* pageCount)
{
switch (transactionVersion) {
case 17:
return _getMethod_ItemValue_V17(&m->V17, moduleIdx, callIdx, itemIdx, outValue,
outValueLen, pageIdx, pageCount);
case 16:
return _getMethod_ItemValue_V16(&m->V16, moduleIdx, callIdx, itemIdx, outValue,
outValueLen, pageIdx, pageCount);
case 15:
return _getMethod_ItemValue_V15(&m->V15, moduleIdx, callIdx, itemIdx, outValue,
outValueLen, pageIdx, pageCount);
default:
return parser_tx_version_not_supported;
}
Expand All @@ -102,10 +102,10 @@ parser_error_t _getMethod_ItemValue(uint32_t transactionVersion, pd_Method_t* m,
bool _getMethod_ItemIsExpert(uint32_t transactionVersion, uint8_t moduleIdx, uint8_t callIdx, uint8_t itemIdx)
{
switch (transactionVersion) {
case 17:
return _getMethod_ItemIsExpert_V17(moduleIdx, callIdx, itemIdx);
case 16:
return _getMethod_ItemIsExpert_V16(moduleIdx, callIdx, itemIdx);
case 15:
return _getMethod_ItemIsExpert_V15(moduleIdx, callIdx, itemIdx);
default:
return false;
}
Expand All @@ -114,10 +114,10 @@ bool _getMethod_ItemIsExpert(uint32_t transactionVersion, uint8_t moduleIdx, uin
bool _getMethod_IsNestingSupported(uint32_t transactionVersion, uint8_t moduleIdx, uint8_t callIdx)
{
switch (transactionVersion) {
case 17:
return _getMethod_IsNestingSupported_V17(moduleIdx, callIdx);
case 16:
return _getMethod_IsNestingSupported_V16(moduleIdx, callIdx);
case 15:
return _getMethod_IsNestingSupported_V15(moduleIdx, callIdx);
default:
return false;
}
Expand Down
8 changes: 4 additions & 4 deletions app/src/substrate/substrate_dispatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ extern "C" {

#include "parser_common.h"
#include "stdbool.h"
#include "substrate_dispatch_V15.h"
#include "substrate_dispatch_V16.h"
#include "substrate_dispatch_V17.h"
#include <stddef.h>
#include <stdint.h>

Expand All @@ -33,12 +33,12 @@ extern "C" {
{ \
switch (txVersion) { \
\
case 17: \
return PD_CALL_##CALL##_V17; \
\
case 16: \
return PD_CALL_##CALL##_V16; \
\
case 15: \
return PD_CALL_##CALL##_V15; \
\
default: \
return 0; \
} \
Expand Down
14 changes: 6 additions & 8 deletions app/src/substrate/substrate_dispatch_V16.c
Original file line number Diff line number Diff line change
Expand Up @@ -1855,7 +1855,7 @@ parser_error_t _readMethod_V16(
CHECK_ERROR(_readMethod_balances_transfer_all_V16(c, &method->basic.balances_transfer_all_V16))
break;
case 1792: /* module 7 call 0 */
CHECK_ERROR(_readMethod_staking_bond_V16(c, &method->basic.staking_bond_V16))
CHECK_ERROR(_readMethod_staking_bond_V16(c, &method->nested.staking_bond_V16))
break;
case 1793: /* module 7 call 1 */
CHECK_ERROR(_readMethod_staking_bond_extra_V16(c, &method->basic.staking_bond_extra_V16))
Expand All @@ -1870,7 +1870,7 @@ parser_error_t _readMethod_V16(
CHECK_ERROR(_readMethod_staking_validate_V16(c, &method->basic.staking_validate_V16))
break;
case 1797: /* module 7 call 5 */
CHECK_ERROR(_readMethod_staking_nominate_V16(c, &method->basic.staking_nominate_V16))
CHECK_ERROR(_readMethod_staking_nominate_V16(c, &method->nested.staking_nominate_V16))
break;
case 1798: /* module 7 call 6 */
CHECK_ERROR(_readMethod_staking_chill_V16(c, &method->basic.staking_chill_V16))
Expand Down Expand Up @@ -5687,17 +5687,17 @@ parser_error_t _getMethod_ItemValue_V16(
switch (itemIdx) {
case 0: /* staking_bond_V16 - controller */;
return _toStringAccountIdLookupOfT_V16(
&m->basic.staking_bond_V16.controller,
&m->nested.staking_bond_V16.controller,
outValue, outValueLen,
pageIdx, pageCount);
case 1: /* staking_bond_V16 - amount */;
return _toStringCompactBalance(
&m->basic.staking_bond_V16.amount,
&m->nested.staking_bond_V16.amount,
outValue, outValueLen,
pageIdx, pageCount);
case 2: /* staking_bond_V16 - payee */;
return _toStringRewardDestination_V16(
&m->basic.staking_bond_V16.payee,
&m->nested.staking_bond_V16.payee,
outValue, outValueLen,
pageIdx, pageCount);
default:
Expand Down Expand Up @@ -5747,7 +5747,7 @@ parser_error_t _getMethod_ItemValue_V16(
switch (itemIdx) {
case 0: /* staking_nominate_V16 - targets */;
return _toStringVecAccountIdLookupOfT_V16(
&m->basic.staking_nominate_V16.targets,
&m->nested.staking_nominate_V16.targets,
outValue, outValueLen,
pageIdx, pageCount);
default:
Expand Down Expand Up @@ -8827,12 +8827,10 @@ bool _getMethod_IsNestingSupported_V16(uint8_t moduleIdx, uint8_t callIdx)
case 1028: // Indices:Freeze
case 1284: // Balances:Transfer all
case 1285: // Balances:Force unreserve
case 1792: // Staking:Bond
case 1793: // Staking:Bond extra
case 1794: // Staking:Unbond
case 1795: // Staking:Withdraw Unbonded
case 1796: // Staking:Validate
case 1797: // Staking:Nominate
case 1798: // Staking:Chill
case 1799: // Staking:Set payee
case 1800: // Staking:Set controller
Expand Down
Loading

0 comments on commit ca90361

Please sign in to comment.