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

Remove hard-coded indices from pallet-xcm tests #4248

Conversation

chungquantin
Copy link
Contributor

@chungquantin chungquantin commented Apr 23, 2024

ISSUE

DESCRIPTION

Remove all ModuleError with hard-coded indices to pallet Error. For example:

Err(DispatchError::Module(ModuleError {
	index: 4,
	error: [2, 0, 0, 0],
	message: Some("Filtered")
}))

To

let expected_result = Err(crate::Error::<Test>::Filtered.into());
assert_eq!(result, expected_result);

TEST OUTCOME

test result: ok. 74 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.02s

@chungquantin chungquantin requested a review from a team as a code owner April 23, 2024 04:59
Copy link
Member

@ggwpez ggwpez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Looks better now.

@ggwpez ggwpez added the R0-silent Changes should not be mentioned in any release notes label Apr 24, 2024
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
@paritytech-cicd-pr
Copy link

The CI pipeline was cancelled due to failure one of the required jobs.
Job name: cargo-clippy
Logs: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6046329

@acatangiu
Copy link
Contributor

bot fmt

@command-bot
Copy link

command-bot bot commented Apr 25, 2024

@acatangiu https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6054776 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh". Check out https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.

Comment bot cancel 3-b6f3d8c5-14fc-40fc-a7fc-f0a97950bc6c to cancel this command or bot cancel to cancel all commands in this pull request.

@command-bot
Copy link

command-bot bot commented Apr 25, 2024

@acatangiu Command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh" has finished. Result: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6054776 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6054776/artifacts/download.

@acatangiu
Copy link
Contributor

@chungquantin the bot is not allowed to push to your fork, you'll have to cargo +nightly fmt --all yourself and push the changes.

@acatangiu
Copy link
Contributor

Or you could simply manually make the change suggested by CI here: https://github.com/paritytech/polkadot-sdk/actions/runs/8827160816/job/24233986818?pr=4248

@acatangiu acatangiu added this pull request to the merge queue Apr 29, 2024
Merged via the queue into paritytech:master with commit f34d8e3 Apr 29, 2024
137 of 138 checks passed
Morganamilo pushed a commit that referenced this pull request May 2, 2024
# ISSUE
- Link to issue: #4237

# DESCRIPTION
Remove all ModuleError with hard-coded indices to pallet Error. For
example:
```rs
Err(DispatchError::Module(ModuleError {
	index: 4,
	error: [2, 0, 0, 0],
	message: Some("Filtered")
}))
```
To 
```rs
let expected_result = Err(crate::Error::<Test>::Filtered.into());
assert_eq!(result, expected_result);
```
# TEST OUTCOME
```
test result: ok. 74 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.02s
```

---------

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R0-silent Changes should not be mentioned in any release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants