2022-01-11 23:49:04 +00:00
|
|
|
package types
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/ethereum/go-ethereum/common"
|
|
|
|
"github.com/ethereum/go-ethereum/core/types"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Publisher interface {
|
2022-02-09 15:19:10 +00:00
|
|
|
PublishHeader(header *types.Header) error
|
2022-04-19 10:19:49 +00:00
|
|
|
PublishStateNode(node *Node, headerID string, height uint64, tx Tx) error
|
|
|
|
PublishStorageNode(node *Node, headerID string, height uint64, statePath []byte, tx Tx) error
|
|
|
|
PublishCode(height uint64, codeHash common.Hash, codeBytes []byte, tx Tx) error
|
2022-02-09 15:19:10 +00:00
|
|
|
BeginTx() (Tx, error)
|
|
|
|
PrepareTxForBatch(tx Tx, batchSize uint) (Tx, error)
|
|
|
|
}
|
|
|
|
|
|
|
|
type Tx interface {
|
|
|
|
Rollback() error
|
|
|
|
Commit() error
|
2022-01-11 23:49:04 +00:00
|
|
|
}
|