Skip to content

Commit

Permalink
op-plasma: a litle fixed missing error check and godoc (#10587)
Browse files Browse the repository at this point in the history
  • Loading branch information
tnv1 authored May 20, 2024
1 parent df5add3 commit 30f3027
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion op-plasma/daclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions op-plasma/damgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion op-plasma/params.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
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
Expand Down

0 comments on commit 30f3027

Please sign in to comment.