Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeTx(tx agtypes.Tx) (*agtypes.ResultBlockTx, error)
- func GetTx(blockData *pbtypes.Data, hash []byte) (agtypes.Tx, error)
- func OpenDatabase(datadir string, name string, cache int, handles int) (ethdb.Database, error)
- type App
- func (app *App) CheckEVMTx(bs []byte) error
- func (app *App) CheckEcoTx(bs []byte) error
- func (app *App) CheckTx(bs []byte) error
- func (app *App) CompatibleWithAngine()
- func (app *App) ExecuteAngineWorldTx(block *agtypes.BlockCache, bs []byte, txIndex int) (hash []byte, usedGas *big.Int, err error)
- func (app *App) ExecuteAppEcoTx(block *agtypes.BlockCache, bs []byte, tx *types.BlockTx) (hash []byte, usedGas *big.Int, err error)
- func (app *App) ExecuteEVMTx(header *ethtypes.Header, blockHash ethcmn.Hash, tx *types.BlockTx, txIndex int) (hash []byte, usedGas *big.Int, err error)
- func (app *App) ExecuteInitTx(block *agtypes.BlockCache, bs []byte, txIndex int) (hash []byte, usedGas *big.Int, err error)
- func (app *App) GetAngineHooks() agtypes.Hooks
- func (app *App) Info() (resInfo agtypes.ResultInfo)
- func (app *App) OnCommit(height, round def.INT, block *agtypes.BlockCache) (interface{}, error)
- func (app *App) OnExecute(height, round def.INT, block *agtypes.BlockCache) (interface{}, error)
- func (app *App) OnNewRound(height, round def.INT, block *agtypes.BlockCache) (interface{}, error)
- func (app *App) OnPrevote(height, round def.INT, block *agtypes.BlockCache) (interface{}, error)
- func (app *App) Query(query []byte) agtypes.Result
- func (app *App) QueryBalance(addrBytes []byte) agtypes.ResultQueryBalance
- func (app *App) QueryContract(rawtx []byte) agtypes.ResultQueryContract
- func (app *App) QueryNonce(addrBytes []byte) agtypes.ResultQueryNonce
- func (app *App) QueryReceipt(txHashBytes []byte) agtypes.ResultQueryReceipt
- func (app *App) QueryShare(pubkeyBytes []byte) agtypes.ResultQueryShare
- func (app *App) QueryTx(txHashBytes []byte) agtypes.ResultQueryTx
- func (app *App) RegisterValidators(validatorset *agtypes.ValidatorSet)
- func (app *App) SaveReceipts() []byte
- func (app *App) SaveStateRootHashs(evmStateHash, ShareStateHash []byte)
- func (app *App) Start() (err error)
- func (app *App) Stop()
- func (app *App) ValSetLoader() agtypes.ValSetLoaderFunc
- type LastBlockInfo
- type Share
- type ShareState
- func (ss *ShareState) AddGuaranty(pubkey crypto.PubKey, amount *big.Int, height uint64) error
- func (ss *ShareState) AddShareBalance(pubkey crypto.PubKey, amount *big.Int) error
- func (ss *ShareState) Commit() ([]byte, error)
- func (ss *ShareState) Copy() *ShareState
- func (ss *ShareState) CreateShareAccount(pubkey []byte, balance *big.Int)
- func (ss *ShareState) GetShareAccount(pubkey []byte) *Share
- func (ss *ShareState) Hash() []byte
- func (ss *ShareState) Iterate(fn func(*Share) bool)
- func (ss *ShareState) Load(root []byte)
- func (ss *ShareState) Lock()
- func (ss *ShareState) MarkShare(pubkey crypto.PubKey, gValue uint64) error
- func (ss *ShareState) QueryShare(pubkey crypto.PubKey) (*big.Int, uint64)
- func (ss *ShareState) Reload(root []byte)
- func (ss *ShareState) Size() int
- func (ss *ShareState) SubGuaranty(pubkey crypto.PubKey, amount *big.Int) error
- func (ss *ShareState) SubShareBalance(pubkey crypto.PubKey, amount *big.Int) error
- func (ss *ShareState) Unlock()
Constants ¶
View Source
const ( StateRemoveEmptyObj = true APP_NAME = "evm" DatabaseCache = 128 DatabaseHandles = 1024 )
View Source
const (
WorldRandPrefix = "world-rand-"
)
Variables ¶
View Source
var ( EmptyTrieRoot = ethcmn.HexToHash("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421") IsHomestead = true )
View Source
var (
ReceiptsPrefix = []byte("receipts-")
)
Functions ¶
Types ¶
type App ¶
type App struct { agtypes.BaseApplication Config *viper.Viper AngineHooks agtypes.Hooks AngineRef *angine.Angine // contains filtered or unexported fields }
func (*App) CheckEVMTx ¶
func (*App) CheckEcoTx ¶
func (*App) CompatibleWithAngine ¶
func (app *App) CompatibleWithAngine()
func (*App) ExecuteAngineWorldTx ¶
func (*App) ExecuteAppEcoTx ¶
func (*App) ExecuteEVMTx ¶
func (app *App) ExecuteEVMTx(header *ethtypes.Header, blockHash ethcmn.Hash, tx *types.BlockTx, txIndex int) (hash []byte, usedGas *big.Int, err error)
ExecuteEVMTx execute tx one by one in the loop, without lock, so should always be called between Lock() and Unlock() on the *stateDup
func (*App) ExecuteInitTx ¶
func (*App) GetAngineHooks ¶
func (*App) Info ¶
func (app *App) Info() (resInfo agtypes.ResultInfo)
func (*App) OnCommit ¶
OnCommit run in a sync way, we don't need to lock stateDupMtx, but stateMtx is still needed
func (*App) OnNewRound ¶
func (*App) QueryBalance ¶
func (app *App) QueryBalance(addrBytes []byte) agtypes.ResultQueryBalance
func (*App) QueryContract ¶
func (app *App) QueryContract(rawtx []byte) agtypes.ResultQueryContract
func (*App) QueryNonce ¶
func (app *App) QueryNonce(addrBytes []byte) agtypes.ResultQueryNonce
func (*App) QueryReceipt ¶
func (app *App) QueryReceipt(txHashBytes []byte) agtypes.ResultQueryReceipt
func (*App) QueryShare ¶
func (app *App) QueryShare(pubkeyBytes []byte) agtypes.ResultQueryShare
func (*App) RegisterValidators ¶
func (app *App) RegisterValidators(validatorset *agtypes.ValidatorSet)
func (*App) SaveReceipts ¶
func (*App) SaveStateRootHashs ¶
func (*App) ValSetLoader ¶
func (app *App) ValSetLoader() agtypes.ValSetLoaderFunc
type LastBlockInfo ¶
func (*LastBlockInfo) AppHash ¶
func (lb *LastBlockInfo) AppHash() []byte
type ShareState ¶
type ShareState struct { // contains filtered or unexported fields }
func NewShareState ¶
func NewShareState(database db.DB) *ShareState
func (*ShareState) AddGuaranty ¶
func (ss *ShareState) AddGuaranty(pubkey crypto.PubKey, amount *big.Int, height uint64) error
func (*ShareState) AddShareBalance ¶
func (ss *ShareState) AddShareBalance(pubkey crypto.PubKey, amount *big.Int) error
func (*ShareState) Commit ¶
func (ss *ShareState) Commit() ([]byte, error)
Commit returns the new root bytes
func (*ShareState) Copy ¶
func (ss *ShareState) Copy() *ShareState
func (*ShareState) CreateShareAccount ¶
func (ss *ShareState) CreateShareAccount(pubkey []byte, balance *big.Int)
func (*ShareState) GetShareAccount ¶
func (ss *ShareState) GetShareAccount(pubkey []byte) *Share
func (*ShareState) Hash ¶
func (ss *ShareState) Hash() []byte
func (*ShareState) Iterate ¶
func (ss *ShareState) Iterate(fn func(*Share) bool)
func (*ShareState) Load ¶
func (ss *ShareState) Load(root []byte)
Load dumss all the buffer, start every thing from a clean state
func (*ShareState) Lock ¶
func (ss *ShareState) Lock()
func (*ShareState) MarkShare ¶
func (ss *ShareState) MarkShare(pubkey crypto.PubKey, gValue uint64) error
func (*ShareState) QueryShare ¶
func (ss *ShareState) QueryShare(pubkey crypto.PubKey) (*big.Int, uint64)
func (*ShareState) Reload ¶
func (ss *ShareState) Reload(root []byte)
Reload works the same as Load, just for semantic purpose
func (*ShareState) Size ¶
func (ss *ShareState) Size() int
func (*ShareState) SubGuaranty ¶
func (ss *ShareState) SubGuaranty(pubkey crypto.PubKey, amount *big.Int) error
func (*ShareState) SubShareBalance ¶
func (ss *ShareState) SubShareBalance(pubkey crypto.PubKey, amount *big.Int) error
func (*ShareState) Unlock ¶
func (ss *ShareState) Unlock()
Click to show internal directories.
Click to hide internal directories.