Regression tests for PC -> BC authorize_account scenarios#497
Open
x3c41a wants to merge 8 commits into
Open
Conversation
Drives XcmExecutor::prepare_and_execute with messages shaped the way People Chain sends them (sibling parachain origin, OriginKind::Xcm, unpaid execution + Transact). Covers: - additive allowances within an unexpired window vs replace-after-expiry - origin/barrier rejections (relay chain, OriginKind::SovereignAccount, random local origin) - SafeCallFilter (store blocked, batch with store entirely blocked, batch of authorize calls allowed) - bad inputs (bytes: 0) - refresh_account_authorization extends only expiration; fails without prior - end-to-end: PC authorize -> signed store -> signed renew - sibling sovereign account does not gain authorization as a side effect Closes #490
Collaborator
|
just an idea, it would be cool to extract most relevant to the bulletin-pallets-common as a conformance tests and just reuse for Fellows or between runtimes, but can be done later for sure |
Contributor
Author
Contributor
franciscoaguirre
left a comment
There was a problem hiding this comment.
Please go through the comments and make sure someone reading this code months from now will be able to understand them. Don't leave unnecessary comments that say the same thing the code is saying. Prefer comments saying WHY than HOW. Also handle the result from xcm execution
- Move pc_xcm_integration to its own file - Extract shared helpers into tests/common/mod.rs - Make execute_from return Result<(), InstructionError> via ensure_complete - Use submodules instead of comment dividers (origin_rejections, safe_call_filter, authorize_semantics, refresh, end_to_end) - Strip 'Scenario N' prefixes and unnecessary comments - Drop the sibling-sovereign side-effect test (no mechanism for it) - Document the XCM Outcome::Complete + inner-dispatch-failure semantics on the origin/bad-input tests
The previous name described the implementation (two ok unwraps) instead of the intent (assert that an extrinsic was both validly applied and successfully dispatched). Renamed across both paseo and westend tests.
Each submodule now lives in its own file under tests/pc_xcm_integration/. The parent file keeps the shared helpers and declares the submodules via #[path] attributes (each tests/<name>.rs binary's submodule resolution defaults to the same directory, so #[path] is needed to point at the subdirectory). - authorize_semantics.rs: happy path, additivity, replacement, scoping - safe_call_filter.rs: store and batch-with-store filter - origin_rejections.rs: relay/sovereign/local rejections, zero bytes - refresh.rs: extends-only and missing-prior cases - end_to_end.rs: PC authorize -> signed store -> signed renew
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
People Chain sends an XCM
Transact(authorize_account)to Bulletin Chain to grant a user a storage allowance. Bulletin Chain had no tests for this path. So a change to the pallet, the XCM config, or the call filters could break it without anyone noticing.Adds 14 tests that send those messages from a simulated People Chain and check what happens on Bulletin Chain. Each scenario lives in its own file under
runtimes/bulletin-paseo/tests/pc_xcm_integration/:authorize_semantics.rsorigin_rejections.rsOriginKind::SovereignAccountfrom People Chain, and a random local origin all fail to authorize on Bulletin Chainbytes: 0is rejected on Bulletin Chainsafe_call_filter.rsSafeCallFilterblocksstoreover XCM, including insideUtility::batch; a batch of onlyauthorize_accountcalls still goes throughrefresh.rsrefresh_account_authorizationfrom People Chain only extends expiry on Bulletin Chain; allowances and consumed counters do not changerefresh_account_authorizationfails on Bulletin Chain without a prior authorizeend_to_end.rsauthorize_account, then the user submits a signedstoreon Bulletin Chain, then a signedrenewCloses #490