cosmos-sdk/types/account.go

28 lines
642 B
Go
Raw Normal View History

2018-01-07 12:27:56 -08:00
package types
2018-01-06 14:22:21 -08:00
import (
crypto "github.com/tendermint/go-crypto"
)
// AccountStore indexes accounts by address.
type AccountStore interface {
NewAccountWithAddress(addr crypto.Address) Account
GetAccount(addr crypto.Address) Account
SetAccount(acc Account)
}
2018-01-07 12:27:56 -08:00
// Account is a standard account using a sequence number for replay protection
// and a pubkey for authentication.
2018-01-06 14:22:21 -08:00
type Account interface {
Address() crypto.Address
GetPubKey() crypto.PubKey
SetPubKey(crypto.PubKey) error
GetSequence() int64
SetSequence(int64) error
Get(key interface{}) (value interface{}, err error)
Set(key interface{}, value interface{}) error
}