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

refactor: api integration tests #133

Merged
merged 38 commits into from
Aug 6, 2024

Conversation

Daanvdplas
Copy link
Collaborator

@Daanvdplas Daanvdplas commented Jul 26, 2024

Closes #123 & #120

  • Remove helper functions to the bottom of the file
  • improved return value when calling the contracts so we can assert on a success and error at the same time.
  • Have a consistent assert schema: value, expected
  • if a contract is reverted it is clear from which function it is coming from.

Open question that might improve things even more:
https://substrate.stackexchange.com/questions/11765/what-should-data-be-decoded-to-in-execreturnvalue

@evilrobot-01
Copy link
Collaborator

The link you included on SE is broken.

Base automatically changed from daan/refactor-remove_read_state_encoding to daan/api July 28, 2024 10:07
@Daanvdplas Daanvdplas closed this Jul 31, 2024
@Daanvdplas Daanvdplas reopened this Jul 31, 2024
Copy link
Collaborator

@peterwht peterwht 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, small comments to resolve.

GitHub is not letting me put a comment on it. But the if-chain on line 156 has a clippy warning.

Please resolve it.

match value.cmp(current_allowance) =>
    Equal => {...},
    Less => {...},
    Greater => {...},

pallets/api/src/fungibles/mod.rs Outdated Show resolved Hide resolved
@Daanvdplas Daanvdplas merged commit d8ac5bd into daan/api Aug 6, 2024
6 checks passed
@Daanvdplas Daanvdplas deleted the daan/fix-read_state_error_handling branch August 6, 2024 12:45
chungquantin pushed a commit that referenced this pull request Sep 6, 2024
Co-authored-by: Frank Bell <frank@r0gue.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Pop API
Projects
None yet
4 participants