tendermint/vm/types.go

49 lines
794 B
Go
Raw Normal View History

2015-03-17 21:46:26 -07:00
package vm
import (
2015-04-01 17:30:16 -07:00
. "github.com/tendermint/tendermint/common"
)
2015-03-17 21:46:26 -07:00
const (
defaultDataStackCapacity = 10
)
type Account struct {
Address Word256
2015-03-20 05:47:52 -07:00
Balance uint64
Code []byte
Nonce uint64
StorageRoot Word256
2015-03-21 11:08:05 -07:00
Other interface{} // For holding all other data.
2015-03-17 21:46:26 -07:00
}
type Log struct {
Address Word256
Topics []Word256
2015-03-17 21:46:26 -07:00
Data []byte
Height uint64
}
type AppState interface {
// Accounts
GetAccount(addr Word256) *Account
UpdateAccount(*Account)
RemoveAccount(*Account)
CreateAccount(*Account) *Account
2015-03-17 21:46:26 -07:00
// Storage
GetStorage(Word256, Word256) Word256
SetStorage(Word256, Word256, Word256) // Setting to Zero is deleting.
2015-03-17 21:46:26 -07:00
// Logs
AddLog(*Log)
}
2015-03-20 05:47:52 -07:00
type Params struct {
BlockHeight uint64
BlockHash Word256
2015-03-20 05:47:52 -07:00
BlockTime int64
GasLimit uint64
}