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

En 8063 fix after rv audit #2463

Merged
merged 5 commits into from Nov 16, 2020

Conversation

BeniaminDrasovean
Copy link
Contributor

Removed duplicated code and implemented other small optimizations.

sasurobert
sasurobert previously approved these changes Nov 12, 2020
@BeniaminDrasovean BeniaminDrasovean marked this pull request as ready for review November 12, 2020 17:47
@@ -1921,7 +1888,7 @@ func (d *delegation) getFund(key []byte) (*Fund, error) {
}

func (d *delegation) createAndSaveNextFund(address []byte, value *big.Int, fundType uint32) ([]byte, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

createAndSaveNexKeyFund

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@@ -1921,7 +1888,7 @@ func (d *delegation) getFund(key []byte) (*Fund, error) {
}

func (d *delegation) createAndSaveNextFund(address []byte, value *big.Int, fundType uint32) ([]byte, error) {
fundKey, fund := d.createNextFund(address, value, fundType)
fundKey, fund := d.createNextKeyFund(address, value, fundType)
err := d.saveFund(fundKey, fund)
Copy link
Contributor

Choose a reason for hiding this comment

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

saveKeyFund

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@@ -1887,9 +1887,9 @@ func (d *delegation) getFund(key []byte) (*Fund, error) {
return dFund, nil
}

func (d *delegation) createAndSaveNextFund(address []byte, value *big.Int, fundType uint32) ([]byte, error) {
func (d *delegation) createAndSaveNexKeyFund(address []byte, value *big.Int, fundType uint32) ([]byte, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

createAndSaveNextKeyFund ? however KeyFund does not sound so right. and saveKeyFund might be renamed again to saveFund - as it only safe the fund data.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@sasurobert sasurobert merged commit 011c63e into feat/staking-delegation-v2 Nov 16, 2020
@sasurobert sasurobert deleted the EN-8063-fix-after-RV-audit branch November 16, 2020 10:03
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.

None yet

3 participants