Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapping::insert() fails in E2E tests #1488

Closed
SkymanOne opened this issue Nov 9, 2022 · 2 comments · Fixed by #1492 or #1494
Closed

Mapping::insert() fails in E2E tests #1488

SkymanOne opened this issue Nov 9, 2022 · 2 comments · Fixed by #1492 or #1494
Labels
A-ink_e2e [ink_e2e] Work item C-bug Something isn't working

Comments

@SkymanOne
Copy link
Contributor

SkymanOne commented Nov 9, 2022

Summary

When trying to use a message contains Mapping::insert() in E2E test, the test errors at dry-run stage for this specific function.

Reproducer

  1. Checkout gn/mapping-take-tests
  2. Navigate to examples/mappings folder
  3. Run substrate-contracts-node V0.21.0 - substrate-contracts-node --dev -linfo,runtime::contracts=debug
  4. Run RUST_LOG=debug cargo test
  5. You should get the following error message
***
2022-11-09T16:02:34Z INFO  ink_e2e] [test: insert_and_get_works] call: [E8, 8D, 16, 46, 01, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00]
[2022-11-09T16:02:34Z INFO  ink_e2e] [test: insert_and_get_works] call dry run: Err(Module(ModuleError { index: 7, error: 25, message: None }))
[2022-11-09T16:02:34Z INFO  ink_e2e] [test: insert_and_get_works] call dry run debug message: 
test mappings::e2e_tests::insert_and_get_works ... FAILED

failures:

---- mappings::e2e_tests::insert_and_get_works stdout ----
thread 'mappings::e2e_tests::insert_and_get_works' panicked at 'call failed: CallDryRun', lib.rs:117:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    mappings::e2e_tests::insert_and_get_works

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.23s

error: test failed, to rerun pass '--lib'
***

Module error that the message refers to is StorageDepositLimitExhausted

Edge cases

  • Commenting out the code block containing Mapping::take() does not cause the problem, so it is definitely to do something with the function.
  • Specifying storage_limit has no effect
  • Executing normal & dry-run call via cargo-contract and PolkadotJS app do not result in error
  • The implementations of dry-run call both in cargo-contract and E2E crate seem to be the same.
@SkymanOne SkymanOne added C-bug Something isn't working A-ink_e2e [ink_e2e] Work item labels Nov 9, 2022
@SkymanOne SkymanOne changed the title Mapping::take() fails in E2E tests Mapping::insert() fails in E2E tests Nov 9, 2022
@athei
Copy link
Contributor

athei commented Nov 9, 2022

Which node do you run against (which version)? Just asking for proper reproduction. Not that I think that it actually broke in the node.

@SkymanOne
Copy link
Contributor Author

Which node do you run against (which version)? Just asking for proper reproduction. Not that I think that it actually broke in the node.

Updated the description to indicate the node version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ink_e2e [ink_e2e] Work item C-bug Something isn't working
Projects
None yet
2 participants