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

test(sequencer): add unit tests for src/asset/state_ext #874

Merged
merged 2 commits into from
Apr 1, 2024

Conversation

Lilyjjo
Copy link
Contributor

@Lilyjjo Lilyjjo commented Mar 27, 2024

Summary

Third set of state-ext unit tests. In total there are seven files which
need tests:

  • astria-sequencer/src/api_state_ext.rs
  • astria-sequencer/src/state_ext.rs
  • astria-sequencer/src/accounts/state_ext.rs
  • astria-sequencer/src/asset/state_ext.rs (This PR)
  • astria-sequencer/src/authority/state_ext.rs
  • astria-sequencer/src/bridge/state_ext.rs
  • astria-sequencer/src/ibc/state_ext.rs

This PR just tests the src/asset/state_ext.rs file.

Background

It is good to have unit tests to ensure that the database works as
intended.

Changes

Unit tests for the functionality in the file src/asset/state_ext.rs were
added.

Testing

:)

@github-actions github-actions bot added the sequencer pertaining to the astria-sequencer crate label Mar 27, 2024
// can write new
let asset_string = "asset_0";
let asset = Id::from_denom(asset_string);
let denom = Denom::from_base_denom(asset_string);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
let denom = Denom::from_base_denom(asset_string);
let denom = Denom::from_base_denom(asset_string);
let id = denom.id()

you can remove the let asset = Id::from_denom(asset_string); and just use denom.id() for the Id parameters, same for other tests

Copy link
Collaborator

@noot noot left a comment

Choose a reason for hiding this comment

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

looks good! just a minor comment to resolve before merging

@Lilyjjo Lilyjjo force-pushed the lilyjjo/state-ext-unit-tests-3 branch from 33b1b12 to 9c6348f Compare April 1, 2024 18:31
@Lilyjjo Lilyjjo force-pushed the lilyjjo/state-ext-unit-tests-3 branch from 9c6348f to d748b8c Compare April 1, 2024 18:32
@Lilyjjo Lilyjjo merged commit 4a164f6 into main Apr 1, 2024
35 checks passed
@Lilyjjo Lilyjjo deleted the lilyjjo/state-ext-unit-tests-3 branch April 1, 2024 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sequencer pertaining to the astria-sequencer crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants