Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
juditortiz10 committed May 15, 2024
1 parent b109242 commit cbbe9b1
Show file tree
Hide file tree
Showing 12 changed files with 31,912 additions and 30,619 deletions.
4 changes: 2 additions & 2 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 25.1002000.x
# Kusama 25.1002001.x

## System

Expand Down Expand Up @@ -250,7 +250,7 @@ Please:
| Add username authority | | :heavy_check_mark: | :heavy_check_mark: | | `AccountIdLookupOfT`authority<br/>`Vecu8`suffix<br/>`u32`allocation<br/> |
| Remove username authority | | :heavy_check_mark: | :heavy_check_mark: | | `AccountIdLookupOfT`authority<br/> |
| Set username for | | | | | `AccountIdLookupOfT`who<br/>`Vecu8`username<br/>`OptionOffchainSignature`signature<br/> |
| Accept username | | | | | `UsernameT`username<br/> |
| Accept username | | :heavy_check_mark: | :heavy_check_mark: | | `UsernameT`username<br/> |
| Remove expired approval | | | | | `UsernameT`username<br/> |
| Set primary username | | | | | `UsernameT`username<br/> |
| Remove dangling username | | | | | `UsernameT`username<br/> |
Expand Down
32 changes: 32 additions & 0 deletions app/src/substrate/substrate_dispatch_V25.c
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,13 @@ __Z_INLINE parser_error_t _readMethod_identity_remove_username_authority_V25(
return parser_ok;
}

__Z_INLINE parser_error_t _readMethod_identity_accept_username_V25(
parser_context_t* c, pd_identity_accept_username_V25_t* m)
{
CHECK_ERROR(_readUsernameT(c, &m->username))
return parser_ok;
}

