Skip to content
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

R4R: Allow --from to be a name or an address #2073

Merged
merged 16 commits into from
Sep 25, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updates from code review
  • Loading branch information
mslipper committed Aug 30, 2018
commit b904fd5c3d693b4dabcd1c2a1c8e0530ab80a491
6 changes: 3 additions & 3 deletions client/context/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ func (ctx CLIContext) WithAccountStore(accountStore string) CLIContext {
return ctx
}

// WithFrom returns a copy of the context with an updated from address.
func (ctx CLIContext) WithFrom(addrName string) CLIContext {
ctx.From = addrName
// WithFrom returns a copy of the context with an updated from address orname.
func (ctx CLIContext) WithFrom(from string) CLIContext {
ctx.From = from
return ctx
}

Expand Down
1 change: 1 addition & 0 deletions crypto/keys/keybase.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ func (kb dbKeybase) List() ([]Info, error) {
for ; iter.Valid(); iter.Next() {
key := string(iter.Key())

// need to exclude any keys in storage that have an address suffix
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a more defensive mechanism would be to: if strings.HasSuffix(key, infoSuffix) { // read and parse...}

if strings.HasSuffix(key, ".address") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs a comment IMHO

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say if one needs to write code like ^^^, then something is wrong. Just a earlier warning to core devs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++

continue
}
Expand Down