Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
Merge pull request #151 from Zondax/update/9200
Browse files Browse the repository at this point in the history
update to spec v9200
  • Loading branch information
carlosala authored May 4, 2022
2 parents c105e3b + 9d34754 commit e5bbcaa
Show file tree
Hide file tree
Showing 16 changed files with 19,690 additions and 19,514 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Please:
- **Do not use in production**
- **Do not use a Ledger device with funds for development purposes.**
- **Have a separate and marked device that is used ONLY for development and testing**
# Kusama 11.9190.x
# Kusama 11.9200.x

## System

Expand Down Expand Up @@ -296,8 +296,8 @@ Please:
| :---------- |:------------:|:--------:|:--------:|:--------|
|Vest | | :heavy_check_mark: | | |
|Vest other | | :heavy_check_mark: | | `LookupasStaticLookupSource` target <br/> |
|Vested transfer | | | | `LookupasStaticLookupSource` target <br/>`VestingInfoBalanceOfTBlockNumber` schedule <br/> |
|Force vested transfer | | | | `LookupasStaticLookupSource` source <br/>`LookupasStaticLookupSource` target <br/>`VestingInfoBalanceOfTBlockNumber` schedule <br/> |
|Vested transfer | | | | `LookupasStaticLookupSource` target <br/>`VestingInfo` schedule <br/> |
|Force vested transfer | | | | `LookupasStaticLookupSource` source <br/>`LookupasStaticLookupSource` target <br/>`VestingInfo` schedule <br/> |
|Merge schedules | | :heavy_check_mark: | | `u32` schedule1_index <br/>`u32` schedule2_index <br/> |

