You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The pallet-revive requires a mapped account for many functions. In our E2E tests we are currently doing a very naive thing of just always trying to map the account, whilst continuing anyway if that operation fails.
That's why you currently see those in the log:
$ cd ink/integration-tests/public/contract-transfer
$ cargo +nightly test --all-features e2e_
test give_me::e2e_tests::e2e_contract_must_transfer_value_to_sender ... ok
2025-03-24T20:59:16.926664Z ERROR ink_e2e: [test: e2e_sending_value_to_give_me_must_fail] extrinsic for call failed: Pallet error: Revive::AccountAlreadyMapped
2025-03-24T20:59:16.959847Z ERROR ink_e2e: [test: e2e_sending_value_to_give_me_must_fail] extrinsic for call failed: Pallet error: Revive::AccountAlreadyMapped
2025-03-24T20:59:16.976303Z ERROR ink_e2e: [test: e2e_sending_value_to_give_me_must_fail] extrinsic for call failed: Pallet error: Revive::ContractReverted
test give_me::e2e_tests::e2e_sending_value_to_give_me_must_fail ... ok
test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 4 filtered out; finished in 145.85s
What we should do instead is to check if the account has already been mapped and only if not map it. I believe the best way to check is to calculate the storage key that the mapping should be at and then doing a storage lookup for that key.
I believe this code from cargo-contract could be reused. You have to derive the H160 first and then you could check for the storage key. The derivation can be taken from here. It's also already in ink! here.
The text was updated successfully, but these errors were encountered:
The
pallet-revive
requires a mapped account for many functions. In our E2E tests we are currently doing a very naive thing of just always trying to map the account, whilst continuing anyway if that operation fails.That's why you currently see those in the log:
What we should do instead is to check if the account has already been mapped and only if not map it. I believe the best way to check is to calculate the storage key that the mapping should be at and then doing a storage lookup for that key.
I believe this code from
cargo-contract
could be reused. You have to derive theH160
first and then you could check for the storage key. The derivation can be taken from here. It's also already in ink! here.The text was updated successfully, but these errors were encountered: