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

bugFix/stake-stake-claim-auction-sc #1833

Merged
merged 4 commits into from
Jun 1, 2020

Conversation

sasurobert
Copy link
Contributor

fixing case of stake-stake-claim with nodePrice or greater then nodePrice

@sasurobert sasurobert changed the base branch from development to release-candidate June 1, 2020 09:18
@@ -630,6 +630,7 @@ func (s *stakingAuctionSC) stake(args *vmcommon.ContractCallInput) vmcommon.Retu
for i := maxNodesToRun*2 + 1; i < uint64(lenArgs); i++ {
if len(args.Arguments[i]) == len(args.CallerAddr) {
if !isAlreadyRegistered {
s.eei.AddReturnMessage("reward address after being registered can be changed only through changeRewardAddress")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that this message should be placed on else branch. If isAlreadyRegistered

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks. pushed.

@raduchis raduchis self-requested a review June 1, 2020 13:15
@@ -631,6 +631,8 @@ func (s *stakingAuctionSC) stake(args *vmcommon.ContractCallInput) vmcommon.Retu
if len(args.Arguments[i]) == len(args.CallerAddr) {
if !isAlreadyRegistered {
registrationData.RewardAddress = args.Arguments[i]
Copy link
Contributor

@raduchis raduchis Jun 1, 2020

Choose a reason for hiding this comment

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

there is only one registrationData.RewardAddress, but you are iterating through "i" rewardAddresses. Only the last one will be saved, is this the intended behaviour?

It's not from the current changes, can be fixed in a future PR

@raduchis raduchis added the type:bug Something isn't working label Jun 1, 2020
Copy link
Contributor

@LucianMincu LucianMincu left a comment

Choose a reason for hiding this comment

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

System tests passed.

@LucianMincu LucianMincu merged commit 0d34afc into release-candidate Jun 1, 2020
@LucianMincu LucianMincu deleted the bugFix/stake-stake-claim-auction-sc branch June 1, 2020 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants