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

signer/core: don't mismatch reject and no accounts #21677

Merged
merged 2 commits into from
Oct 8, 2020
Merged
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
4 changes: 1 addition & 3 deletions signer/core/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ func (api *SignerAPI) startUSBListener() {
// List returns the set of wallet this signer manages. Each wallet can contain
// multiple accounts.
func (api *SignerAPI) List(ctx context.Context) ([]common.Address, error) {
var accs []accounts.Account
var accs = make([]accounts.Account, 0)
Copy link
Member

Choose a reason for hiding this comment

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

Pls add a comment after so there won't be a future PR reverting this.

for _, wallet := range api.am.Wallets() {
accs = append(accs, wallet.Accounts()...)
}
Expand All @@ -393,13 +393,11 @@ func (api *SignerAPI) List(ctx context.Context) ([]common.Address, error) {
}
if result.Accounts == nil {
return nil, ErrRequestDenied

}
addresses := make([]common.Address, 0)
for _, acc := range result.Accounts {
addresses = append(addresses, acc.Address)
}

return addresses, nil
}

Expand Down