Documentation ¶
Index ¶
- func AssembleProof(block *UpdateBlock, log *types.Log, receipts []*types.Receipt, method string, ...) ([]byte, error)
- func NewConn(endpoint string, http bool, kp *keystore.Key, log log15.Logger, ...) core.Connection
- type BlockHeader
- type Connection
- func (c *Connection) CallOpts() *bind.CallOpts
- func (c *Connection) Client() *ethclient.Client
- func (c *Connection) Close()
- func (c *Connection) Connect() error
- func (c *Connection) EnsureHasBytecode(addr ethcommon.Address) error
- func (c *Connection) EstimateGasLondon(ctx context.Context, baseFee *big.Int) (*big.Int, *big.Int, error)
- func (c *Connection) Keypair() *keystore.Key
- func (c *Connection) LatestBlock() (*big.Int, error)
- func (c *Connection) LockAndUpdateOpts(needNewNonce bool) error
- func (c *Connection) Opts() *bind.TransactOpts
- func (c *Connection) SafeEstimateGas(ctx context.Context) (*big.Int, error)
- func (c *Connection) UnlockOpts()
- func (c *Connection) WaitForBlock(targetBlock *big.Int, delay *big.Int) error
- type ProofData
- type QuorumCert
- type ReceiptProof
- type UpdateBlock
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssembleProof ¶
Types ¶
type BlockHeader ¶
type BlockHeader struct { ParentHash []byte Miner common.Address StateRoot []byte TransactionsRoot []byte ReceiptsRoot []byte LogsBloom []byte Number *big.Int GasLimit *big.Int GasUsed *big.Int Timestamp *big.Int ExtraData []byte Nonce []byte }
func ConvertHeader ¶
func ConvertHeader(header *platon.Header) *BlockHeader
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func (*Connection) CallOpts ¶
func (c *Connection) CallOpts() *bind.CallOpts
func (*Connection) Client ¶
func (c *Connection) Client() *ethclient.Client
func (*Connection) Close ¶
func (c *Connection) Close()
Close terminates the client connection and stops any running routines
func (*Connection) Connect ¶
func (c *Connection) Connect() error
Connect starts the ethereum WS connection
func (*Connection) EnsureHasBytecode ¶
func (c *Connection) EnsureHasBytecode(addr ethcommon.Address) error
EnsureHasBytecode asserts if contract code exists at the specified address
func (*Connection) EstimateGasLondon ¶
func (*Connection) Keypair ¶
func (c *Connection) Keypair() *keystore.Key
func (*Connection) LatestBlock ¶
func (c *Connection) LatestBlock() (*big.Int, error)
LatestBlock returns the latest block from the current chain
func (*Connection) LockAndUpdateOpts ¶
func (c *Connection) LockAndUpdateOpts(needNewNonce bool) error
LockAndUpdateOpts acquires a lock on the opts before updating the nonce and gas price.
func (*Connection) Opts ¶
func (c *Connection) Opts() *bind.TransactOpts
func (*Connection) SafeEstimateGas ¶
func (*Connection) UnlockOpts ¶
func (c *Connection) UnlockOpts()
func (*Connection) WaitForBlock ¶
WaitForBlock will poll for the block number until the current block is equal or greater. If delay is provided it will wait until currBlock - delay = targetBlock
type ProofData ¶
type ProofData struct { ReceiptProof *ReceiptProof Header *BlockHeader QuorumCert *QuorumCert }
type QuorumCert ¶
type QuorumCert struct { BlockHash [32]byte `json:"blockHash"` BlockIndex *big.Int `json:"blockIndex"` BlockNumber *big.Int `json:"blockNumber"` Epoch *big.Int `json:"epoch"` ViewNumber *big.Int `json:"viewNumber"` Signature []byte `json:"signature"` ValidatorSignBitMap *big.Int SignedCount *big.Int }
type ReceiptProof ¶
type ReceiptProof struct { TxReceipt *mapprotocol.TxReceipt KeyIndex []byte Proof [][]byte }
type UpdateBlock ¶
type UpdateBlock struct { Header *BlockHeader Validators []ethclient.Validator Cert *QuorumCert }
func GetHeaderParam ¶
Click to show internal directories.
Click to hide internal directories.