Skip to content

Commit

Permalink
op-challenger: address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dajuguan committed Oct 27, 2024
1 parent 8d03dda commit 16c4c67
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion op-challenger/game/fault/contracts/faultdisputegame2.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (f *FaultDisputeGameContractLatest) GetSubClaims(ctx context.Context, block

// todo: replace hardcoded method name
txCall := batching.NewTxGetByHash(f.contract.Abi(), txHash, "move")
result, err := f.multiCaller.SingleCall(ctx, rpcblock.Latest, txCall)
result, err := f.multiCaller.SingleCall(ctx, block, txCall)
if err != nil {
return nil, fmt.Errorf("failed to load claim calldata: %w", err)
}
Expand Down
5 changes: 4 additions & 1 deletion op-service/sources/batching/test/event_stub.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ func (c *expectedFilterLogsCall) Matches(rpcMethod string, args ...interface{})
return fmt.Errorf("expected rpcMethod eth_getFilterLogs but was %v", rpcMethod)
}

topics := args[0].([][]common.Hash)
topics, ok := args[0].([][]common.Hash)
if !ok {
return fmt.Errorf("arg 0 is not [][]common.Hash")
}

if !reflect.DeepEqual(topics, c.topics) {
return fmt.Errorf("expected topics %v but was %v", c.topics, topics)
Expand Down
5 changes: 4 additions & 1 deletion op-service/sources/batching/test/tx_stub.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ func (c *expectedGetTxByHashCall) Matches(rpcMethod string, args ...interface{})
return fmt.Errorf("expected rpcMethod eth_getTransactionByHash but was %v", rpcMethod)
}

txhash := args[0].(common.Hash)
txhash, ok := args[0].(common.Hash)
if !ok {
return fmt.Errorf("arg 0 is not common.Hash")
}

if txhash != c.txHash {
return fmt.Errorf("expected txHash %v but was %v", c.txHash, txhash)
Expand Down

0 comments on commit 16c4c67

Please sign in to comment.