github.com/annchain/OG@v0.0.9/vm/types/context.go (about) 1 package types 2 3 import ( 4 ogTypes "github.com/annchain/OG/arefactor/og_interface" 5 "math/big" 6 ) 7 8 type ( 9 // CanTransferFunc is the signature of a transfer guard function 10 CanTransferFunc func(StateDB, ogTypes.Address20, *big.Int) bool 11 // TransferFunc is the signature of a transfer function 12 TransferFunc func(StateDB, ogTypes.Address20, ogTypes.Address20, *big.Int) 13 // GetHashFunc returns the nth block hash in the blockchain 14 // and is used by the BLOCKHASH OVM op code. 15 GetHashFunc func(uint64) ogTypes.Hash 16 ) 17 18 // Context provides the OVM with auxiliary information. Once provided 19 // it shouldn't be modified. 20 type Context struct { 21 // CanTransfer returns whether the account contains 22 // sufficient ether to transfer the value 23 CanTransfer CanTransferFunc 24 // Transfer transfers ether from one account to the other 25 Transfer TransferFunc 26 // GetHash returns the hash corresponding to n 27 //GetHash GetHashFunc 28 StateDB StateDB 29 CallGasTemp uint64 30 // Depth is the current call stack 31 Depth int 32 33 // abort is used to abort the OVM calling operations 34 // NOTE: must be set atomically 35 Abort int32 36 }