ipld-eth-state-snapshot/pkg/types/publisher.go

21 lines
572 B
Go
Raw Normal View History

package types
import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
)
type Publisher interface {
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
BeginTx() (Tx, error)
PrepareTxForBatch(tx Tx, batchSize uint) (Tx, error)
}
type Tx interface {
Rollback() error
Commit() error
}