move account back to types

This commit is contained in:
Ethan Buchman
2018-01-09 19:11:00 -08:00
committed by Jae Kwon
parent f6a875d476
commit e908cfbb6f
12 changed files with 110 additions and 129 deletions
+27
View File
@@ -0,0 +1,27 @@
package types
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)
}
// Account is a standard account using a sequence number for replay protection
// and a pubkey for authentication.
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
}
+15
View File
@@ -0,0 +1,15 @@
package types
import crypto "github.com/tendermint/go-crypto"
type Model interface {
Address() crypto.Address
Get(key interface{}) interface{}
Set(key interface{}, value interface{})
}
type ModelStore interface {
Load(addr crypto.Address) Model
Store(m Model)
}