2

Without deprecated transactional macro for extrinsic, the assert_noop!(extrinsic_call, Error::<Test>::BalanceLow) test doesn't work. Not sure if the reason is in orml currencies or if something is wrong with the new implementation of transactional behavior, which should work by default (polkadot-v0.9.25)

Source:

T::Currency::transfer(currency_id, &who, &treasury, amount).map_err(|_| Error::<T>::BalanceLow)?;

Error:

thread 'tests::control_create_org_errors' panicked at 'assertion failed: `(left == right)`
  left: `[245, 32, 98, 192, 108, 62, 24, 236, 229, 230, 140, 25, 143, 54, 170, 37, 99, 44, 26, 101, 67, 233, 195, 119, 185, 51, 44, 203, 171, 193, 137, 38]`,
 right: `[199, 230, 38, 211, 152, 255, 39, 158, 254, 167, 26, 129, 76, 121, 100, 236, 166, 213, 246, 117, 212, 210, 220, 40, 183, 220, 93, 168, 87, 241, 65, 91]`', gamedao-protocol/control/src/tests.rs:70:9

1 Answer 1

2

I believe that this is is just an artifact of the original implementation detail of the storage layer, which shows up in tests.

This PR: https://github.com/paritytech/substrate/pull/11927

Should solve that. Specifically, before, if you do not explicitly call dispatch on the call, you would not get the transactional behavior.

With the PR above, now it should not matter.

So try running the test again against Substrate master and you should ideally see the error go away.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.