Commit 30f3027b authored by Tien Nguyen's avatar Tien Nguyen Committed by GitHub

op-plasma: a litle fixed missing error check and godoc (#10587)

parent df5add3b
......@@ -103,7 +103,7 @@ func (c *DAClient) setInputWithCommit(ctx context.Context, comm CommitmentData,
return nil
}
// setInputs sets the input data and reads the respective DA generated commitment.
// setInput sets the input data and reads the respective DA generated commitment.
func (c *DAClient) setInput(ctx context.Context, img []byte) (CommitmentData, error) {
if len(img) == 0 {
return nil, ErrInvalidInput
......
......@@ -95,7 +95,7 @@ func NewPlasmaDAWithStorage(log log.Logger, cfg Config, storage DAStorage, metri
}
}
// NewPlasmaWithState creates a plasma storage from initial state used for testing in isolation.
// NewPlasmaDAWithState creates a plasma storage from initial state used for testing in isolation.
// We pass the L1Fetcher to each method so it is kept in sync with the conf depth of the pipeline.
func NewPlasmaDAWithState(log log.Logger, cfg Config, storage DAStorage, metrics Metricer, state *State) *DA {
return &DA{
......@@ -410,10 +410,13 @@ func DecodeChallengeStatusEvent(log *types.Log) (*bindings.DataAvailabilityChall
// DecodeResolvedInput decodes the preimage bytes from the tx input data.
func DecodeResolvedInput(data []byte) ([]byte, error) {
dacAbi, _ := bindings.DataAvailabilityChallengeMetaData.GetAbi()
dacAbi, err := bindings.DataAvailabilityChallengeMetaData.GetAbi()
if err != nil {
return nil, err
}
args := make(map[string]interface{})
err := dacAbi.Methods["resolve"].Inputs.UnpackIntoMap(args, data[4:])
err = dacAbi.Methods["resolve"].Inputs.UnpackIntoMap(args, data[4:])
if err != nil {
return nil, err
}
......
package plasma
// Max input size ensures the canonical chain cannot include input batches too large to
// MaxInputSize ensures the canonical chain cannot include input batches too large to
// challenge in the Data Availability Challenge contract. Value in number of bytes.
// This value can only be changed in a hard fork.
const MaxInputSize = 130672
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment