Documentation
¶
Index ¶
- Constants
- Variables
- type ChildChain
- func (cc *ChildChain) AddBlock(txn *badger.Txn, signer *types.Account) (uint64, error)
- func (cc *ChildChain) AddDepositBlock(txn *badger.Txn, ownerAddr common.Address, amount *big.Int, ...) (uint64, error)
- func (cc *ChildChain) AddTxToMempool(txn *badger.Txn, tx *types.Tx) error
- func (cc *ChildChain) ConfirmTx(txn *badger.Txn, txInPos types.Position, confSig types.Signature) error
- func (cc *ChildChain) ExitTxOut(txn *badger.Txn, txOutPos types.Position) error
- func (cc *ChildChain) GetBlock(txn *badger.Txn, blkNum uint64) (*types.Block, error)
- func (cc *ChildChain) GetCurrentBlockNumber(txn *badger.Txn) (uint64, error)
- func (cc *ChildChain) GetTx(txn *badger.Txn, txPos types.Position) (*types.Tx, error)
- func (cc *ChildChain) GetTxProof(txn *badger.Txn, txPos types.Position) ([]byte, error)
- func (cc *ChildChain) GetUTXOPositions(txn *badger.Txn, addr common.Address) ([]types.Position, error)
- func (cc *ChildChain) RestoreTxOut(txn *badger.Txn, txOutPos types.Position) error
- func (cc *ChildChain) ValidateTx(txn *badger.Txn, tx *types.Tx) error
- type RootChain
- func (rc *RootChain) ChallengeExit(a *types.Account, txOutPos types.Position, spendingTx *types.Tx, ...) (*gethtypes.Transaction, error)
- func (rc *RootChain) CommitPlasmaBlockRoot(a *types.Account, rootHash common.Hash) (*gethtypes.Transaction, error)
- func (rc *RootChain) CurrentPlasmaBlockNumber() (uint64, error)
- func (rc *RootChain) Deposit(a *types.Account, amount *big.Int) (*gethtypes.Transaction, error)
- func (rc *RootChain) Ping() error
- func (rc *RootChain) PlasmaExits(txOutPos types.Position) (types.Exit, error)
- func (rc *RootChain) ProcessExits(a *types.Account) (*gethtypes.Transaction, error)
- func (rc *RootChain) StartExit(a *types.Account, txOutPos types.Position, tx *types.Tx, txProofBytes []byte) (*gethtypes.Transaction, error)
- func (rc *RootChain) WatchDepositCreated(ctx context.Context, sink chan<- *RootChainDepositCreated) (event.Subscription, error)
- func (rc *RootChain) WatchExitStarted(ctx context.Context, sink chan<- *RootChainExitStarted) (event.Subscription, error)
- type RootChainConfig
- type RootChainDepositCreated
- type RootChainExitStarted
Constants ¶
View Source
const ( FirstBlockNumber = 1 MempoolSize = 99999 // must be less than or equal to types.MaxBlockTxesNum )
View Source
const (
DefaultExitBondAmount = 123456789
)
View Source
const RootChainABI = "" /* 3633-byte string literal not displayed */
View Source
const RootChainBin = `` /* 30780-byte string literal not displayed */
Variables ¶
View Source
var ( ErrMempoolFull = errors.New("mempool is full") ErrBlockNotFound = errors.New("block is not found") ErrEmptyBlock = errors.New("block is empty") ErrTxNotFound = errors.New("tx is not found") ErrInvalidTxSignature = errors.New("tx signature is invalid") ErrInvalidTxConfirmationSignature = errors.New("tx confirmation signature is invalid") ErrInvalidTxBalance = errors.New("tx balance is invalid") ErrTxInNotFound = errors.New("txin is not found") ErrInvalidTxIn = errors.New("txin is invalid") ErrNullTxInConfirmation = errors.New("null txin cannot be confirmed") ErrTxOutNotFound = errors.New("txout is not found") ErrTxOutAlreadySpent = errors.New("txout was already spent") ErrTxOutAlreadyExited = errors.New("txout was already exited") ErrNullConfirmationSignature = errors.New("confirmation signature is null") )
Functions ¶
This section is empty.
Types ¶
type ChildChain ¶
type ChildChain struct{}
func NewChildChain ¶
func NewChildChain(txn *badger.Txn) (*ChildChain, error)
func (*ChildChain) AddDepositBlock ¶
func (*ChildChain) AddTxToMempool ¶
func (*ChildChain) GetCurrentBlockNumber ¶
func (cc *ChildChain) GetCurrentBlockNumber(txn *badger.Txn) (uint64, error)
func (*ChildChain) GetTxProof ¶
func (*ChildChain) GetUTXOPositions ¶
func (*ChildChain) RestoreTxOut ¶ added in v0.4.0
func (*ChildChain) ValidateTx ¶
type RootChain ¶
type RootChain struct {
// contains filtered or unexported fields
}
func NewRootChain ¶
func NewRootChain(conf RootChainConfig) (*RootChain, error)
func (*RootChain) ChallengeExit ¶
func (*RootChain) CommitPlasmaBlockRoot ¶
func (*RootChain) CurrentPlasmaBlockNumber ¶
func (*RootChain) PlasmaExits ¶
func (*RootChain) ProcessExits ¶
func (*RootChain) WatchDepositCreated ¶
func (rc *RootChain) WatchDepositCreated(ctx context.Context, sink chan<- *RootChainDepositCreated) (event.Subscription, error)
func (*RootChain) WatchExitStarted ¶ added in v0.2.0
func (rc *RootChain) WatchExitStarted(ctx context.Context, sink chan<- *RootChainExitStarted) (event.Subscription, error)
type RootChainConfig ¶
type RootChainDepositCreated ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.