Can now handle amount-join EIP-712 filtering on Permit (ERC-2612) messages

This commit is contained in:
Alexandre Paillier
2024-06-17 16:33:45 +02:00
parent cabdcd5d5d
commit 05ddb70e7f
3 changed files with 25 additions and 1 deletions

View File

@@ -397,6 +397,13 @@ static bool ui_712_format_amount_join(void) {
return true;
}
/**
* Simply mark the current amount-join's token address as received
*/
void amount_join_set_token_received(void) {
ui_ctx->amount.joins[ui_ctx->amount.idx].flags |= AMOUNT_JOIN_FLAG_TOKEN;
}
/**
* Update the state of the amount-join
*
@@ -413,7 +420,7 @@ static bool update_amount_join(const uint8_t *data, uint8_t length) {
if (memcmp(data, token->address, ADDRESS_LENGTH) != 0) {
return false;
}
ui_ctx->amount.joins[ui_ctx->amount.idx].flags |= AMOUNT_JOIN_FLAG_TOKEN;
amount_join_set_token_received();
break;
case AMOUNT_JOIN_STATE_VALUE: