-
Notifications
You must be signed in to change notification settings - Fork 405
feat: better unknown account error #4166
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -336,7 +336,7 @@ | |||||
} | ||||||
creatorAcc := vm.acck.GetAccount(ctx, creator) | ||||||
if creatorAcc == nil { | ||||||
return std.ErrUnknownAddress(fmt.Sprintf("account %s does not exist", creator)) | ||||||
return std.ErrUnknownAddress(fmt.Sprintf("account %s has not been initialized. does it have coins?", creator)) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's a rhetorical question - accounts that don't exist don't have coins. I'd prefer something like |
||||||
} | ||||||
if err := msg.Package.Validate(); err != nil { | ||||||
return ErrInvalidPkgPath(err.Error()) | ||||||
|
@@ -575,7 +575,7 @@ | |||||
// Validate arguments. | ||||||
callerAcc := vm.acck.GetAccount(ctx, caller) | ||||||
if callerAcc == nil { | ||||||
return "", std.ErrUnknownAddress(fmt.Sprintf("account %s does not exist", caller)) | ||||||
return "", std.ErrUnknownAddress(fmt.Sprintf("account %s has not been initialized. does it have coins?", caller)) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
} | ||||||
if err := msg.Package.Validate(); err != nil { | ||||||
return "", ErrInvalidPkgPath(err.Error()) | ||||||
|
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 still want the error to make sense if an address doesn't exist at all.