-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Move x/auth's AccountI and ModuleAccountI interfaces to typ…
…es package (#13937)
- Loading branch information
1 parent
03196d7
commit 3606995
Showing
67 changed files
with
394 additions
and
381 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package types | ||
|
||
import ( | ||
"github.com/cosmos/gogoproto/proto" | ||
|
||
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" | ||
) | ||
|
||
// AccountI is an interface used to store coins at a given address within state. | ||
// It presumes a notion of sequence numbers for replay protection, | ||
// a notion of account numbers for replay protection for previously pruned accounts, | ||
// and a pubkey for authentication purposes. | ||
// | ||
// Many complex conditions can be used in the concrete struct which implements AccountI. | ||
type AccountI interface { | ||
proto.Message | ||
|
||
GetAddress() AccAddress | ||
SetAddress(AccAddress) error // errors if already set. | ||
|
||
GetPubKey() cryptotypes.PubKey // can return nil. | ||
SetPubKey(cryptotypes.PubKey) error | ||
|
||
GetAccountNumber() uint64 | ||
SetAccountNumber(uint64) error | ||
|
||
GetSequence() uint64 | ||
SetSequence(uint64) error | ||
|
||
// Ensure that account implements stringer | ||
String() string | ||
} | ||
|
||
// ModuleAccountI defines an account interface for modules that hold tokens in | ||
// an escrow. | ||
type ModuleAccountI interface { | ||
AccountI | ||
|
||
GetName() string | ||
GetPermissions() []string | ||
HasPermission(string) bool | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Oops, something went wrong.