AstarNetwork / astar-frame

Core frame modules for Astar & Shiden network.
Other
58 stars 38 forks source link

test: add test to `StakerInfo` #53

Closed TarekkMA closed 2 years ago

TarekkMA commented 2 years ago

Add tests for StakerInfo.

polkadot: 12xH9F4aSGEq27AZxLqG15fheDTtSxh1rJkVSXQ2g59djs7u

Dinonard commented 2 years ago

@TarekkMA hello, can you please explain what is the added value of these tests?

It's already covered in test module.

TarekkMA commented 2 years ago

@Dinonard

These are unit tests focused on StakerInfo itself without other dependencies. It's like the documentation you have above each method (stake, unstake, claim) but it's actually validatable.

In Subsocial we were interested in creating something similar to dapps-staking, and I added these tests on our pallet. and I thought submitting them also here is a good idea since I used this same struct on our pallet.

Dinonard commented 2 years ago

Sure, I agree unit tests are very important.

What I meant is that the StakerInfo is already fully tested here.

TarekkMA commented 2 years ago

Oh my bad, I didn't see these tests at all.

TarekkMA commented 2 years ago

Anyways thank you for your work on dapps-staking was very helpful.

Since this part of the code is already tested, you can close this PR.

Dinonard commented 2 years ago

Thank you for the effort though!