Skip to content

Commit b273fb7

Browse files
authored
Merge pull request #275 from Zondax/swap-checks
Swap network fix
2 parents af2de9c + 304a9bf commit b273fb7

9 files changed

Lines changed: 4 additions & 3 deletions

File tree

app/Makefile.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ APPVERSION_M=100
33
# This is the `spec_version` field of `Runtime`
44
APPVERSION_N=0
55
# This is the patch version of this release
6-
APPVERSION_P=21
6+
APPVERSION_P=22

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
}
5 Bytes
Loading
18 Bytes
Loading
-3 Bytes
Loading
-3 Bytes
Loading
-16 Bytes
Loading
-3 Bytes
Loading
-3 Bytes
Loading

0 commit comments

Comments
 (0)