## Scheduler
Expand Down
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=11
# This is the `spec_version` field of `Runtime`
APPVERSION_N=9190
APPVERSION_N=9200
# This is the patch version of this release
APPVERSION_P=1
APPVERSION_P=0
6 changes: 3 additions & 3 deletions app/src/substrate/substrate_functions_V11.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ parser_error_t _readVecKeyValue_V11(parser_context_t* c, pd_VecKeyValue_V11_t* v
parser_error_t _readVecKey_V11(parser_context_t* c, pd_VecKey_V11_t* v);
parser_error_t _readVecLookupasStaticLookupSource_V11(parser_context_t* c, pd_VecLookupasStaticLookupSource_V11_t* v);
parser_error_t _readVecTupleAccountIdData_V11(parser_context_t* c, pd_VecTupleAccountIdData_V11_t* v);
parser_error_t _readVestingInfoBalanceOfTBlockNumber_V11(parser_context_t* c, pd_VestingInfoBalanceOfTBlockNumber_V11_t* v);
parser_error_t _readVestingInfo_V11(parser_context_t* c, pd_VestingInfo_V11_t* v);
parser_error_t _readVote_V11(parser_context_t* c, pd_Vote_V11_t* v);
parser_error_t _readWeightLimit_V11(parser_context_t* c, pd_WeightLimit_V11_t* v);
parser_error_t _readWeight_V11(parser_context_t* c, pd_Weight_V11_t* v);
Expand Down Expand Up @@ -707,8 +707,8 @@ parser_error_t _toStringVecTupleAccountIdData_V11(
uint8_t pageIdx,
uint8_t* pageCount);

parser_error_t _toStringVestingInfoBalanceOfTBlockNumber_V11(
const pd_VestingInfoBalanceOfTBlockNumber_V11_t* v,
parser_error_t _toStringVestingInfo_V11(
const pd_VestingInfo_V11_t* v,
char* outValue,
uint16_t outValueLen,
uint8_t pageIdx,
Expand Down
65 changes: 55 additions & 10 deletions app/src/substrate/substrate_types_V11.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,10 @@ parser_error_t _readRewardDestination_V11(parser_context_t* c, pd_RewardDestinat
{
CHECK_INPUT()
CHECK_ERROR(_readUInt8(c, &v->value))
if (v->value > 2) {

if (v->value == 3) {
CHECK_ERROR(_readAccountId_V11(c, &v->accountId))
} else if (v->value > 4) {
return parser_value_out_of_range;
}
return parser_ok;
Expand Down Expand Up @@ -432,9 +435,12 @@ parser_error_t _readValidatorSignature_V11(parser_context_t* c, pd_ValidatorSign
return parser_not_supported;
}

parser_error_t _readVestingInfoBalanceOfTBlockNumber_V11(parser_context_t* c, pd_VestingInfoBalanceOfTBlockNumber_V11_t* v)
parser_error_t _readVestingInfo_V11(parser_context_t* c, pd_VestingInfo_V11_t* v)
{
return parser_not_supported;
CHECK_ERROR(_readBalanceOf(c, &v->locked))
CHECK_ERROR(_readBalanceOf(c, &v->per_block))
CHECK_ERROR(_readBlockNumber(c, &v->starting_block))
return parser_ok;
}

parser_error_t _readVote_V11(parser_context_t* c, pd_Vote_V11_t* v)
Expand Down Expand Up @@ -725,10 +731,10 @@ parser_error_t _toStringAccountVote_V11(
CLEAN_AND_CHECK()
switch (v->value) {
case 0:
_toStringAccountVoteStandard_V11(&v->voteStandard, outValue, outValueLen, pageIdx, pageCount);
CHECK_ERROR(_toStringAccountVoteStandard_V11(&v->voteStandard, outValue, outValueLen, pageIdx, pageCount));
break;
case 1:
_toStringAccountVoteSplit_V11(&v->voteSplit, outValue, outValueLen, pageIdx, pageCount);
CHECK_ERROR(_toStringAccountVoteSplit_V11(&v->voteSplit, outValue, outValueLen, pageIdx, pageCount));
break;
default:
return parser_unexpected_value;
Expand Down Expand Up @@ -1384,6 +1390,12 @@ parser_error_t _toStringRewardDestination_V11(
case 2:
snprintf(outValue, outValueLen, "Controller");
break;
case 3:
CHECK_ERROR(_toStringAccountId_V11(&v->accountId, outValue, outValueLen, pageIdx, pageCount));
break;
case 4:
snprintf(outValue, outValueLen, "None");
break;
default:
return parser_print_not_supported;
}
Expand Down Expand Up @@ -1444,7 +1456,7 @@ parser_error_t _toStringTimepoint_V11(
CLEAN_AND_CHECK()

// First measure number of pages
uint8_t pages[2];
uint8_t pages[2] = { 0 };
CHECK_ERROR(_toStringBlockNumber(&v->height, outValue, outValueLen, 0, &pages[0]))
CHECK_ERROR(_toStringu32(&v->index, outValue, outValueLen, 0, &pages[1]))

Expand Down Expand Up @@ -1525,7 +1537,7 @@ parser_error_t _toStringValidatorPrefs_V11(
CLEAN_AND_CHECK()

// First measure number of pages
uint8_t pages[2];
uint8_t pages[2] = { 0 };
CHECK_ERROR(_toStringCompactPerBill_V11(&v->commission, outValue, outValueLen, 0, &pages[0]))
CHECK_ERROR(_toStringbool(&v->blocked, outValue, outValueLen, 0, &pages[1]))

Expand Down Expand Up @@ -1563,15 +1575,48 @@ parser_error_t _toStringValidatorSignature_V11(
return parser_print_not_supported;
}

parser_error_t _toStringVestingInfoBalanceOfTBlockNumber_V11(
const pd_VestingInfoBalanceOfTBlockNumber_V11_t* v,
parser_error_t _toStringVestingInfo_V11(
const pd_VestingInfo_V11_t* v,
char* outValue,
uint16_t outValueLen,
uint8_t pageIdx,
uint8_t* pageCount)
{
CLEAN_AND_CHECK()
return parser_print_not_supported;

// First measure number of pages
uint8_t pages[3] = { 0 };
CHECK_ERROR(_toStringBalanceOf(&v->locked, outValue, outValueLen, 0, &pages[0]))
CHECK_ERROR(_toStringBalanceOf(&v->per_block, outValue, outValueLen, 0, &pages[1]))
CHECK_ERROR(_toStringBlockNumber(&v->starting_block, outValue, outValueLen, 0, &pages[2]))

*pageCount = 0;
for (uint8_t i = 0; i < (uint8_t)sizeof(pages); i++) {
*pageCount += pages[i];
}

if (pageIdx > *pageCount) {
return parser_display_idx_out_of_range;
}

if (pageIdx < pages[0]) {
CHECK_ERROR(_toStringBalanceOf(&v->locked, outValue, outValueLen, pageIdx, &pages[0]))
return parser_ok;
}
pageIdx -= pages[0];

if (pageIdx < pages[1]) {
CHECK_ERROR(_toStringBalanceOf(&v->per_block, outValue, outValueLen, pageIdx, &pages[1]))
return parser_ok;
}
pageIdx -= pages[1];

if (pageIdx < pages[2]) {
CHECK_ERROR(_toStringBlockNumber(&v->starting_block, outValue, outValueLen, pageIdx, &pages[2]))
return parser_ok;
}

return parser_display_idx_out_of_range;
}

parser_error_t _toStringVote_V11(
Expand Down
20 changes: 11 additions & 9 deletions app/src/substrate/substrate_types_V11.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ typedef struct {
pd_Timepoint_V11_t contained;
} pd_OptionTimepoint_V11_t;

typedef struct {
uint8_t value;
pd_AccountId_V11_t accountId;
} pd_RewardDestination_V11_t;

typedef struct {
pd_CompactPerBill_V11_t commission;
pd_bool_t blocked;
Expand All @@ -151,6 +156,12 @@ typedef struct {
uint64_t _lenBuffer;
} pd_VecLookupasStaticLookupSource_V11_t;

typedef struct {
pd_BalanceOf_t locked;
pd_BalanceOf_t per_block;
pd_BlockNumber_t starting_block;
} pd_VestingInfo_V11_t;

typedef struct {
uint32_t value;
} pd_AccountIndex_V11_t;
Expand Down Expand Up @@ -395,10 +406,6 @@ typedef struct {
uint8_t _NOT_IMPLEMENTED__DO_NOT_USE;
} pd_Renouncing_V11_t;

typedef struct {
uint8_t value;
} pd_RewardDestination_V11_t;

typedef struct {
uint32_t value;
} pd_SessionIndex_V11_t;
Expand Down Expand Up @@ -452,11 +459,6 @@ typedef struct {
uint64_t _lenBuffer;
} pd_VecTupleAccountIdData_V11_t;

typedef struct {
// TODO: Not implemented
uint8_t _NOT_IMPLEMENTED__DO_NOT_USE;
} pd_VestingInfoBalanceOfTBlockNumber_V11_t;

typedef struct {
uint64_t value;
} pd_WeightLimit_V11_t;
Expand Down
Loading

0 comments on commit e5bbcaa

Please sign in to comment.