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
fix/delegation-system-vm #2622
fix/delegation-system-vm #2622
Conversation
@@ -389,10 +389,11 @@ func (host *vmContext) ExecuteOnDestContext(destination []byte, sender []byte, v | |||
return nil, err | |||
} | |||
|
|||
vmOutput := &vmcommon.VMOutput{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why it was moved from line 415 up here? It is still not used above that line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought to use in defer.
@@ -1981,3 +1983,11 @@ func checkIsStaked(t *testing.T, sc *stakingSC, callerAddr, stakerPubKey []byte, | |||
retCode := sc.Execute(arguments) | |||
assert.Equal(t, expectedCode, retCode) | |||
} | |||
|
|||
func TestBech32FromByte(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No assert here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would leave it here - as it is easy to create erd addresses for testing purposes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All tests should have at least one relevant assert, otherwise please move the code in the example
package. If you move the code to the example package then you can print all system SCs addresses with nice description.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -196,7 +196,7 @@ func (o *OutputAccount) MergeOutputAccounts(outAcc *OutputAccount) { | |||
o.BalanceDelta = big.NewInt(0) | |||
} | |||
if outAcc.BalanceDelta != nil { | |||
o.BalanceDelta = outAcc.BalanceDelta | |||
o.BalanceDelta.Add(o.BalanceDelta, outAcc.BalanceDelta) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this backwards compatibile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it is
@@ -1981,3 +1983,11 @@ func checkIsStaked(t *testing.T, sc *stakingSC, callerAddr, stakerPubKey []byte, | |||
retCode := sc.Execute(arguments) | |||
assert.Equal(t, expectedCode, retCode) | |||
} | |||
|
|||
func TestBech32FromByte(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All tests should have at least one relevant assert, otherwise please move the code in the example
package. If you move the code to the example package then you can print all system SCs addresses with nice description.
@@ -1340,6 +1384,27 @@ func (v *validatorSC) basicCheckForUnStakeUnBond(args *vmcommon.ContractCallInpu | |||
return registrationData, vmcommon.Ok | |||
} | |||
|
|||
func (v *validatorSC) getUnStakedTokensList(args *vmcommon.ContractCallInput) vmcommon.ReturnCode { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no unit test. Should have least added or changed a Jira task. I have updated EN-8525
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx for the update
…ded all special/system SC addresses
5acf5b8
ba46931
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
System tests passed.
fixed log debug prints on invalid transactions
fixed merging of accounts in case of execute on destination context on system vm
added checks for non-payable functions in delegation.go
added unit tests for all