Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion op-challenger/game/fault/register_task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ func TestRegisterOracle_AddsOracle(t *testing.T) {
vmAddr := common.Address{0xcc}
oracleAddr := common.Address{0xdd}
rpc := test.NewAbiBasedRpc(t, gameFactoryAddr, snapshots.LoadDisputeGameFactoryABI())
rpc.AddContract(gameImplAddr, snapshots.LoadFaultDisputeGameABI())
if gameType == faultTypes.CannonGameType {
rpc.AddContract(gameImplAddr, snapshots.LoadFaultDisputeGameABI())
} else if gameType == faultTypes.SuperCannonGameType {
rpc.AddContract(gameImplAddr, snapshots.LoadSuperFaultDisputeGameABI())
} else {
t.Fatalf("game type %v not supported", gameType)
}
rpc.AddContract(vmAddr, snapshots.LoadMIPSABI())
rpc.AddContract(oracleAddr, snapshots.LoadPreimageOracleABI())
m := metrics.NoopMetrics
Expand Down
3 changes: 3 additions & 0 deletions op-dispute-mon/mon/extract/caller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ func TestMetadataCreator_CreateContract(t *testing.T) {

func setupMetadataLoaderTest(t *testing.T, gameType uint32) (*batching.MultiCaller, *mockCacheMetrics) {
fdgAbi := snapshots.LoadFaultDisputeGameABI()
if gameType == uint32(faultTypes.SuperPermissionedGameType) || gameType == uint32(faultTypes.SuperCannonGameType) {
fdgAbi = snapshots.LoadSuperFaultDisputeGameABI()
}
stubRpc := batchingTest.NewAbiBasedRpc(t, fdgAddr, fdgAbi)
caller := batching.NewMultiCaller(stubRpc, batching.DefaultBatchSize)
stubRpc.SetResponse(fdgAddr, "version", rpcblock.Latest, nil, []interface{}{"0.18.0"})
Expand Down
3 changes: 3 additions & 0 deletions op-proposer/contracts/disputegamefactory.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ type DisputeGameFactory struct {

func NewDisputeGameFactory(addr common.Address, caller *batching.MultiCaller, networkTimeout time.Duration) *DisputeGameFactory {
factoryABI := snapshots.LoadDisputeGameFactoryABI()
// Note: Games might have different ABIs (eg SuperFaultDisputeGame) but since only a very small part of the ABI
// is actually needed, proposer always uses the latest FaultDisputeGameABI. Compatibility with other ABIs is tested
// in disputegamefactory_test.go
gameABI := snapshots.LoadFaultDisputeGameABI()
return &DisputeGameFactory{
caller: caller,
Expand Down
Loading