6
6
"time"
7
7
8
8
cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"
9
+ opchildtypes "github.com/initia-labs/OPinit/x/opchild/types"
9
10
ophosttypes "github.com/initia-labs/OPinit/x/ophost/types"
10
11
challengertypes "github.com/initia-labs/opinit-bots/challenger/types"
11
12
"github.com/initia-labs/opinit-bots/db"
@@ -22,7 +23,7 @@ import (
22
23
)
23
24
24
25
func TestInitiateWithdrawalHandler (t * testing.T ) {
25
- bridgeInfo := ophosttypes. QueryBridgeResponse {
26
+ bridgeInfo := opchildtypes. BridgeInfo {
26
27
BridgeId : 1 ,
27
28
}
28
29
@@ -160,7 +161,7 @@ func TestInitiateWithdrawalHandler(t *testing.T) {
160
161
}
161
162
162
163
func TestPrepareTree (t * testing.T ) {
163
- bridgeInfo := ophosttypes. QueryBridgeResponse {
164
+ bridgeInfo := opchildtypes. BridgeInfo {
164
165
BridgeId : 1 ,
165
166
}
166
167
@@ -304,15 +305,15 @@ func TestPrepareTree(t *testing.T) {
304
305
func TestPrepareOutput (t * testing.T ) {
305
306
cases := []struct {
306
307
name string
307
- bridgeInfo ophosttypes. QueryBridgeResponse
308
+ bridgeInfo opchildtypes. BridgeInfo
308
309
hostOutputs map [uint64 ]ophosttypes.Output
309
310
lastWorkingTree merkletypes.TreeInfo
310
311
expected func () (lastOutputTime time.Time , nextOutputTime time.Time , finalizingBlockHeight int64 )
311
312
err bool
312
313
}{
313
314
{
314
315
name : "no output, index 1" ,
315
- bridgeInfo : ophosttypes. QueryBridgeResponse {
316
+ bridgeInfo : opchildtypes. BridgeInfo {
316
317
BridgeId : 1 ,
317
318
BridgeConfig : ophosttypes.BridgeConfig {
318
319
SubmissionInterval : 100 ,
@@ -334,7 +335,7 @@ func TestPrepareOutput(t *testing.T) {
334
335
},
335
336
{
336
337
name : "no output, index 3" , // chain rolled back
337
- bridgeInfo : ophosttypes. QueryBridgeResponse {
338
+ bridgeInfo : opchildtypes. BridgeInfo {
338
339
BridgeId : 1 ,
339
340
BridgeConfig : ophosttypes.BridgeConfig {
340
341
SubmissionInterval : 100 ,
@@ -356,7 +357,7 @@ func TestPrepareOutput(t *testing.T) {
356
357
},
357
358
{
358
359
name : "outputs {1}, index 1" , // sync
359
- bridgeInfo : ophosttypes. QueryBridgeResponse {
360
+ bridgeInfo : opchildtypes. BridgeInfo {
360
361
BridgeId : 1 ,
361
362
BridgeConfig : ophosttypes.BridgeConfig {
362
363
SubmissionInterval : 100 ,
@@ -383,7 +384,7 @@ func TestPrepareOutput(t *testing.T) {
383
384
},
384
385
{
385
386
name : "outputs {1}, index 2" ,
386
- bridgeInfo : ophosttypes. QueryBridgeResponse {
387
+ bridgeInfo : opchildtypes. BridgeInfo {
387
388
BridgeId : 1 ,
388
389
BridgeConfig : ophosttypes.BridgeConfig {
389
390
SubmissionInterval : 300 ,
@@ -452,7 +453,7 @@ func TestPrepareOutput(t *testing.T) {
452
453
}
453
454
454
455
func TestHandleTree (t * testing.T ) {
455
- bridgeInfo := ophosttypes. QueryBridgeResponse {
456
+ bridgeInfo := opchildtypes. BridgeInfo {
456
457
BridgeId : 1 ,
457
458
BridgeConfig : ophosttypes.BridgeConfig {
458
459
SubmissionInterval : 300 ,
@@ -683,7 +684,7 @@ func TestHandleOutput(t *testing.T) {
683
684
blockId []byte
684
685
outputIndex uint64
685
686
storageRoot []byte
686
- bridgeInfo ophosttypes. QueryBridgeResponse
687
+ bridgeInfo opchildtypes. BridgeInfo
687
688
host * mockHost
688
689
expected []challengertypes.ChallengeEvent
689
690
err bool
@@ -696,7 +697,7 @@ func TestHandleOutput(t *testing.T) {
696
697
blockId : []byte ("latestBlockHashlatestBlockHashla" ),
697
698
outputIndex : 1 ,
698
699
storageRoot : []byte ("storageRootstorageRootstorageRoo" ),
699
- bridgeInfo : ophosttypes. QueryBridgeResponse {BridgeId : 1 },
700
+ bridgeInfo : opchildtypes. BridgeInfo {BridgeId : 1 },
700
701
host : NewMockHost (nil , 5 ),
701
702
expected : []challengertypes.ChallengeEvent {
702
703
& challengertypes.Output {
0 commit comments