tendermint/vm/types.go

40 lines
616 B
Go
Raw Normal View History

2015-03-17 21:46:26 -07:00
package vm
import ()
const (
defaultDataStackCapacity = 10
)
type Account struct {
Address Word
Balance uint64
Code []byte
Nonce uint64
StateRoot Word
}
type Log struct {
Address Word
Topics []Word
Data []byte
Height uint64
}
type AppState interface {
// Accounts
2015-03-18 01:06:33 -07:00
GetAccount(addr Word) (*Account, error)
2015-03-17 21:46:26 -07:00
UpdateAccount(*Account) error
DeleteAccount(*Account) error
2015-03-18 01:06:33 -07:00
CreateAccount(addr Word, balance uint64) (*Account, error)
2015-03-17 21:46:26 -07:00
// Storage
GetStorage(Word, Word) (Word, error)
SetStorage(Word, Word, Word) (bool, error)
RemoveStorage(Word, Word) error
// Logs
AddLog(*Log)
}