-
Notifications
You must be signed in to change notification settings - Fork 2
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
Refactor construction API #51
Conversation
server/services/common.go
Outdated
} | ||
|
||
func isZeroAmount(amount string) bool { | ||
return amount == "" || amount == "0" || amount == "-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.
what about "0.0"? or "00". Do we have a more robust way to find out that we cover all these cases?
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.
Right, added a more robust solution - for integers, though (decimal numbers do not need to be handled - at least, not yet).
return errors.New("missing metadata: 'gasPrice'") | ||
} | ||
if metadata.Version != 1 { | ||
return errors.New("bad metadata: unexpected 'version'") |
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.
maybe
return fmt.Errorf("bad metadata: unexpected 'version' %v", metadata.Version)
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.
Indeed, fixed.
|
||
value, ok := big.NewInt(0).SetString(amount, 10) | ||
if ok { | ||
return value.Sign() == 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.
👍
v1.4.14
,maxFee
andfeeMultiplier
do not exist anymore. See: [preprocess]remove max_fee and mulltiplier in preprocess request coinbase/mesh-specifications#110, [types]remove two fields in preprocess request coinbase/mesh-sdk-go#439