Merge pull request #3406 from nspcc-dev/error-message

native: adjust error message for ExecFeeFactor and StoragePrice
This commit is contained in:
Anna Shaleva 2024-04-09 10:59:03 +03:00 committed by GitHub
commit a28e5b24b2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -289,7 +289,7 @@ func (p *Policy) GetExecFeeFactorInternal(d *dao.Simple) int64 {
func (p *Policy) setExecFeeFactor(ic *interop.Context, args []stackitem.Item) stackitem.Item { func (p *Policy) setExecFeeFactor(ic *interop.Context, args []stackitem.Item) stackitem.Item {
value := toUint32(args[0]) value := toUint32(args[0])
if value <= 0 || maxExecFeeFactor < value { if value <= 0 || maxExecFeeFactor < value {
panic(fmt.Errorf("ExecFeeFactor must be between 0 and %d", maxExecFeeFactor)) panic(fmt.Errorf("ExecFeeFactor must be between 1 and %d", maxExecFeeFactor))
} }
if !p.NEO.checkCommittee(ic) { if !p.NEO.checkCommittee(ic) {
panic("invalid committee signature") panic("invalid committee signature")
@ -348,7 +348,7 @@ func (p *Policy) GetStoragePriceInternal(d *dao.Simple) int64 {
func (p *Policy) setStoragePrice(ic *interop.Context, args []stackitem.Item) stackitem.Item { func (p *Policy) setStoragePrice(ic *interop.Context, args []stackitem.Item) stackitem.Item {
value := toUint32(args[0]) value := toUint32(args[0])
if value <= 0 || maxStoragePrice < value { if value <= 0 || maxStoragePrice < value {
panic(fmt.Errorf("StoragePrice must be between 0 and %d", maxStoragePrice)) panic(fmt.Errorf("StoragePrice must be between 1 and %d", maxStoragePrice))
} }
if !p.NEO.checkCommittee(ic) { if !p.NEO.checkCommittee(ic) {
panic("invalid committee signature") panic("invalid committee signature")