Documentation
¶
Index ¶
Constants ¶
const ( EnabledFlagName = "plasma.enabled" DaServerAddressFlagName = "plasma.da-server" VerifyOnReadFlagName = "plasma.verify-on-read" )
Variables ¶
var ErrCommitmentMismatch = errors.New("commitment mismatch")
ErrCommitmentMismatch is returned when the server returns the wrong input for the given commitment.
var ErrInvalidInput = errors.New("invalid input")
ErrInvalidInput is returned when the input is not valid for posting to the DA storage.
var ErrNotFound = errors.New("not found")
ErrNotFound is returned when the server could not find the input.
Functions ¶
Types ¶
type CLIConfig ¶
func ReadCLIConfig ¶
func ReadCLIConfig(c *cli.Context) CLIConfig
func (CLIConfig) NewDAClient ¶
type DA ¶
type DA struct {
// contains filtered or unexported fields
}
func NewPlasmaDA ¶
NewPlasmaDA creates a new PlasmaDA instance with the given log and CLIConfig.
func NewPlasmaDAWithStorage ¶
NewPlasmaDAWithStorage creates a new PlasmaDA instance with the given log and DAStorage interface.
type DAClient ¶
type DAClient struct {
// contains filtered or unexported fields
}
DAClient is an HTTP client to communicate with a DA storage service. It creates commitments and retrieves input data + verifies if needed. Currently only supports Keccak256 commitments but may be extended eventually.
func NewDAClient ¶
type DAErrFaker ¶
type DAErrFaker struct { Client *MockDAClient // contains filtered or unexported fields }
func (*DAErrFaker) ActGetPreImageFail ¶
func (f *DAErrFaker) ActGetPreImageFail()
func (*DAErrFaker) ActSetPreImageFail ¶
func (f *DAErrFaker) ActSetPreImageFail()
func (*DAErrFaker) SetPreImage ¶
type MockDAClient ¶
type MockDAClient struct {
// contains filtered or unexported fields
}
MockDAClient mocks a DA storage provider to avoid running an HTTP DA server in unit tests.
func NewMockDAClient ¶
func NewMockDAClient(log log.Logger) *MockDAClient
func (*MockDAClient) DeleteData ¶
func (c *MockDAClient) DeleteData(key []byte) error