@@ -20,7 +20,7 @@ import (
20
20
21
21
"github.com/CosmWasm/wasmd/app"
22
22
"github.com/CosmWasm/wasmd/tests/e2e"
23
- wasmibctesting "github.com/CosmWasm/wasmd/tests/ibctesting "
23
+ wasmibctesting "github.com/CosmWasm/wasmd/tests/wasmibctesting "
24
24
"github.com/CosmWasm/wasmd/x/wasm/types"
25
25
)
26
26
@@ -34,13 +34,13 @@ func TestIBCCallbacks(t *testing.T) {
34
34
// and the contract on A should receive a source chain callback with the result (ack or timeout)
35
35
marshaler := app .MakeEncodingConfig (t ).Codec
36
36
coord := wasmibctesting .NewCoordinator (t , 2 )
37
- chainA := coord .GetChain (wasmibctesting .GetChainID (1 ))
38
- chainB := coord .GetChain (wasmibctesting .GetChainID (2 ))
37
+ chainA := wasmibctesting . NewWasmTestChain ( coord .GetChain (ibctesting .GetChainID (1 ) ))
38
+ chainB := wasmibctesting . NewWasmTestChain ( coord .GetChain (ibctesting .GetChainID (2 ) ))
39
39
40
40
actorChainA := sdk .AccAddress (chainA .SenderPrivKey .PubKey ().Address ())
41
41
oneToken := sdk .NewCoins (sdk .NewCoin (sdk .DefaultBondDenom , sdkmath .NewInt (1 )))
42
42
43
- path := wasmibctesting .NewPath (chainA , chainB )
43
+ path := wasmibctesting .NewWasmPath (chainA , chainB )
44
44
path .EndpointA .ChannelConfig = & ibctesting.ChannelConfig {
45
45
PortID : ibctransfertypes .PortID ,
46
46
Version : string (marshaler .MustMarshalJSON (& ibcfee.Metadata {FeeVersion : ibcfee .Version , AppVersion : ibctransfertypes .V2 })),
@@ -52,7 +52,7 @@ func TestIBCCallbacks(t *testing.T) {
52
52
Order : channeltypes .UNORDERED ,
53
53
}
54
54
// with an ics-20 transfer channel setup between both chains
55
- coord .Setup (path )
55
+ coord .Setup (& path . Path )
56
56
57
57
// with an ibc-callbacks contract deployed on chain A
58
58
codeIDonA := chainA .StoreCodeFile ("./testdata/ibc_callbacks.wasm" ).CodeID
@@ -128,7 +128,7 @@ func TestIBCCallbacks(t *testing.T) {
128
128
129
129
if spec .expAck {
130
130
// and the packet is relayed
131
- require . NoError ( t , coord . RelayAndAckPendingPackets (path ) )
131
+ wasmibctesting . RelayAndAckPendingPackets (path )
132
132
133
133
// then the contract on chain B should receive a receive callback
134
134
var response QueryResp
@@ -150,7 +150,7 @@ func TestIBCCallbacks(t *testing.T) {
150
150
assert .Equal (t , []byte (`{"result":"AQ=="}` ), response .IBCAckCallbacks [0 ].Acknowledgement .Data )
151
151
} else {
152
152
// and the packet times out
153
- require .NoError (t , coord .TimeoutPendingPackets (path ))
153
+ require .NoError (t , wasmibctesting .TimeoutPendingPackets (coord , path ))
154
154
155
155
// then the contract on chain B should not receive anything
156
156
var response QueryResp
@@ -179,12 +179,12 @@ func TestIBCCallbacksWithoutEntrypoints(t *testing.T) {
179
179
// and should try to call the callback on A and fail gracefully
180
180
marshaler := app .MakeEncodingConfig (t ).Codec
181
181
coord := wasmibctesting .NewCoordinator (t , 2 )
182
- chainA := coord .GetChain (wasmibctesting .GetChainID (1 ))
183
- chainB := coord .GetChain (wasmibctesting .GetChainID (2 ))
182
+ chainA := wasmibctesting . NewWasmTestChain ( coord .GetChain (ibctesting .GetChainID (1 ) ))
183
+ chainB := wasmibctesting . NewWasmTestChain ( coord .GetChain (ibctesting .GetChainID (2 ) ))
184
184
185
185
oneToken := sdk .NewCoin (sdk .DefaultBondDenom , sdkmath .NewInt (1 ))
186
186
187
- path := wasmibctesting .NewPath (chainA , chainB )
187
+ path := wasmibctesting .NewWasmPath (chainA , chainB )
188
188
path .EndpointA .ChannelConfig = & ibctesting.ChannelConfig {
189
189
PortID : ibctransfertypes .PortID ,
190
190
Version : string (marshaler .MustMarshalJSON (& ibcfee.Metadata {FeeVersion : ibcfee .Version , AppVersion : ibctransfertypes .V2 })),
@@ -196,7 +196,7 @@ func TestIBCCallbacksWithoutEntrypoints(t *testing.T) {
196
196
Order : channeltypes .UNORDERED ,
197
197
}
198
198
// with an ics-20 transfer channel setup between both chains
199
- coord .Setup (path )
199
+ coord .Setup (& path . Path )
200
200
201
201
// with a reflect contract deployed on chain A and B
202
202
contractAddrA := e2e .InstantiateReflectContract (t , chainA )
@@ -212,14 +212,14 @@ func TestIBCCallbacksWithoutEntrypoints(t *testing.T) {
212
212
ChannelID : path .EndpointA .ChannelID ,
213
213
Amount : wasmvmtypes .NewCoin (oneToken .Amount .Uint64 (), oneToken .Denom ),
214
214
Timeout : wasmvmtypes.IBCTimeout {
215
- Timestamp : uint64 (chainA .LastHeader .GetTime ().Add (time .Second * 100 ).UnixNano ()),
215
+ Timestamp : uint64 (chainA .LatestCommittedHeader .GetTime ().Add (time .Second * 100 ).UnixNano ()),
216
216
},
217
217
Memo : memo ,
218
218
},
219
219
},
220
220
})
221
221
222
222
// and the packet is relayed without problems
223
- require . NoError ( t , coord . RelayAndAckPendingPackets (path ) )
224
- assert .Empty (t , chainA .PendingSendPackets )
223
+ wasmibctesting . RelayAndAckPendingPackets (path )
224
+ assert .Empty (t , * chainA .PendingSendPackets )
225
225
}
0 commit comments