Skip to content

Commit

Permalink
reactor: simplify error (#1480)
Browse files Browse the repository at this point in the history
Co-authored-by: Justin Tieri <[email protected]>
  • Loading branch information
cuiweixie and jtieri committed Jul 7, 2024
1 parent 4e3755e commit 6ab7f61
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
6 changes: 2 additions & 4 deletions relayer/chains/cosmos/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,8 @@ func (cc *CosmosProvider) GetAccountWithHeight(_ client.Context, addr sdk.AccAdd

// EnsureExists returns an error if no account exists for the given address else nil.
func (cc *CosmosProvider) EnsureExists(clientCtx client.Context, addr sdk.AccAddress) error {
if _, err := cc.GetAccount(clientCtx, addr); err != nil {
return err
}
return nil
_, err := cc.GetAccount(clientCtx, addr)
return err
}

// GetAccountNumberSequence returns sequence and account number for the given address.
Expand Down
5 changes: 1 addition & 4 deletions relayer/chains/cosmos/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,7 @@ func (cc *CosmosProvider) ListAddresses() (map[string]string, error) {

// DeleteKey removes a key from the keystore for the specified name.
func (cc *CosmosProvider) DeleteKey(name string) error {
if err := cc.Keybase.Delete(name); err != nil {
return err
}
return nil
return cc.Keybase.Delete(name)
}

// KeyExists returns true if a key with the specified name exists in the keystore, it returns false otherwise.
Expand Down

0 comments on commit 6ab7f61

Please sign in to comment.