Skip to content

Commit 304a9bf

Browse files
committed
Enables swap on Relay Chain and Asset Hub
Extends swap functionality to also support the Asset Hub Polkadot (statemint) network, in addition to the existing polkadot (Relay Chain) network.
1 parent 271d278 commit 304a9bf

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

app/src/swap/handle_sign_transaction.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ parser_error_t check_swap_conditions(parser_tx_t *txObj) {
9797
}
9898

9999
// Check network.
100-
const char *valid_network = "polkadot";
101100
char tmpKey[20] = {0};
102101
char tmpValue[65] = {0};
103102

@@ -111,7 +110,9 @@ parser_error_t check_swap_conditions(parser_tx_t *txObj) {
111110
.pageCount = &pageCount};
112111

113112
CHECK_ERROR(parser_getItem(txObj, &uiFields));
114-
if (strncmp(valid_network, tmpValue, strlen(valid_network) + 1) != 0) {
113+
114+
// Check if network is polkadot (Relay Chain) or statemint (Asset Hub Polkadot)
115+
if (strncmp("polkadot", tmpValue, 9) != 0 && strncmp("statemint", tmpValue, 10) != 0) {
115116
ZEMU_LOGF(200, "Swap not enabled on %s network.\n", tmpValue);
116117
return parser_swap_tx_wrong_method;
117118
}

0 commit comments

Comments
 (0)