__Z_INLINE parser_error_t _readMethod_society_bid_V25(
parser_context_t* c, pd_society_bid_V25_t* m)
{
Expand Down Expand Up @@ -2678,6 +2685,9 @@ parser_error_t _readMethod_V25(
case 6416: /* module 25 call 16 */
CHECK_ERROR(_readMethod_identity_remove_username_authority_V25(c, &method->basic.identity_remove_username_authority_V25))
break;
case 6418: /* module 25 call 18 */
CHECK_ERROR(_readMethod_identity_accept_username_V25(c, &method->basic.identity_accept_username_V25))
break;
case 6656: /* module 26 call 0 */
CHECK_ERROR(_readMethod_society_bid_V25(c, &method->basic.society_bid_V25))
break;
Expand Down Expand Up @@ -3537,6 +3547,8 @@ const char* _getMethod_Name_V25_ParserFull(uint16_t callPrivIdx)
return STR_ME_ADD_USERNAME_AUTHORITY;
case 6416: /* module 25 call 16 */
return STR_ME_REMOVE_USERNAME_AUTHORITY;
case 6418: /* module 25 call 18 */
return STR_ME_ACCEPT_USERNAME;
case 6656: /* module 26 call 0 */
return STR_ME_BID;
case 6657: /* module 26 call 1 */
Expand Down Expand Up @@ -4135,6 +4147,8 @@ uint8_t _getMethod_NumItems_V25(uint8_t moduleIdx, uint8_t callIdx)
return 3;
case 6416: /* module 25 call 16 */
return 1;
case 6418: /* module 25 call 18 */
return 1;
case 6656: /* module 26 call 0 */
return 1;
case 6657: /* module 26 call 1 */
Expand Down Expand Up @@ -5518,6 +5532,13 @@ const char* _getMethod_ItemName_V25(uint8_t moduleIdx, uint8_t callIdx, uint8_t
default:
return NULL;
}
case 6418: /* module 25 call 18 */
switch (itemIdx) {
case 0:
return STR_IT_username;
default:
return NULL;
}
case 6656: /* module 26 call 0 */
switch (itemIdx) {
case 0:
Expand Down Expand Up @@ -8502,6 +8523,16 @@ parser_error_t _getMethod_ItemValue_V25(
default:
return parser_no_data;
}
case 6418: /* module 25 call 18 */
switch (itemIdx) {
case 0: /* identity_accept_username_V25 - username */;
return _toStringUsernameT(
&m->basic.identity_accept_username_V25.username,
outValue, outValueLen,
pageIdx, pageCount);
default:
return parser_no_data;
}
case 6656: /* module 26 call 0 */
switch (itemIdx) {
case 0: /* society_bid_V25 - amount */;
Expand Down Expand Up @@ -10748,6 +10779,7 @@ bool _getMethod_IsNestingSupported_V25(uint8_t moduleIdx, uint8_t callIdx)
case 6414: // Identity:Quit sub
case 6415: // Identity:Add username authority
case 6416: // Identity:Remove username authority
case 6418: // Identity:Accept username
case 6656: // Society:Bid
case 6657: // Society:Unbid
case 6658: // Society:Vouch
Expand Down
8 changes: 8 additions & 0 deletions app/src/substrate/substrate_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ parser_error_t _readRoundIndex(parser_context_t* c, pd_RoundIndex_t* v);
parser_error_t _readSessionIndex(parser_context_t* c, pd_SessionIndex_t* v);
parser_error_t _readSpendIndex(parser_context_t* c, pd_SpendIndex_t* v);
parser_error_t _readTrackIdOf(parser_context_t* c, pd_TrackIdOf_t* v);
parser_error_t _readUsernameT(parser_context_t* c, pd_UsernameT_t* v);
parser_error_t _readVecAccountId(parser_context_t* c, pd_VecAccountId_t* v);
parser_error_t _readVecHash(parser_context_t* c, pd_VecHash_t* v);
parser_error_t _readVecu32(parser_context_t* c, pd_Vecu32_t* v);
Expand Down Expand Up @@ -825,6 +826,13 @@ parser_error_t _toStringTrackIdOf(
uint8_t pageIdx,
uint8_t* pageCount);

parser_error_t _toStringUsernameT(
const pd_UsernameT_t* v,
char* outValue,
uint16_t outValueLen,
uint8_t pageIdx,
uint8_t* pageCount);

parser_error_t _toStringVecAccountId(
const pd_VecAccountId_t* v,
char* outValue,
Expand Down
6 changes: 6 additions & 0 deletions app/src/substrate/substrate_methods_V25.h
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,11 @@ typedef struct {
pd_AccountIdLookupOfT_t authority;
} pd_identity_remove_username_authority_V25_t;

#define PD_CALL_IDENTITY_ACCEPT_USERNAME_V25 18
typedef struct {
pd_UsernameT_t username;
} pd_identity_accept_username_V25_t;

#define PD_CALL_SOCIETY_BID_V25 0
typedef struct {
pd_BalanceOf_t amount;
Expand Down Expand Up @@ -1468,6 +1473,7 @@ typedef union {
pd_identity_quit_sub_V25_t identity_quit_sub_V25;
pd_identity_add_username_authority_V25_t identity_add_username_authority_V25;
pd_identity_remove_username_authority_V25_t identity_remove_username_authority_V25;
pd_identity_accept_username_V25_t identity_accept_username_V25;
pd_society_bid_V25_t society_bid_V25;
pd_society_unbid_V25_t society_unbid_V25;
pd_society_vouch_V25_t society_vouch_V25;
Expand Down
1 change: 1 addition & 0 deletions app/src/substrate/substrate_strings.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ static const char* STR_ME_REMOVE_SUB = "Remove sub";
static const char* STR_ME_QUIT_SUB = "Quit sub";
static const char* STR_ME_ADD_USERNAME_AUTHORITY = "Add username authority";
static const char* STR_ME_REMOVE_USERNAME_AUTHORITY = "Remove username authority";
static const char* STR_ME_ACCEPT_USERNAME = "Accept username";
static const char* STR_ME_BID = "Bid";
static const char* STR_ME_UNBID = "Unbid";
static const char* STR_ME_VOUCH = "Vouch";
Expand Down
13 changes: 13 additions & 0 deletions app/src/substrate/substrate_types.c
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,10 @@ parser_error_t _readTrackIdOf(parser_context_t* c, pd_TrackIdOf_t* v)
return parser_ok;
}

parser_error_t _readUsernameT(parser_context_t* c, pd_UsernameT_t* v) {
GEN_DEF_READVECTOR(u8)
}

parser_error_t _readVecTupleDataData(parser_context_t* c, pd_VecTupleDataData_t* v) {
GEN_DEF_READVECTOR(TupleDataData)
}
Expand Down Expand Up @@ -3048,6 +3052,15 @@ parser_error_t _toStringTrackIdOf(
return _toStringu16(&v->value, outValue, outValueLen, pageIdx, pageCount);
}

parser_error_t _toStringUsernameT(
const pd_UsernameT_t* v,
char* outValue,
uint16_t outValueLen,
uint8_t pageIdx,
uint8_t* pageCount) {
GEN_DEF_TOSTRING_VECTOR(u8)
}

parser_error_t _toStringVecTupleDataData(
const pd_VecTupleDataData_t* v,
char* outValue,
Expand Down
6 changes: 6 additions & 0 deletions app/src/substrate/substrate_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,12 @@ typedef struct {
uint16_t value;
} pd_TrackIdOf_t;

typedef struct {
uint64_t _len;
const uint8_t* _ptr;
uint64_t _lenBuffer;
} pd_UsernameT_t;

typedef struct {
uint64_t _len;
const uint8_t* _ptr;
Expand Down
Loading

0 comments on commit cbbe9b1

Please sign in to comment.