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

[Staking] Fix contract events and add test cases #6

Merged
merged 5 commits into from
Sep 13, 2022
Merged

[Staking] Fix contract events and add test cases #6

merged 5 commits into from
Sep 13, 2022

Conversation

ducthotran2010
Copy link
Contributor

Description

  • Mainly adds test cases for emitted events in staking contract
  • Renames candidateOwner to candidateAdmin for Staking contract struct
  • Fixes events while claiming the reward
  • Exposes method getValidatorCandidateLength

Checklist

  • The box that allows repo maintainers to update this PR is checked
  • I tested locally to make sure this feature/fix works


SettledPool memory _sPool = _settledPool[_poolAddr];
Copy link
Contributor

Choose a reason for hiding this comment

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

Should change to storage, since copy struct to memory is expensive

Copy link
Contributor

Choose a reason for hiding this comment

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

Should review other functions that fetch data from storage, e.g. getTotalReward, getTotalReward, etc!!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should review other functions that fetch data from storage, e.g. getTotalReward, getTotalReward, etc!!

It's better to fix the issue in another PR. Many LoC applied this pattern.

src/script/staking.ts Outdated Show resolved Hide resolved
src/script/staking.ts Outdated Show resolved Hide resolved
src/script/staking.ts Outdated Show resolved Hide resolved
@ducthotran2010 ducthotran2010 merged commit 2ad8aac into axieinfinity:main Sep 13, 2022
@ducthotran2010 ducthotran2010 deleted the feat/add-test-cases-for-emitted-events-in-staking-contract branch September 13, 2022 09:10
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 this pull request may close these issues.

2 participants