-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
client: add GetAccount and GetAccountWithHeight to AccountRetriever (#…
…7558) * client: add GetAccount and GetAccountWithHeight to AccountRetriever * update ADR * address comments from review
- Loading branch information
Showing
4 changed files
with
80 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,25 @@ | ||
package client | ||
|
||
import "github.com/cosmos/cosmos-sdk/types" | ||
import ( | ||
"github.com/tendermint/tendermint/crypto" | ||
|
||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
) | ||
|
||
// Account defines a read-only version of the auth module's AccountI. | ||
type Account interface { | ||
GetAddress() sdk.AccAddress | ||
GetPubKey() crypto.PubKey // can return nil. | ||
GetAccountNumber() uint64 | ||
GetSequence() uint64 | ||
} | ||
|
||
// AccountRetriever defines the interfaces required by transactions to | ||
// ensure an account exists and to be able to query for account fields necessary | ||
// for signing. | ||
type AccountRetriever interface { | ||
EnsureExists(clientCtx Context, addr types.AccAddress) error | ||
GetAccountNumberSequence(clientCtx Context, addr types.AccAddress) (accNum uint64, accSeq uint64, err error) | ||
GetAccount(clientCtx Context, addr sdk.AccAddress) (Account, error) | ||
GetAccountWithHeight(clientCtx Context, addr sdk.AccAddress) (Account, int64, error) | ||
EnsureExists(clientCtx Context, addr sdk.AccAddress) error | ||
GetAccountNumberSequence(clientCtx Context, addr sdk.AccAddress) (accNum uint64, accSeq uint64, err error) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters