-
Notifications
You must be signed in to change notification settings - Fork 198
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
Tests for ESDT new feature #2851
Tests for ESDT new feature #2851
Conversation
Unit tests new functions ESDT system SC
if err != nil { | ||
return nil, err | ||
} | ||
|
||
value := big.NewInt(0).SetBytes(vmInput.Arguments[1]) | ||
err = addToESDTBalance(vmInput.CallerAddr, acntSnd, esdtTokenKey, big.NewInt(0).Set(value), e.marshalizer, e.pauseHandler) | ||
sdtTokenKey := append(e.keyPrefix, tokenID...) |
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.
esdtTokenKey
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.
exError: process.ErrNilMarshalizer, | ||
}, | ||
{ | ||
name: "NilPouseHandler", |
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.
NilPauseHandler instead NilPouseHandler
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.
exError: process.ErrNilMarshalizer, | ||
}, | ||
{ | ||
name: "NilPouseHandler", |
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.
NilPauseHandler instead NilPouseHandler
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.
require.Equal(t, localErr, err) | ||
} | ||
|
||
func TestEsdtRoles_ProcessBuiltinFunction_UnsetRolesDoesNotExitsShouldWork(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.
Exist instead Exits
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.
require.Nil(t, err) | ||
} | ||
|
||
func TestEsdtRolest_CheckAllowedToExecuteRoleNotFind(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.
Roles instead Rolest
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.
vm/systemSmartContracts/esdt_test.go
Outdated
require.Equal(t, vmcommon.UserError, retCode) | ||
} | ||
|
||
func TestEsdt_SetSpecialRoleAlreadyExits(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.
Exists instead Exits
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.
vm/systemSmartContracts/esdt_test.go
Outdated
require.Equal(t, vmcommon.UserError, retCode) | ||
} | ||
|
||
func TestEsdt_GetAllAddressesAndRoleCallWithValueShouldErr(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.
AndRoles
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.
vm/systemSmartContracts/esdt_test.go
Outdated
require.Equal(t, vmcommon.UserError, retCode) | ||
} | ||
|
||
func TestEsdt_GetAllAddressesAndRoleCallGetExistingTokenErr(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.
AndRoles
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/
vm/systemSmartContracts/esdt_test.go
Outdated
require.Equal(t, vmcommon.UserError, retCode) | ||
} | ||
|
||
func TestEsdt_UnsetSpecialRoleCannotRemoveRoleNotExitsShouldErr(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.
Exists instead Exits
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.
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 test passed
esdtLocalBurn.go
,esdtLocalMint.go
,esdtRoles.go
esdt.go
local mint
built in function and thelocal burn
built in function