Differentiate between 0 and unspecified gas/gasprice
This commit is contained in:
24
rpc/args.go
24
rpc/args.go
@ -261,22 +261,22 @@ func (args *NewTxArgs) UnmarshalJSON(b []byte) (err error) {
|
||||
args.Value = num
|
||||
|
||||
num = nil
|
||||
if ext.Gas == nil {
|
||||
num = big.NewInt(0)
|
||||
} else {
|
||||
if ext.Gas != nil {
|
||||
if num, err = numString(ext.Gas); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
num = nil
|
||||
}
|
||||
args.Gas = num
|
||||
|
||||
num = nil
|
||||
if ext.GasPrice == nil {
|
||||
num = big.NewInt(0)
|
||||
} else {
|
||||
if ext.GasPrice != nil {
|
||||
if num, err = numString(ext.GasPrice); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
num = nil
|
||||
}
|
||||
args.GasPrice = num
|
||||
|
||||
@ -346,21 +346,21 @@ func (args *CallArgs) UnmarshalJSON(b []byte) (err error) {
|
||||
}
|
||||
args.Value = num
|
||||
|
||||
if ext.Gas == nil {
|
||||
num = big.NewInt(0)
|
||||
} else {
|
||||
if ext.Gas != nil {
|
||||
if num, err = numString(ext.Gas); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
num = nil
|
||||
}
|
||||
args.Gas = num
|
||||
|
||||
if ext.GasPrice == nil {
|
||||
num = big.NewInt(0)
|
||||
} else {
|
||||
if ext.GasPrice != nil {
|
||||
if num, err = numString(ext.GasPrice); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
num = nil
|
||||
}
|
||||
args.GasPrice = num
|
||||
|
||||
|
Reference in New Issue
Block a user