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

Create test file and benchmarking for pallet-accounting #13

Open
6 tasks done
chrisdcosta opened this issue Mar 27, 2023 · 0 comments · May be fixed by #16
Open
6 tasks done

Create test file and benchmarking for pallet-accounting #13

chrisdcosta opened this issue Mar 27, 2023 · 0 comments · May be fixed by #16

Comments

@chrisdcosta
Copy link

chrisdcosta commented Mar 27, 2023

The pallet-accounting has been enhanced with a new set of apis, currently on the opening-balances-adjustments branch.

It should be noted that this is a first version of these apis, and that further enhancements may be made in time.

Tests:

Build comprehensive test cases for:

  • pub fn set_accounting_ref_date()

  • pub fn set_opening_balance()

  • pub fn adjustment()

Set the mock.rs file with the appropriate parameters, and build the tests in test.rs.

Uncomment these line in lib.rs

//pub mod benchmarking;
//pub mod mock;
//pub mod tests;

Note

The tests should cover scenarios that would cause the extrinsic to fail, as well as those that would allow the extrinsic to succeed. The most complex of the the functions is the adjustments, but it also incorporates checks that are used in the

Benchmarking:

Build the initial benchmarking for all three functions and change the lines #[pallet::weight(0/*TODO*/)] to handle the weights properly.

  • pub fn set_accounting_ref_date()

  • pub fn set_opening_balance()

  • pub fn adjustment()

There may be an additional change to the runtime/src/totem.rs file for the weight parameters.

@dharjeezy dharjeezy linked a pull request Apr 8, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant