-
Notifications
You must be signed in to change notification settings - Fork 197
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
global settings role to burn for all #4180
Conversation
Codecov Report
@@ Coverage Diff @@
## rc/2022-july #4180 +/- ##
=============================================
Coverage 73.61% 73.62%
=============================================
Files 645 645
Lines 85227 85299 +72
=============================================
+ Hits 62744 62804 +60
- Misses 17809 17815 +6
- Partials 4674 4680 +6
Continue to review full report at Codecov.
|
@@ -5,6 +5,7 @@ package roles | |||
|
|||
import ( | |||
"encoding/hex" | |||
"github.com/ElrondNetwork/elrond-go/config" |
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.
go imports
vm/systemSmartContracts/esdt.go
Outdated
|
||
burnForAllExists := checkIfDefinedRoleExistsInToken(token, []byte(vmcommon.ESDTRoleBurnForAll)) | ||
if burnForAllExists { | ||
e.eei.AddReturnMessage("cannot set burn for all as it was already set") |
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.
there are 2 white spaces in the message between burn and for. Please remove one.
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
# Conflicts: # go.mod # go.sum
|
||
vmInput.CallerAddr = owner | ||
vmInput.Arguments = [][]byte{tokenName} | ||
output = e.Execute(vmInput) |
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.
linter: ineffectual assignment to output (ineffassign)
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.go
Outdated
@@ -2050,6 +2160,9 @@ func (e *esdt) EpochConfirmed(epoch uint32, _ uint64) { | |||
|
|||
e.flagRegisterAndSetAllRoles.SetValue(epoch >= e.registerAndSetAllRolesEnableEpoch) | |||
log.Debug("ESDT register and set all roles", "enabled", e.flagRegisterAndSetAllRoles.IsSet()) | |||
|
|||
e.flagBurnForAll.SetValue(epoch >= e.burnForAllEnableEpoch) | |||
log.Debug("ESDT register and set all roles", "enabled", e.flagBurnForAll.IsSet()) |
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.
wrong log
log.Debug("ESDT burn for all", "enabled", e.flagBurnForAll.IsSet())
*
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.go
Outdated
return vmcommon.Ok | ||
} | ||
|
||
func (e *esdt) setBurnForAll(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.
can you rename it to setBurnRoleForAll
?
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.
or setBurnRoleGlobally
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.go
Outdated
|
||
burnForAllExists := checkIfDefinedRoleExistsInToken(token, []byte(vmcommon.ESDTRoleBurnForAll)) | ||
if burnForAllExists { | ||
e.eei.AddReturnMessage("cannot set burn for all as it was already set") |
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.
cannot set burn for all role as it was already set
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.go
Outdated
|
||
burnForAllExists := checkIfDefinedRoleExistsInToken(token, []byte(vmcommon.ESDTRoleBurnForAll)) | ||
if !burnForAllExists { | ||
e.eei.AddReturnMessage("cannot un set burn for all as it was not set") |
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.
cannot unset burn for all role as it was not set
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.
@@ Log scanner @@
burn-for-all
================================================================================
- Known Warnings 14
- New Warnings 4
- Known Errors 0
- New Errors 0
- Panics 0
================================================================================
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.
# Conflicts: # go.mod # go.sum # vm/systemSmartContracts/esdt.go
e98089e
…on_arwen # Conflicts: # go.mod # go.sum
@@ -131,6 +133,7 @@ func NewESDTSmartContract(args ArgsNewESDTSmartContract) (*esdt, error) { | |||
nftCreateONMultiShardEnableEpoch: args.EpochConfig.EnableEpochs.ESDTNFTCreateOnMultiShardEnableEpoch, | |||
metaESDTEnableEpoch: args.EpochConfig.EnableEpochs.MetaESDTSetEnableEpoch, | |||
registerAndSetAllRolesEnableEpoch: args.EpochConfig.EnableEpochs.ESDTRegisterAndSetAllRolesEnableEpoch, | |||
checkMetaESDTOnRolesEnableEpoch: args.EpochConfig.EnableEpochs.ManagedCryptoAPIsEnableEpoch, |
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.
we need a new flag for this
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.
this is not the change - line 135 is the change - github is showing it wrong
return e.unSetBurnForAll(args) | ||
case "setBurnRoleGlobally": | ||
return e.setBurnRoleGlobally(args) | ||
case "unsetBurnRoleGlobally": |
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.
BUG: add return e.unsetBurnRoleGlobally(args)
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.
nevermind, only Github display issue
@@ -2177,8 +2181,11 @@ func (e *esdt) EpochConfirmed(epoch uint32, _ uint64) { | |||
e.flagRegisterAndSetAllRoles.SetValue(epoch >= e.registerAndSetAllRolesEnableEpoch) | |||
log.Debug("ESDT register and set all roles", "enabled", e.flagRegisterAndSetAllRoles.IsSet()) | |||
|
|||
e.flagCheckMetaESDTOnRolesEnableEpoch.SetValue(epoch >= e.checkMetaESDTOnRolesEnableEpoch) |
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.
where is this flag used?
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.
again - github is stupid. this is already in on master.
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.
global settings role to burn for all