Skip to content

Commit

Permalink
test: adapt tests to fuels v0.53 and fuel-core v0.21
Browse files Browse the repository at this point in the history
  • Loading branch information
DefiCake committed Dec 11, 2023
1 parent 219d9f7 commit ada9407
Show file tree
Hide file tree
Showing 15 changed files with 302 additions and 365 deletions.
398 changes: 153 additions & 245 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ rust-version = "1.72.0"

[workspace.dependencies]
# Dependencies from fuel-vm repository:
fuel-asm = "0.36.0"
fuel-tx = "0.35.3"
fuel-asm = "0.43.1"
fuel-tx = "0.43.1"

# Dependencies from fuel-core repository:
fuel-core-types = { version = "0.21.0", default-features = false }

# Dependencies from fuels-rs repository:
fuels = { version = "0.50.1", features = ["fuel-core-lib"] }
fuels = { version = "0.53.0", features = ["fuel-core-lib"] }

# Third-party dependencies
tokio = { version = "1.32.0", features = ["rt", "macros"] }
Expand Down
4 changes: 2 additions & 2 deletions Forc.lock
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dependencies = [

[[package]]
name = "core"
source = "path+from-root-B77DA2F383183718"
source = "path+from-root-AC247AEA3D39B916"

[[package]]
name = "reentrancy"
Expand All @@ -37,7 +37,7 @@ dependencies = ["std"]

[[package]]
name = "std"
source = "git+https://github.com/fuellabs/sway?tag=v0.48.1#6886ef050ce62afd3fe3186ed562fd33bd76bffa"
source = "git+https://github.com/fuellabs/sway?tag=v0.47.0#34265301c6037d51444899a99df1cfc563df6016"
dependencies = ["core"]

[[package]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ mod success {
)
.await;

let (bridge, utxo_inputs, provider) = setup_environment(
let (bridge, utxo_inputs) = setup_environment(
&mut wallet,
vec![coin],
vec![message],
Expand All @@ -57,12 +57,13 @@ mod success {
)
.await;

let provider = wallet.provider().expect("Needs provider");

// Relay the test message to the bridge contract
let tx_id = relay_message_to_contract(
&wallet,
utxo_inputs.message[0].clone(),
utxo_inputs.contract,
&utxo_inputs.coin[..],
)
.await;

Expand Down Expand Up @@ -186,7 +187,7 @@ mod success {
)
.await;

let (bridge, utxo_inputs, provider) = setup_environment(
let (bridge, utxo_inputs) = setup_environment(
&mut wallet,
vec![coin],
vec![message],
Expand All @@ -196,12 +197,13 @@ mod success {
)
.await;

let provider = wallet.provider().expect("Needs provider");

// Relay the test message to the bridge contract
let tx_id = relay_message_to_contract(
&wallet,
utxo_inputs.message[0].clone(),
utxo_inputs.contract,
&utxo_inputs.coin[..],
)
.await;

Expand All @@ -213,6 +215,9 @@ mod success {
.expect("Could not obtain transaction status")
.take_receipts();

dbg!(&receipts);


let refund_registered_event = bridge
.log_decoder()
.decode_logs_with_type::<RefundRegisteredEvent>(&receipts)
Expand Down Expand Up @@ -312,7 +317,7 @@ mod success {
)
.await;

let (bridge, utxo_inputs, provider) = setup_environment(
let (bridge, utxo_inputs) = setup_environment(
&mut wallet,
vec![coin],
vec![message],
Expand All @@ -322,12 +327,13 @@ mod success {
)
.await;

let provider = wallet.provider().expect("Needs provider");

// Relay the test message to the bridge contract
let tx_id = relay_message_to_contract(
&wallet,
utxo_inputs.message[0].clone(),
utxo_inputs.contract,
&utxo_inputs.coin[..],
)
.await;

Expand Down Expand Up @@ -424,7 +430,7 @@ mod success {
)
.await;

let (bridge, utxo_inputs, provider) = setup_environment(
let (bridge, utxo_inputs) = setup_environment(
&mut wallet,
vec![coin],
vec![message],
Expand All @@ -434,12 +440,13 @@ mod success {
)
.await;

let provider = wallet.provider().expect("Needs provider");

// Relay the test message to the bridge contract
let _tx_id = relay_message_to_contract(
&wallet,
utxo_inputs.message[0].clone(),
utxo_inputs.contract,
&utxo_inputs.coin[..],
)
.await;

Expand Down Expand Up @@ -565,7 +572,7 @@ mod revert {
)
.await;

let (bridge, utxo_inputs, provider) = setup_environment(
let (bridge, utxo_inputs) = setup_environment(
&mut wallet,
vec![coin],
vec![message],
Expand All @@ -575,12 +582,13 @@ mod revert {
)
.await;

let provider = wallet.provider().expect("Needs provider");

// Relay the test message to the bridge contract
let _tx_id = relay_message_to_contract(
&wallet,
utxo_inputs.message[0].clone(),
utxo_inputs.contract,
&utxo_inputs.coin[..],
)
.await;

Expand Down Expand Up @@ -626,7 +634,7 @@ mod revert {
)
.await;

let (bridge, _, _) = setup_environment(
let (bridge, _) = setup_environment(
&mut wallet,
vec![coin],
vec![message],
Expand Down Expand Up @@ -670,7 +678,7 @@ mod revert {
)
.await;

let (bridge, utxo_inputs, _) = setup_environment(
let (bridge, utxo_inputs) = setup_environment(
&mut wallet,
vec![coin],
vec![message],
Expand All @@ -685,7 +693,6 @@ mod revert {
&wallet,
utxo_inputs.message[0].clone(),
utxo_inputs.contract,
&utxo_inputs.coin[..],
)
.await;

Expand Down
Loading

0 comments on commit ada9407

Please sign in to comment.