mirror of
https://github.com/FuelLabs/sway.git
synced 2025-08-04 18:58:20 +00:00
Bump fuel deps (#7228)
## Description Bumps fuel-vm, fuel-core fuels-rs and forc-wallet to latest versions. Upgrades Rust to 2021 edition. ## Checklist - [x] I have linked to any relevant issues. - [x] I have commented my code, particularly in hard-to-understand areas. - [x] I have updated the documentation where relevant (API docs, the reference, and the Sway book). - [x] If my change requires substantial documentation changes, I have [requested support from the DevRel team](https://github.com/FuelLabs/devrel-requests/issues/new/choose) - [x] I have added tests that prove my fix is effective or that my feature works. - [ ] I have added (or requested a maintainer to add) the necessary `Breaking*` or `New Feature` labels where relevant. - I believe this is non-breaking from user code perspective but I'm not too sure about that - [x] I have done my best to ensure that my PR adheres to [the Fuel Labs Code Review Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md). - [x] I have requested a review from the relevant team or maintainers. --------- Co-authored-by: z <zees-dev@users.noreply.github.com> Co-authored-by: zees-dev <63374656+zees-dev@users.noreply.github.com> Co-authored-by: JoshuaBatty <joshpbatty@gmail.com> Co-authored-by: IGI-111 <igi-111@protonmail.com>
This commit is contained in:
parent
e054b39628
commit
1ac3514f50
47 changed files with 1759 additions and 1972 deletions
341
Cargo.lock
generated
341
Cargo.lock
generated
|
@ -2894,7 +2894,7 @@ dependencies = [
|
|||
"forc-tracing 0.68.9",
|
||||
"forc-util",
|
||||
"fs_extra",
|
||||
"fuel-abi-types 0.12.0",
|
||||
"fuel-abi-types",
|
||||
"fuel-asm",
|
||||
"hex",
|
||||
"rexpect",
|
||||
|
@ -2936,15 +2936,15 @@ dependencies = [
|
|||
"forc-tx",
|
||||
"forc-util",
|
||||
"forc-wallet",
|
||||
"fuel-abi-types 0.12.0",
|
||||
"fuel-abi-types",
|
||||
"fuel-core-client",
|
||||
"fuel-core-types",
|
||||
"fuel-crypto",
|
||||
"fuel-tx",
|
||||
"fuel-vm",
|
||||
"fuels 0.73.0",
|
||||
"fuels-accounts 0.73.0",
|
||||
"fuels-core 0.73.0",
|
||||
"fuels",
|
||||
"fuels-accounts",
|
||||
"fuels-core",
|
||||
"futures",
|
||||
"hex",
|
||||
"k256",
|
||||
|
@ -2982,8 +2982,8 @@ dependencies = [
|
|||
"forc-util",
|
||||
"fuel-core-types",
|
||||
"fuel-crypto",
|
||||
"fuels-accounts 0.73.0",
|
||||
"fuels-core 0.73.0",
|
||||
"fuels-accounts",
|
||||
"fuels-core",
|
||||
"futures",
|
||||
"hex",
|
||||
"libp2p-identity",
|
||||
|
@ -3013,7 +3013,7 @@ dependencies = [
|
|||
"forc-test",
|
||||
"forc-tracing 0.68.9",
|
||||
"forc-util",
|
||||
"fuel-abi-types 0.12.0",
|
||||
"fuel-abi-types",
|
||||
"fuel-core-client",
|
||||
"fuel-tx",
|
||||
"fuel-types",
|
||||
|
@ -3143,7 +3143,7 @@ dependencies = [
|
|||
"flate2",
|
||||
"forc-tracing 0.68.9",
|
||||
"forc-util",
|
||||
"fuel-abi-types 0.12.0",
|
||||
"fuel-abi-types",
|
||||
"futures",
|
||||
"git2",
|
||||
"gix-url",
|
||||
|
@ -3208,7 +3208,7 @@ dependencies = [
|
|||
"anyhow",
|
||||
"forc-pkg",
|
||||
"forc-util",
|
||||
"fuel-abi-types 0.12.0",
|
||||
"fuel-abi-types",
|
||||
"fuel-tx",
|
||||
"fuel-vm",
|
||||
"rand 0.8.5",
|
||||
|
@ -3218,17 +3218,6 @@ dependencies = [
|
|||
"sway-types",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "forc-tracing"
|
||||
version = "0.67.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "af5495b9956dada79b2429d6b20c87c43db958105386221f0af206f3a123b720"
|
||||
dependencies = [
|
||||
"ansiterm",
|
||||
"tracing",
|
||||
"tracing-subscriber",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "forc-tracing"
|
||||
version = "0.68.9"
|
||||
|
@ -3240,6 +3229,18 @@ dependencies = [
|
|||
"tracing-test",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "forc-tracing"
|
||||
version = "0.68.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "13d2cd68ae8f3d08d7b30af3cc37825f5cd8b08e5d322519942becab403e6134"
|
||||
dependencies = [
|
||||
"ansiterm",
|
||||
"regex",
|
||||
"tracing",
|
||||
"tracing-subscriber",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "forc-tx"
|
||||
version = "0.68.9"
|
||||
|
@ -3250,7 +3251,7 @@ dependencies = [
|
|||
"forc-util",
|
||||
"fuel-tx",
|
||||
"fuel-types",
|
||||
"fuels-core 0.73.0",
|
||||
"fuels-core",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"thiserror 1.0.69",
|
||||
|
@ -3267,10 +3268,10 @@ dependencies = [
|
|||
"dirs 5.0.1",
|
||||
"fd-lock",
|
||||
"forc-tracing 0.68.9",
|
||||
"fuel-abi-types 0.12.0",
|
||||
"fuel-abi-types",
|
||||
"fuel-asm",
|
||||
"fuel-tx",
|
||||
"fuels-core 0.73.0",
|
||||
"fuels-core",
|
||||
"hex",
|
||||
"mark-flaky-tests",
|
||||
"paste",
|
||||
|
@ -3289,15 +3290,15 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "forc-wallet"
|
||||
version = "0.14.0"
|
||||
version = "0.15.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b1a2a7832c5f78c7136d127aa9ca1bc600298d62479a678953e278f1ef6777c0"
|
||||
checksum = "fe26faaf6b845bb47672ed9d9213a3031e694d55357d7642fe376d38380ada14"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"clap",
|
||||
"eth-keystore",
|
||||
"forc-tracing 0.67.2",
|
||||
"fuels 0.72.0",
|
||||
"forc-tracing 0.68.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"fuels",
|
||||
"futures",
|
||||
"hex",
|
||||
"home",
|
||||
|
@ -3339,23 +3340,6 @@ version = "1.3.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c"
|
||||
|
||||
[[package]]
|
||||
name = "fuel-abi-types"
|
||||
version = "0.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "026deca571c0d3304a4392a0d99c7477d58cade18b2861232c151eb0816dde0a"
|
||||
dependencies = [
|
||||
"itertools 0.10.5",
|
||||
"lazy_static",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"regex",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"syn 2.0.101",
|
||||
"thiserror 1.0.69",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fuel-abi-types"
|
||||
version = "0.12.0"
|
||||
|
@ -3375,9 +3359,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "fuel-asm"
|
||||
version = "0.60.2"
|
||||
version = "0.62.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3da0b560abd7105b17c363d4c7eb7113c5d012c80ee37548b27909acd1b18d1c"
|
||||
checksum = "d8961271ed5c974d8a9f12912d87be57fe899638f24948b3ffe4d63dfdf1063f"
|
||||
dependencies = [
|
||||
"bitflags 2.9.0",
|
||||
"fuel-types",
|
||||
|
@ -3387,9 +3371,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "fuel-core-chain-config"
|
||||
version = "0.43.2"
|
||||
version = "0.44.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "600543fab776634036af830672f47789a69669780367e15cb517f16c3e298a1c"
|
||||
checksum = "83173aa86199e86d8be9c0cfbb348808a2b1fb6b6e13db3daf31a151853c3030"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bech32",
|
||||
|
@ -3407,9 +3391,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "fuel-core-client"
|
||||
version = "0.43.2"
|
||||
version = "0.44.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f45d2baedb11cbf2d9f74c11dae0a4fc0f5edaf5d9e0ee62781f8d9f1abba74f"
|
||||
checksum = "9ea7fcdc7a51f5fbf403feb06fb45078e309bb2d4ec42b735744f2f1da59e657"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"base64 0.22.1",
|
||||
|
@ -3432,9 +3416,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "fuel-core-metrics"
|
||||
version = "0.43.2"
|
||||
version = "0.44.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7ccb032e4858849074458e41bd3c24f49ce8701c610e23d5b9d3aa64c5fd5e2d"
|
||||
checksum = "1e0412e48072faab1ea533feb8ef45c80d533c688524bd298c8f518c54209ccd"
|
||||
dependencies = [
|
||||
"once_cell",
|
||||
"parking_lot",
|
||||
|
@ -3448,9 +3432,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "fuel-core-poa"
|
||||
version = "0.43.2"
|
||||
version = "0.44.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "abb20fe65705d6e336724eb4be3b4fef371cffcb8643a960f2363f90276c4b27"
|
||||
checksum = "e3e35411b14efaa725f337d3d9d1145eac1ee2338ee78dd1cd9e0f689e7f61fe"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
|
@ -3468,9 +3452,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "fuel-core-services"
|
||||
version = "0.43.2"
|
||||
version = "0.44.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8437cfdcba66c94d4472216dd79d3cdf93495fb7b968214500d8b3f61a3e815a"
|
||||
checksum = "c78c38923404ddacb253113bd096fc009ccdcce4aeb53110a0974159b9b93f0e"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
|
@ -3484,9 +3468,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "fuel-core-storage"
|
||||
version = "0.43.2"
|
||||
version = "0.44.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a1de75a9d1f94a74818b80a3e1b34c2e03438822dcb517fcce211899982f4903"
|
||||
checksum = "eecc0a879234546d38f234943e7e7253b9d4c169cc52862595ba5b26aaea40b9"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"derive_more 0.99.20",
|
||||
|
@ -3506,9 +3490,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "fuel-core-types"
|
||||
version = "0.43.2"
|
||||
version = "0.44.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d4b15e20116e60f626107b85ec1826a10535a3101163e67471cc66fa20f393df"
|
||||
checksum = "8d720fc5e985b5fbb73fe5e948daf4839aab25c76666a87c0dfe9b5aee51505c"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bs58",
|
||||
|
@ -3527,9 +3511,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "fuel-crypto"
|
||||
version = "0.60.2"
|
||||
version = "0.62.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0bbb6ef7a5451f4e73b6a4811ed176e902af141d1b7006f5132ffee5fde86883"
|
||||
checksum = "771ddda3fa692da95b5effb32184d058c5df0f4e63764b04334db0c84c26aeb6"
|
||||
dependencies = [
|
||||
"base64ct",
|
||||
"coins-bip32",
|
||||
|
@ -3548,9 +3532,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "fuel-derive"
|
||||
version = "0.60.2"
|
||||
version = "0.62.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "982cdb2e97a5831621b47562a4ed88fecb9797605b2077c7f30d1ffbb63d4958"
|
||||
checksum = "55f7205c66781a189293ee839abb1bac516f496a22b889b07f8f787b25475601"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
@ -3607,9 +3591,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "fuel-merkle"
|
||||
version = "0.60.2"
|
||||
version = "0.62.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3848d4c7d0485554eb8280b3b3da67e56dc01fb6f31af1a994f9e453989117cf"
|
||||
checksum = "ec01781b757227d9553b178f788f7d922688dcc45cf616ec9c871cd1a591a910"
|
||||
dependencies = [
|
||||
"derive_more 0.99.20",
|
||||
"digest 0.10.7",
|
||||
|
@ -3622,15 +3606,15 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "fuel-storage"
|
||||
version = "0.60.2"
|
||||
version = "0.62.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0d874d57e5ccaa1ad80f39304a9e50dcc0ced5aad3710730fcb629a55ab478f5"
|
||||
checksum = "ca73c81646409e9cacac532ff790567d629bc6c512c10ff986536e2335de22c9"
|
||||
|
||||
[[package]]
|
||||
name = "fuel-tx"
|
||||
version = "0.60.2"
|
||||
version = "0.62.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "50239ffd36450fe7a520a13ed23e26cc9caedb7ac24fa65f5b02e1af8074da09"
|
||||
checksum = "a74c65a78258d1e8ccc3400692e557910422c3d1a992a88ff384799ccc69c46a"
|
||||
dependencies = [
|
||||
"bitflags 2.9.0",
|
||||
"derive_more 1.0.0",
|
||||
|
@ -3650,9 +3634,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "fuel-types"
|
||||
version = "0.60.2"
|
||||
version = "0.62.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "da2d9bc4981b2ecf6896577dd569ce1d9a86bf88352f8c3f7618fe5c910c5176"
|
||||
checksum = "2b07f2043e0f0cbef39c49ccf74c158609e0abd989684fa73389e5720b19f6d9"
|
||||
dependencies = [
|
||||
"fuel-derive",
|
||||
"hex",
|
||||
|
@ -3662,9 +3646,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "fuel-vm"
|
||||
version = "0.60.2"
|
||||
version = "0.62.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "676037dcbf91d010288c6c75eca649cb0064673aa81341a3d3c6f8198e45776b"
|
||||
checksum = "be89fd58ba3ca4a65a0130804b663f4629a39a1a3c687e92ebf559f2226c7077"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
|
@ -3697,41 +3681,25 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "fuels"
|
||||
version = "0.72.0"
|
||||
version = "0.74.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "61545320527f0031e51a089e6c1cee29179119156661918272ba4dcf33f68590"
|
||||
checksum = "7e13622e2d44e7814daa8242a77fb0b88ae3210b2c90108550c373fe0695c5c4"
|
||||
dependencies = [
|
||||
"fuel-core-client",
|
||||
"fuel-crypto",
|
||||
"fuel-tx",
|
||||
"fuels-accounts 0.72.0",
|
||||
"fuels-core 0.72.0",
|
||||
"fuels-macros 0.72.0",
|
||||
"fuels-programs 0.72.0",
|
||||
"fuels-test-helpers 0.72.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fuels"
|
||||
version = "0.73.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0841be0b80599025375e15c869c7e4718d18fc08a1312a64e9d48cc3446816a0"
|
||||
dependencies = [
|
||||
"fuel-core-client",
|
||||
"fuel-crypto",
|
||||
"fuel-tx",
|
||||
"fuels-accounts 0.73.0",
|
||||
"fuels-core 0.73.0",
|
||||
"fuels-macros 0.73.0",
|
||||
"fuels-programs 0.73.0",
|
||||
"fuels-test-helpers 0.73.0",
|
||||
"fuels-accounts",
|
||||
"fuels-core",
|
||||
"fuels-macros",
|
||||
"fuels-programs",
|
||||
"fuels-test-helpers",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fuels-accounts"
|
||||
version = "0.72.0"
|
||||
version = "0.74.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0c468fc862f8a352dc0b32eb67de84edebe9574b7d6c94a70474a6e1115967c8"
|
||||
checksum = "4feb69d1125ea27b8f3020086e6394fe19867e137309da45faddce4cde98d9c3"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"chrono",
|
||||
|
@ -3741,33 +3709,7 @@ dependencies = [
|
|||
"fuel-crypto",
|
||||
"fuel-tx",
|
||||
"fuel-types",
|
||||
"fuels-core 0.72.0",
|
||||
"futures",
|
||||
"itertools 0.12.1",
|
||||
"k256",
|
||||
"rand 0.8.5",
|
||||
"semver 1.0.26",
|
||||
"tai64",
|
||||
"thiserror 1.0.69",
|
||||
"tokio",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fuels-accounts"
|
||||
version = "0.73.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e50f17b058f649127b3d60c5ac63b0f143012388f725afa3d02fb33168ed4c4c"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"chrono",
|
||||
"cynic",
|
||||
"fuel-core-client",
|
||||
"fuel-core-types",
|
||||
"fuel-crypto",
|
||||
"fuel-tx",
|
||||
"fuel-types",
|
||||
"fuels-core 0.73.0",
|
||||
"fuels-core",
|
||||
"futures",
|
||||
"itertools 0.12.1",
|
||||
"k256",
|
||||
|
@ -3781,28 +3723,12 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "fuels-code-gen"
|
||||
version = "0.72.0"
|
||||
version = "0.74.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f1e891bfe1885edb6e8d132e9d50e9996a03dd4cc2f33ec533658811bedbaba1"
|
||||
checksum = "c2bf80dac7255cd5b3ed2a69745622946151fc85b92fe7b1c3e0bbeecba6322e"
|
||||
dependencies = [
|
||||
"Inflector",
|
||||
"fuel-abi-types 0.8.0",
|
||||
"itertools 0.12.1",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"regex",
|
||||
"serde_json",
|
||||
"syn 2.0.101",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fuels-code-gen"
|
||||
version = "0.73.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "057b5a7e903fa128767e46fa106877dfe983763c2026f18a0de3582f1dc4a472"
|
||||
dependencies = [
|
||||
"Inflector",
|
||||
"fuel-abi-types 0.12.0",
|
||||
"fuel-abi-types",
|
||||
"itertools 0.12.1",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
@ -3813,15 +3739,14 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "fuels-core"
|
||||
version = "0.72.0"
|
||||
version = "0.74.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f049f990f0fe1cd31426ea9e9dd1093f7dc4045f1d4eaa1dcda0a237bff656e7"
|
||||
checksum = "c51b11f3d1a01839c84a71fcd486382bd626042faa5c4950436edd0355016c89"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"auto_impl",
|
||||
"bech32",
|
||||
"chrono",
|
||||
"fuel-abi-types 0.8.0",
|
||||
"fuel-abi-types",
|
||||
"fuel-asm",
|
||||
"fuel-core-chain-config",
|
||||
"fuel-core-client",
|
||||
|
@ -3830,42 +3755,10 @@ dependencies = [
|
|||
"fuel-tx",
|
||||
"fuel-types",
|
||||
"fuel-vm",
|
||||
"fuels-macros 0.72.0",
|
||||
"fuels-macros",
|
||||
"hex",
|
||||
"itertools 0.12.1",
|
||||
"postcard",
|
||||
"rand 0.8.5",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sha2",
|
||||
"thiserror 1.0.69",
|
||||
"uint",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fuels-core"
|
||||
version = "0.73.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d4e75b09054b31683b7fe58b9b2d1558b8119a98bbff9bbb5630273942de94db"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"auto_impl",
|
||||
"bech32",
|
||||
"chrono",
|
||||
"fuel-abi-types 0.12.0",
|
||||
"fuel-asm",
|
||||
"fuel-core-chain-config",
|
||||
"fuel-core-client",
|
||||
"fuel-core-types",
|
||||
"fuel-crypto",
|
||||
"fuel-tx",
|
||||
"fuel-types",
|
||||
"fuel-vm",
|
||||
"fuels-macros 0.73.0",
|
||||
"hex",
|
||||
"itertools 0.12.1",
|
||||
"postcard",
|
||||
"rand 0.8.5",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sha2",
|
||||
|
@ -3875,24 +3768,11 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "fuels-macros"
|
||||
version = "0.72.0"
|
||||
version = "0.74.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2e889da5754ac646bcea2de50f4bf8d823714552f3ffcfbbcceb77aeb801ec37"
|
||||
checksum = "0424e09f6c0b4ec2dd204af8195f74a4fb72879383de32541b71da0e1ab9b01a"
|
||||
dependencies = [
|
||||
"fuels-code-gen 0.72.0",
|
||||
"itertools 0.12.1",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.101",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fuels-macros"
|
||||
version = "0.73.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "64e3b6c37e12da9b3be5834f167420d2a7c54f9e7c56d226ce4ca879c7c72708"
|
||||
dependencies = [
|
||||
"fuels-code-gen 0.73.0",
|
||||
"fuels-code-gen",
|
||||
"itertools 0.12.1",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
@ -3901,36 +3781,17 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "fuels-programs"
|
||||
version = "0.72.0"
|
||||
version = "0.74.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dd0bc1575119d233e5302dd0c6badb847c2e080862b23b5f8e984dffe0a3fbd2"
|
||||
checksum = "595f83f274003d1a75b1e065433e933286375aa8cde91d14787ec803bbc91b26"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"fuel-abi-types 0.8.0",
|
||||
"fuel-abi-types",
|
||||
"fuel-asm",
|
||||
"fuel-tx",
|
||||
"fuel-types",
|
||||
"fuels-accounts 0.72.0",
|
||||
"fuels-core 0.72.0",
|
||||
"itertools 0.12.1",
|
||||
"rand 0.8.5",
|
||||
"serde_json",
|
||||
"tokio",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fuels-programs"
|
||||
version = "0.73.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1b78e60f28888da4acecff2ddd07f0730cf5c4e04a0923c7f0f9db0850985350"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"fuel-abi-types 0.12.0",
|
||||
"fuel-asm",
|
||||
"fuel-tx",
|
||||
"fuel-types",
|
||||
"fuels-accounts 0.73.0",
|
||||
"fuels-core 0.73.0",
|
||||
"fuels-accounts",
|
||||
"fuels-core",
|
||||
"itertools 0.12.1",
|
||||
"rand 0.8.5",
|
||||
"serde_json",
|
||||
|
@ -3939,9 +3800,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "fuels-test-helpers"
|
||||
version = "0.72.0"
|
||||
version = "0.74.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ea2c9bb9442f638eaa0540c1d43fd97050df32b49bbcdc3d51989949b13ae7fa"
|
||||
checksum = "b95d72b29baad3bd8111085785e90357b2b9300bde65eabfbf142a8d8570f44d"
|
||||
dependencies = [
|
||||
"fuel-core-chain-config",
|
||||
"fuel-core-client",
|
||||
|
@ -3951,32 +3812,8 @@ dependencies = [
|
|||
"fuel-crypto",
|
||||
"fuel-tx",
|
||||
"fuel-types",
|
||||
"fuels-accounts 0.72.0",
|
||||
"fuels-core 0.72.0",
|
||||
"futures",
|
||||
"portpicker",
|
||||
"rand 0.8.5",
|
||||
"tempfile",
|
||||
"tokio",
|
||||
"which 6.0.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fuels-test-helpers"
|
||||
version = "0.73.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cfcee4e76241696b8700c509797c2c6d0be0607c8a5191d4aa41384dccf1ab3e"
|
||||
dependencies = [
|
||||
"fuel-core-chain-config",
|
||||
"fuel-core-client",
|
||||
"fuel-core-poa",
|
||||
"fuel-core-services",
|
||||
"fuel-core-types",
|
||||
"fuel-crypto",
|
||||
"fuel-tx",
|
||||
"fuel-types",
|
||||
"fuels-accounts 0.73.0",
|
||||
"fuels-core 0.73.0",
|
||||
"fuels-accounts",
|
||||
"fuels-core",
|
||||
"futures",
|
||||
"portpicker",
|
||||
"rand 0.8.5",
|
||||
|
@ -8235,7 +8072,7 @@ dependencies = [
|
|||
"clap",
|
||||
"dirs 5.0.1",
|
||||
"either",
|
||||
"fuel-abi-types 0.12.0",
|
||||
"fuel-abi-types",
|
||||
"fuel-ethabi",
|
||||
"fuel-etk-asm",
|
||||
"fuel-etk-ops",
|
||||
|
|
22
Cargo.toml
22
Cargo.toml
|
@ -89,24 +89,24 @@ fuel-abi-types = "0.12"
|
|||
# Although ALL versions are "X.Y", we need the complete semver for
|
||||
# fuel-core-client as the GitHub Actions workflow parses this value to pull down
|
||||
# the correct tarball.
|
||||
fuel-core-client = { version = "0.43.2", default-features = false }
|
||||
fuel-core-types = { version = "0.43", default-features = false }
|
||||
fuel-core-client = { version = "0.44.0", default-features = false }
|
||||
fuel-core-types = { version = "0.44", default-features = false }
|
||||
|
||||
# Dependencies from the `fuels-rs` repository:
|
||||
|
||||
fuels = "0.73"
|
||||
fuels-core = "0.73"
|
||||
fuels-accounts = "0.73"
|
||||
fuels = "0.74"
|
||||
fuels-core = "0.74"
|
||||
fuels-accounts = "0.74"
|
||||
|
||||
# Dependencies from the `fuel-vm` repository:
|
||||
fuel-asm = "0.60"
|
||||
fuel-crypto = "0.60"
|
||||
fuel-types = "0.60"
|
||||
fuel-tx = "0.60"
|
||||
fuel-vm = "0.60"
|
||||
fuel-asm = "0.62"
|
||||
fuel-crypto = "0.62"
|
||||
fuel-types = "0.62"
|
||||
fuel-tx = "0.62"
|
||||
fuel-vm = "0.62"
|
||||
|
||||
# Dependencies from the `forc-wallet` repository:
|
||||
forc-wallet = "0.14"
|
||||
forc-wallet = "0.15"
|
||||
|
||||
#
|
||||
# External dependencies
|
||||
|
|
|
@ -8,6 +8,9 @@ homepage.workspace = true
|
|||
license.workspace = true
|
||||
repository.workspace = true
|
||||
|
||||
[target.'cfg(not(target_os = "macos"))'.dependencies]
|
||||
sysinfo.workspace = true
|
||||
|
||||
[dependencies]
|
||||
ansiterm.workspace = true
|
||||
anyhow.workspace = true
|
||||
|
@ -47,6 +50,3 @@ walkdir.workspace = true
|
|||
[dev-dependencies]
|
||||
regex.workspace = true
|
||||
tempfile.workspace = true
|
||||
|
||||
[target.'cfg(not(target_os = "macos"))'.dependencies]
|
||||
sysinfo.workspace = true
|
||||
|
|
|
@ -8,6 +8,25 @@ homepage.workspace = true
|
|||
license.workspace = true
|
||||
repository.workspace = true
|
||||
|
||||
[lib]
|
||||
path = "src/lib.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "forc-deploy"
|
||||
path = "src/bin/deploy.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "forc-run"
|
||||
path = "src/bin/run.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "forc-submit"
|
||||
path = "src/bin/submit.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "forc-call"
|
||||
path = "src/bin/call.rs"
|
||||
|
||||
[dependencies]
|
||||
ansiterm.workspace = true
|
||||
anyhow.workspace = true
|
||||
|
@ -59,29 +78,10 @@ toml_edit.workspace = true
|
|||
tracing.workspace = true
|
||||
url.workspace = true
|
||||
|
||||
[build-dependencies]
|
||||
regex.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
portpicker.workspace = true
|
||||
pretty_assertions.workspace = true
|
||||
rexpect.workspace = true
|
||||
|
||||
[build-dependencies]
|
||||
regex.workspace = true
|
||||
|
||||
[[bin]]
|
||||
name = "forc-deploy"
|
||||
path = "src/bin/deploy.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "forc-run"
|
||||
path = "src/bin/run.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "forc-submit"
|
||||
path = "src/bin/submit.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "forc-call"
|
||||
path = "src/bin/call.rs"
|
||||
|
||||
[lib]
|
||||
path = "src/lib.rs"
|
||||
|
|
|
@ -346,7 +346,7 @@ impl Command {
|
|||
return Err("Direct transfers are only supported in live mode".to_string());
|
||||
}
|
||||
return Ok(Operation::DirectTransfer {
|
||||
recipient: (*self.address).into(),
|
||||
recipient: self.address,
|
||||
amount: self.call_parameters.amount,
|
||||
asset_id: self.call_parameters.asset_id,
|
||||
});
|
||||
|
|
|
@ -23,7 +23,6 @@ use fuels_core::{
|
|||
EncoderConfig, ErrorDetails, LogDecoder,
|
||||
},
|
||||
types::{
|
||||
bech32::Bech32ContractId,
|
||||
param_types::ParamType,
|
||||
transaction::Transaction,
|
||||
transaction_builders::{BuildableTransaction, ScriptBuildStrategy, VariableOutputPolicy},
|
||||
|
@ -70,7 +69,7 @@ pub async fn call_function(
|
|||
|
||||
// Create the contract call
|
||||
let call = ContractCall {
|
||||
contract_id: contract_id.into(),
|
||||
contract_id,
|
||||
encoded_selector: encode_fn_selector(&selector),
|
||||
encoded_args: Ok(encoded_data),
|
||||
call_parameters: call_parameters.clone().into(),
|
||||
|
@ -110,10 +109,7 @@ pub async fn call_function(
|
|||
|
||||
// Get external contracts (either provided or auto-detected)
|
||||
let external_contracts = match external_contracts {
|
||||
Some(external_contracts) => external_contracts
|
||||
.iter()
|
||||
.map(|addr| Bech32ContractId::from(*addr))
|
||||
.collect(),
|
||||
Some(external_contracts) => external_contracts,
|
||||
None => {
|
||||
// Automatically retrieve missing contract addresses from the call
|
||||
let external_contracts = determine_missing_contracts(
|
||||
|
@ -130,7 +126,7 @@ pub async fn call_function(
|
|||
"Automatically provided external contract addresses with call (max 10):",
|
||||
);
|
||||
external_contracts.iter().for_each(|addr| {
|
||||
forc_tracing::println_warning(&format!("- 0x{}", ContractId::from(addr)));
|
||||
forc_tracing::println_warning(&format!("- 0x{}", addr));
|
||||
});
|
||||
}
|
||||
external_contracts
|
||||
|
@ -175,7 +171,7 @@ pub async fn call_function(
|
|||
cmd::call::ExecutionMode::Live => {
|
||||
forc_tracing::println_action_green(
|
||||
"Sending transaction with wallet",
|
||||
&format!("0x{}", wallet.address().hash()),
|
||||
&format!("0x{}", wallet.address()),
|
||||
);
|
||||
let tx = call
|
||||
.build_tx(tb, &wallet)
|
||||
|
@ -242,7 +238,7 @@ pub async fn call_function(
|
|||
}
|
||||
cmd::call::OutputFormat::Raw => {
|
||||
let token = receipt_parser
|
||||
.parse_call(&Bech32ContractId::from(contract_id), &output_param)
|
||||
.parse_call(contract_id, &output_param)
|
||||
.map_err(|e| anyhow!("Failed to parse call data: {e}"))?;
|
||||
token_to_string(&token)
|
||||
.map_err(|e| anyhow!("Failed to convert token to string: {e}"))?
|
||||
|
@ -386,9 +382,9 @@ pub mod tests {
|
|||
.unwrap()
|
||||
.contract_id;
|
||||
|
||||
let instance = TestContract::new(id.clone(), wallet.clone());
|
||||
let instance = TestContract::new(id, wallet.clone());
|
||||
|
||||
(instance, id.into(), provider, secret_key)
|
||||
(instance, id, provider, secret_key)
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
|
@ -775,15 +771,15 @@ pub mod tests {
|
|||
|
||||
let consensus_parameters = provider.consensus_parameters().await.unwrap();
|
||||
let base_asset_id = consensus_parameters.base_asset_id();
|
||||
let get_recipient_balance = |addr: Bech32Address, provider: Provider| async move {
|
||||
let get_recipient_balance = |addr: Address, provider: Provider| async move {
|
||||
provider
|
||||
.get_asset_balance(&addr, *base_asset_id)
|
||||
.get_asset_balance(&addr, base_asset_id)
|
||||
.await
|
||||
.unwrap()
|
||||
};
|
||||
let get_contract_balance = |id: ContractId, provider: Provider| async move {
|
||||
provider
|
||||
.get_contract_asset_balance(&Bech32ContractId::from(id), *base_asset_id)
|
||||
.get_contract_asset_balance(&id, base_asset_id)
|
||||
.await
|
||||
.unwrap()
|
||||
};
|
||||
|
@ -828,7 +824,7 @@ pub mod tests {
|
|||
let (amount, asset_id, recipient) = (
|
||||
"2",
|
||||
&format!("{{0x{}}}", base_asset_id),
|
||||
&format!("(Address:{{0x{}}})", random_wallet.address().hash()),
|
||||
&format!("(Address:{{0x{}}})", random_wallet.address()),
|
||||
);
|
||||
let mut cmd = get_contract_call_cmd(
|
||||
id,
|
||||
|
@ -846,7 +842,7 @@ pub mod tests {
|
|||
let operation = cmd.validate_and_get_operation().unwrap();
|
||||
assert_eq!(call(operation, cmd).await.unwrap().result.unwrap(), "()");
|
||||
assert_eq!(
|
||||
get_recipient_balance(random_wallet.address().clone(), provider.clone()).await,
|
||||
get_recipient_balance(random_wallet.address(), provider.clone()).await,
|
||||
2
|
||||
);
|
||||
assert_eq!(get_contract_balance(id, provider.clone()).await, 1);
|
||||
|
@ -858,7 +854,7 @@ pub mod tests {
|
|||
let (amount, asset_id, recipient) = (
|
||||
"5",
|
||||
&format!("{{0x{}}}", base_asset_id),
|
||||
&format!("(Address:{{0x{}}})", random_wallet.address().hash()),
|
||||
&format!("(Address:{{0x{}}})", random_wallet.address()),
|
||||
);
|
||||
let mut cmd = get_contract_call_cmd(
|
||||
id,
|
||||
|
@ -887,7 +883,7 @@ pub mod tests {
|
|||
let (amount, asset_id, recipient) = (
|
||||
"3",
|
||||
&format!("{{0x{}}}", base_asset_id),
|
||||
&format!("(Address:{{0x{}}})", random_wallet.address().hash()),
|
||||
&format!("(Address:{{0x{}}})", random_wallet.address()),
|
||||
);
|
||||
let mut cmd = get_contract_call_cmd(
|
||||
id,
|
||||
|
@ -905,7 +901,7 @@ pub mod tests {
|
|||
let operation = cmd.validate_and_get_operation().unwrap();
|
||||
assert_eq!(call(operation, cmd).await.unwrap().result.unwrap(), "()");
|
||||
assert_eq!(
|
||||
get_recipient_balance(random_wallet.address().clone(), provider.clone()).await,
|
||||
get_recipient_balance(random_wallet.address(), provider.clone()).await,
|
||||
3
|
||||
);
|
||||
assert_eq!(get_contract_balance(id, provider.clone()).await, 6); // extra amount (5) is forwarded to the contract
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
use anyhow::{bail, Result};
|
||||
use fuel_tx::ContractId;
|
||||
use fuels::programs::calls::{
|
||||
traits::TransactionTuner, utils::find_ids_of_missing_contracts, ContractCall,
|
||||
};
|
||||
|
@ -7,9 +8,7 @@ use fuels_accounts::{
|
|||
signers::private_key::PrivateKeySigner,
|
||||
wallet::{Unlocked, Wallet},
|
||||
};
|
||||
use fuels_core::types::{
|
||||
bech32::Bech32ContractId, transaction::TxPolicies, transaction_builders::VariableOutputPolicy,
|
||||
};
|
||||
use fuels_core::types::{transaction::TxPolicies, transaction_builders::VariableOutputPolicy};
|
||||
|
||||
/// Get the missing contracts from a contract call by dry-running the transaction
|
||||
/// to find contracts that are not explicitly listed in the call's `external_contracts` field.
|
||||
|
@ -21,7 +20,7 @@ pub async fn determine_missing_contracts(
|
|||
variable_output_policy: &VariableOutputPolicy,
|
||||
log_decoder: &fuels_core::codec::LogDecoder,
|
||||
account: &Wallet<Unlocked<PrivateKeySigner>>,
|
||||
) -> Result<Vec<Bech32ContractId>> {
|
||||
) -> Result<Vec<ContractId>> {
|
||||
let tb = call
|
||||
.transaction_builder(*tx_policies, *variable_output_policy, account)
|
||||
.await
|
||||
|
|
|
@ -165,7 +165,7 @@ async fn get_wallet(
|
|||
let wallet = Wallet::new(signer, provider);
|
||||
forc_tracing::println_warning(&format!(
|
||||
"No signing key or wallet flag provided. Using default signer: 0x{}",
|
||||
wallet.address().hash()
|
||||
wallet.address()
|
||||
));
|
||||
Ok(wallet)
|
||||
}
|
||||
|
@ -174,7 +174,7 @@ async fn get_wallet(
|
|||
let wallet = Wallet::new(signer, provider);
|
||||
forc_tracing::println_warning(&format!(
|
||||
"Using account {} derived from signing key...",
|
||||
wallet.address().hash()
|
||||
wallet.address()
|
||||
));
|
||||
Ok(wallet)
|
||||
}
|
||||
|
@ -369,8 +369,8 @@ pub(crate) mod tests {
|
|||
.unwrap()
|
||||
.contract_id;
|
||||
|
||||
let instance = TestContract::new(id.clone(), wallet.clone());
|
||||
let instance = TestContract::new(id, wallet.clone());
|
||||
|
||||
(instance, id.into(), provider, secret_key)
|
||||
(instance, id, provider, secret_key)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
use anyhow::anyhow;
|
||||
use fuels::{
|
||||
accounts::{wallet::Wallet, Account},
|
||||
types::{
|
||||
bech32::{Bech32Address, Bech32ContractId},
|
||||
tx_status::TxStatus,
|
||||
},
|
||||
types::tx_status::TxStatus,
|
||||
};
|
||||
use fuels_core::types::{transaction::TxPolicies, Address, AssetId};
|
||||
|
||||
|
@ -29,7 +26,7 @@ pub async fn transfer(
|
|||
amount, asset_id, recipient
|
||||
)?;
|
||||
wallet
|
||||
.transfer(&recipient.into(), amount, asset_id, tx_policies)
|
||||
.transfer(recipient, amount, asset_id, tx_policies)
|
||||
.await
|
||||
.map_err(|e| anyhow!("Failed to transfer funds to recipient: {}", e))?
|
||||
} else {
|
||||
|
@ -38,13 +35,9 @@ pub async fn transfer(
|
|||
"\nTransferring {} 0x{} to contract address 0x{}...\n",
|
||||
amount, asset_id, recipient
|
||||
)?;
|
||||
let address: Bech32Address = recipient.into();
|
||||
let contract_id = Bech32ContractId {
|
||||
hrp: address.hrp,
|
||||
hash: address.hash,
|
||||
};
|
||||
let contract_id = (*recipient).into();
|
||||
wallet
|
||||
.force_transfer_to_contract(&contract_id, amount, asset_id, tx_policies)
|
||||
.force_transfer_to_contract(contract_id, amount, asset_id, tx_policies)
|
||||
.await
|
||||
.map_err(|e| anyhow!("Failed to transfer funds to contract: {}", e))?
|
||||
};
|
||||
|
@ -83,22 +76,22 @@ mod tests {
|
|||
|
||||
let wallet_sender = wallets.pop().unwrap();
|
||||
let wallet_recipient = wallets.pop().unwrap();
|
||||
let recipient_address = wallet_recipient.address().into();
|
||||
let recipient_address = wallet_recipient.address();
|
||||
|
||||
let provider = wallet_sender.provider();
|
||||
let consensus_parameters = provider.consensus_parameters().await.unwrap();
|
||||
let base_asset_id = consensus_parameters.base_asset_id();
|
||||
|
||||
// Test helpers to get balances
|
||||
let get_recipient_balance = |addr: Bech32Address| async move {
|
||||
let get_recipient_balance = |addr: Address| async move {
|
||||
provider
|
||||
.get_asset_balance(&addr, *base_asset_id)
|
||||
.get_asset_balance(&addr, base_asset_id)
|
||||
.await
|
||||
.unwrap()
|
||||
};
|
||||
|
||||
// Get initial balance of recipient
|
||||
let initial_balance = get_recipient_balance(wallet_recipient.address().clone()).await;
|
||||
let initial_balance = get_recipient_balance(wallet_recipient.address()).await;
|
||||
|
||||
// Test parameters
|
||||
let tx_policies = TxPolicies::default();
|
||||
|
@ -131,8 +124,8 @@ mod tests {
|
|||
|
||||
// Verify balance has increased by the transfer amount
|
||||
assert_eq!(
|
||||
get_recipient_balance(wallet_recipient.address().clone()).await,
|
||||
initial_balance + amount,
|
||||
get_recipient_balance(wallet_recipient.address()).await,
|
||||
initial_balance + amount as u128,
|
||||
"Balance should increase by transfer amount"
|
||||
);
|
||||
}
|
||||
|
@ -147,7 +140,7 @@ mod tests {
|
|||
|
||||
// Verify initial contract balance
|
||||
let balance = provider
|
||||
.get_contract_asset_balance(&Bech32ContractId::from(id), *base_asset_id)
|
||||
.get_contract_asset_balance(&id, base_asset_id)
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(balance, 0, "Balance should be 0");
|
||||
|
@ -183,7 +176,7 @@ mod tests {
|
|||
|
||||
// Verify balance has increased by the transfer amount
|
||||
let balance = provider
|
||||
.get_contract_asset_balance(&Bech32ContractId::from(id), *base_asset_id)
|
||||
.get_contract_asset_balance(&id, base_asset_id)
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(
|
||||
|
|
|
@ -29,7 +29,7 @@ use fuels::{
|
|||
contract::{LoadConfiguration, StorageConfiguration},
|
||||
executable::Executable,
|
||||
},
|
||||
types::{bech32::Bech32ContractId, transaction_builders::Blob},
|
||||
types::transaction_builders::Blob,
|
||||
};
|
||||
use fuels_accounts::{provider::Provider, Account, ViewOnlyAccount};
|
||||
use fuels_core::types::{transaction::TxPolicies, transaction_builders::CreateTransactionBuilder};
|
||||
|
@ -205,8 +205,7 @@ async fn deploy_chunked(
|
|||
fuels::programs::contract::Contract::loader_from_blobs(blobs, salt, storage_slots)?
|
||||
.deploy(account, tx_policies)
|
||||
.await?
|
||||
.contract_id
|
||||
.into();
|
||||
.contract_id;
|
||||
|
||||
println_action_green(
|
||||
"Finished",
|
||||
|
@ -237,7 +236,7 @@ async fn deploy_new_proxy(
|
|||
|
||||
let configurables = ProxyContractConfigurables::default()
|
||||
.with_INITIAL_TARGET(Some(*impl_contract))?
|
||||
.with_INITIAL_OWNER(State::Initialized(Address::from(address).into()))?;
|
||||
.with_INITIAL_OWNER(State::Initialized(address.into()))?;
|
||||
|
||||
let configuration = LoadConfiguration::default()
|
||||
.with_storage_configuration(storage_configuration)
|
||||
|
@ -250,8 +249,7 @@ async fn deploy_new_proxy(
|
|||
)?
|
||||
.deploy(account, tx_policies)
|
||||
.await?
|
||||
.contract_id
|
||||
.into();
|
||||
.contract_id;
|
||||
|
||||
let chain_info = provider.chain_info().await?;
|
||||
let target = Target::from_str(&chain_info.name).unwrap_or_default();
|
||||
|
@ -265,8 +263,7 @@ async fn deploy_new_proxy(
|
|||
&format!("deploying proxy contract for {pkg_name} {contract_url}{proxy_contract_id}"),
|
||||
);
|
||||
|
||||
let proxy_contract_bech_id: Bech32ContractId = proxy_contract_id.into();
|
||||
let instance = ProxyContract::new(&proxy_contract_bech_id, account.clone());
|
||||
let instance = ProxyContract::new(proxy_contract_id, account.clone());
|
||||
instance.methods().initialize_proxy().call().await?;
|
||||
println_action_green("Initialized", &format!("proxy contract for {pkg_name}"));
|
||||
Ok(proxy_contract_id)
|
||||
|
|
|
@ -16,7 +16,6 @@ use fuel_tx::{ContractId, Transaction};
|
|||
use fuels::{
|
||||
programs::calls::{traits::TransactionTuner, ScriptCall},
|
||||
types::{
|
||||
bech32::Bech32ContractId,
|
||||
transaction::TxPolicies,
|
||||
transaction_builders::{BuildableTransaction, VariableOutputPolicy},
|
||||
},
|
||||
|
@ -132,7 +131,7 @@ pub async fn run_pkg(
|
|||
}
|
||||
};
|
||||
|
||||
let contract_ids = command
|
||||
let external_contracts = command
|
||||
.contract
|
||||
.as_ref()
|
||||
.into_iter()
|
||||
|
@ -144,10 +143,6 @@ pub async fn run_pkg(
|
|||
.collect::<Result<Vec<ContractId>>>()?;
|
||||
|
||||
let script_binary = compiled.bytecode.bytes.clone();
|
||||
let external_contracts = contract_ids
|
||||
.into_iter()
|
||||
.map(Bech32ContractId::from)
|
||||
.collect::<Vec<_>>();
|
||||
let call = ScriptCall {
|
||||
script_binary,
|
||||
encoded_args: Ok(script_data),
|
||||
|
|
|
@ -36,7 +36,7 @@ impl Account for ForcClientAccount {
|
|||
|
||||
#[async_trait]
|
||||
impl ViewOnlyAccount for ForcClientAccount {
|
||||
fn address(&self) -> &Bech32Address {
|
||||
fn address(&self) -> Address {
|
||||
match self {
|
||||
ForcClientAccount::Wallet(wallet) => wallet.address(),
|
||||
ForcClientAccount::KmsSigner(account) => {
|
||||
|
@ -82,7 +82,7 @@ impl Signer for ForcClientAccount {
|
|||
}
|
||||
}
|
||||
|
||||
fn address(&self) -> &Bech32Address {
|
||||
fn address(&self) -> Address {
|
||||
match self {
|
||||
ForcClientAccount::Wallet(wallet) => wallet.address(),
|
||||
ForcClientAccount::KmsSigner(account) => fuels_core::traits::Signer::address(account),
|
||||
|
|
|
@ -7,7 +7,6 @@ use aws_sdk_kms::types::{MessageType, SigningAlgorithmSpec};
|
|||
use aws_sdk_kms::{config::BehaviorVersion, Client};
|
||||
use fuel_crypto::Message;
|
||||
use fuels::prelude::*;
|
||||
use fuels::types::bech32::{Bech32Address, FUEL_BECH32_HRP};
|
||||
use fuels::types::coin_type_id::CoinTypeId;
|
||||
use fuels::types::input::Input;
|
||||
use fuels_accounts::provider::Provider;
|
||||
|
@ -91,7 +90,7 @@ impl AwsClient {
|
|||
pub struct AwsSigner {
|
||||
kms: AwsClient,
|
||||
key_id: String,
|
||||
bech: Bech32Address,
|
||||
address: Address,
|
||||
public_key_bytes: Vec<u8>,
|
||||
provider: Provider,
|
||||
}
|
||||
|
@ -194,11 +193,11 @@ impl AwsSigner {
|
|||
|
||||
let public_key = fuel_crypto::PublicKey::from(k256_public_key);
|
||||
let hashed = public_key.hash();
|
||||
let bech = Bech32Address::new(FUEL_BECH32_HRP, hashed);
|
||||
let address = Address::from(*hashed);
|
||||
Ok(Self {
|
||||
kms,
|
||||
key_id,
|
||||
bech,
|
||||
address,
|
||||
public_key_bytes,
|
||||
provider,
|
||||
})
|
||||
|
@ -236,15 +235,15 @@ impl Signer for AwsSigner {
|
|||
Ok(sig)
|
||||
}
|
||||
|
||||
fn address(&self) -> &Bech32Address {
|
||||
&self.bech
|
||||
fn address(&self) -> Address {
|
||||
self.address
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl ViewOnlyAccount for AwsSigner {
|
||||
fn address(&self) -> &Bech32Address {
|
||||
&self.bech
|
||||
fn address(&self) -> Address {
|
||||
self.address
|
||||
}
|
||||
|
||||
fn try_provider(&self) -> Result<&Provider> {
|
||||
|
|
|
@ -155,7 +155,7 @@ async fn collect_account_balances(
|
|||
) -> Result<AccountBalances> {
|
||||
let accounts: Vec<_> = accounts_map
|
||||
.values()
|
||||
.map(|addr| Wallet::new_locked((*addr).into(), provider.clone()))
|
||||
.map(|addr| Wallet::new_locked(*addr, provider.clone()))
|
||||
.collect();
|
||||
|
||||
futures::future::try_join_all(accounts.iter().map(|acc| acc.get_balances()))
|
||||
|
@ -324,24 +324,21 @@ pub async fn update_proxy_contract_target(
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use fuels::types::bech32::Bech32Address;
|
||||
use std::collections::{BTreeMap, HashMap};
|
||||
|
||||
#[test]
|
||||
fn test_format_base_asset_account_balances() {
|
||||
let mut accounts_map: AccountsMap = BTreeMap::new();
|
||||
|
||||
let address1: fuel_tx::Address = Bech32Address::from_str(
|
||||
"fuel1dved7k25uxadatl7l5kql309jnw07dcn4t3a6x9hm9nxyjcpqqns50p7n2",
|
||||
let address1 = fuel_tx::Address::from_str(
|
||||
"7bbd8a4ea06e94461b959ab18d35802bbac3cf47e2bf29195f7db2ce41630cd7",
|
||||
)
|
||||
.expect("address1")
|
||||
.into();
|
||||
.expect("address1");
|
||||
|
||||
let address2: fuel_tx::Address = Bech32Address::from_str(
|
||||
"fuel1x9f3ysyk7fmey5ac23s2p4rwg4gjye2kke3nu3pvrs5p4qc4m4qqwx56k3",
|
||||
let address2 = fuel_tx::Address::from_str(
|
||||
"99bd8a4ea06e94461b959ab18d35802bbac3cf47e2bf29195f7db2ce41630cd7",
|
||||
)
|
||||
.expect("address2")
|
||||
.into();
|
||||
.expect("address2");
|
||||
|
||||
let base_asset_id = AssetId::zeroed();
|
||||
|
||||
|
@ -359,9 +356,9 @@ mod tests {
|
|||
account_balances.push(balance2);
|
||||
|
||||
let address1_expected =
|
||||
"0x6B32DF5954e1BaDEAFFEFD2c0fc5E594dcff3713aaE3Dd18B7d966624B010027";
|
||||
"0x7bBD8a4ea06E94461b959aB18d35802BbAC3cf47e2bF29195F7db2CE41630CD7";
|
||||
let address2_expected =
|
||||
"0x3153124096f2779253B85460a0D46e4551226556b6633E442c1C281a8315dd40";
|
||||
"0x99Bd8a4eA06E94461b959AB18d35802bBaC3Cf47E2Bf29195f7DB2cE41630cD7";
|
||||
let expected = vec![
|
||||
format!("[0] {address1_expected} - 1.5 ETH"),
|
||||
format!("[1] {address2_expected} - 0 ETH"),
|
||||
|
|
|
@ -539,7 +539,7 @@ async fn test_proxy_contract_re_routes_call() {
|
|||
let res = impl_contract_a
|
||||
.methods()
|
||||
.test_function_read()
|
||||
.with_contract_ids(&[impl_contract_id.into()])
|
||||
.with_contract_ids(&[impl_contract_id])
|
||||
.call()
|
||||
.await
|
||||
.unwrap();
|
||||
|
@ -547,7 +547,7 @@ async fn test_proxy_contract_re_routes_call() {
|
|||
let res = impl_contract_a
|
||||
.methods()
|
||||
.test_function_write(8)
|
||||
.with_contract_ids(&[impl_contract_id.into()])
|
||||
.with_contract_ids(&[impl_contract_id])
|
||||
.call()
|
||||
.await
|
||||
.unwrap();
|
||||
|
@ -556,7 +556,7 @@ async fn test_proxy_contract_re_routes_call() {
|
|||
let res = impl_contract_a
|
||||
.methods()
|
||||
.test_function()
|
||||
.with_contract_ids(&[impl_contract_id.into()])
|
||||
.with_contract_ids(&[impl_contract_id])
|
||||
.call()
|
||||
.await
|
||||
.unwrap();
|
||||
|
@ -594,7 +594,7 @@ async fn test_proxy_contract_re_routes_call() {
|
|||
let res = impl_contract_a
|
||||
.methods()
|
||||
.test_function_read()
|
||||
.with_contract_ids(&[impl_contract_id_after_update.into()])
|
||||
.with_contract_ids(&[impl_contract_id_after_update])
|
||||
.call()
|
||||
.await
|
||||
.unwrap();
|
||||
|
@ -603,7 +603,7 @@ async fn test_proxy_contract_re_routes_call() {
|
|||
let res = impl_contract_a
|
||||
.methods()
|
||||
.test_function_write(9)
|
||||
.with_contract_ids(&[impl_contract_id_after_update.into()])
|
||||
.with_contract_ids(&[impl_contract_id_after_update])
|
||||
.call()
|
||||
.await
|
||||
.unwrap();
|
||||
|
@ -612,7 +612,7 @@ async fn test_proxy_contract_re_routes_call() {
|
|||
let res = impl_contract_a
|
||||
.methods()
|
||||
.test_function()
|
||||
.with_contract_ids(&[impl_contract_id_after_update.into()])
|
||||
.with_contract_ids(&[impl_contract_id_after_update])
|
||||
.call()
|
||||
.await
|
||||
.unwrap();
|
||||
|
@ -957,7 +957,7 @@ async fn deploy_script_calls() {
|
|||
let contract_id_bits256 = Bits256(contract.id.into());
|
||||
let call_handler = instance
|
||||
.main(10, contract_id_bits256)
|
||||
.with_contract_ids(&[contract_id.into()])
|
||||
.with_contract_ids(&[contract_id])
|
||||
.call()
|
||||
.await
|
||||
.unwrap();
|
||||
|
@ -1180,7 +1180,7 @@ async fn call_with_sdk_generated_overrides(node_url: &str, contract_id: Contract
|
|||
"{:?}",
|
||||
loader_from_sdk
|
||||
.main(10, contract_ids_bits256)
|
||||
.with_contract_ids(&[contract_id.into()])
|
||||
.with_contract_ids(&[contract_id])
|
||||
.call()
|
||||
.await
|
||||
.unwrap()
|
||||
|
@ -1275,7 +1275,7 @@ async fn call_with_forc_generated_overrides(node_url: &str, contract_id: Contrac
|
|||
"{:?}",
|
||||
forc_generated_script_with_configs
|
||||
.main(10, contract_ids_bits256)
|
||||
.with_contract_ids(&[contract_id.into()])
|
||||
.with_contract_ids(&[contract_id])
|
||||
.call()
|
||||
.await
|
||||
.unwrap()
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
use anyhow::anyhow;
|
||||
use fuel_crypto::fuel_types::Address;
|
||||
use fuels_core::types::bech32::Bech32Address;
|
||||
use serde_json::json;
|
||||
use std::str::{from_utf8, FromStr};
|
||||
|
||||
|
@ -17,8 +16,7 @@ forc_util::cli_examples! {
|
|||
after_help = help(),
|
||||
)]
|
||||
pub struct Args {
|
||||
/// The address to convert. It can be either a valid address in any format
|
||||
/// (Bech32 or hex)
|
||||
/// The address to convert. It can be either a valid address in hex format
|
||||
pub address: String,
|
||||
}
|
||||
|
||||
|
@ -27,27 +25,17 @@ pub struct Args {
|
|||
/// address format to all other formats
|
||||
pub fn dump_address<T: AsRef<[u8]>>(data: T) -> anyhow::Result<serde_json::Value> {
|
||||
let bytes_32: Result<[u8; 32], _> = data.as_ref().try_into();
|
||||
let (bech32, addr) = match bytes_32 {
|
||||
Ok(bytes) => (
|
||||
Bech32Address::from(Address::from(bytes)),
|
||||
Address::from(bytes),
|
||||
),
|
||||
let addr = match bytes_32 {
|
||||
Ok(bytes) => Address::from(bytes),
|
||||
Err(_) => handle_string_conversion(data)?,
|
||||
};
|
||||
|
||||
Ok(json!({
|
||||
"Bench32": bech32.to_string(),
|
||||
"Address": addr.to_string(),
|
||||
}))
|
||||
}
|
||||
|
||||
fn handle_string_conversion<T: AsRef<[u8]>>(data: T) -> anyhow::Result<(Bech32Address, Address)> {
|
||||
fn handle_string_conversion<T: AsRef<[u8]>>(data: T) -> anyhow::Result<Address> {
|
||||
let addr = from_utf8(data.as_ref())?;
|
||||
if let Ok(bech32) = Bech32Address::from_str(addr) {
|
||||
Ok((bech32.clone(), Address::from(bech32)))
|
||||
} else if let Ok(addr) = Address::from_str(addr) {
|
||||
Ok((Bech32Address::from(addr), addr))
|
||||
} else {
|
||||
Err(anyhow!("{} cannot be parsed to a valid address", addr))
|
||||
}
|
||||
Address::from_str(addr).map_err(|_| anyhow!("{} cannot be parsed to a valid address", addr))
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
use crate::args::read_content_filepath_or_stdin;
|
||||
use anyhow::Result;
|
||||
use fuel_crypto::{fuel_types::Address, Message, Signature};
|
||||
use fuels_core::types::bech32::Bech32Address;
|
||||
use serde_json::json;
|
||||
|
||||
forc_util::cli_examples! {
|
||||
|
@ -33,12 +32,10 @@ pub fn handler(arg: Arg) -> Result<serde_json::Value> {
|
|||
|
||||
let bytes = *public_key.hash();
|
||||
|
||||
let bech32 = Bech32Address::from(Address::from(bytes));
|
||||
let addr = Address::from(bytes);
|
||||
|
||||
Ok(json!({
|
||||
"PublicKey": public_key.to_string(),
|
||||
"Bech32": bech32.to_string(),
|
||||
"Address": addr.to_string(),
|
||||
}))
|
||||
}
|
||||
|
@ -57,10 +54,10 @@ mod test {
|
|||
};
|
||||
let json = handler(arg).unwrap();
|
||||
assert_eq!(
|
||||
"fuel1fmmfhjapeak3knq96arrvttwrtmzghe0w9gx79gkcl2jhaweakdqfqhzdr",
|
||||
"4ef69bcba1cf6d1b4c05d746362d6e1af6245f2f71506f1516c7d52bf5d9ed9a",
|
||||
json.as_object()
|
||||
.unwrap()
|
||||
.get("Bech32")
|
||||
.get("Address")
|
||||
.unwrap()
|
||||
.as_str()
|
||||
.unwrap(),
|
||||
|
|
|
@ -2,10 +2,7 @@ use fuel_crypto::{fuel_types::Address, PublicKey, SecretKey};
|
|||
use fuels_accounts::signers::{
|
||||
derivation::DEFAULT_DERIVATION_PATH, private_key::generate_mnemonic_phrase,
|
||||
};
|
||||
use fuels_core::types::{
|
||||
bech32::{Bech32Address, FUEL_BECH32_HRP},
|
||||
checksum_address::checksum_encode,
|
||||
};
|
||||
use fuels_core::types::checksum_address::checksum_encode;
|
||||
use rayon::iter::{self, Either, ParallelIterator};
|
||||
use regex::Regex;
|
||||
use serde_json::json;
|
||||
|
@ -282,9 +279,9 @@ fn generate_wallet(use_mnemonic: bool) -> anyhow::Result<(Address, SecretKey, Op
|
|||
|
||||
let public = PublicKey::from(&private_key);
|
||||
let hashed = public.hash();
|
||||
let address = Bech32Address::new(FUEL_BECH32_HRP, hashed);
|
||||
let address = Address::from(*hashed);
|
||||
|
||||
Ok((address.into(), private_key, mnemonic))
|
||||
Ok((address, private_key, mnemonic))
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
|
@ -23,4 +23,4 @@ sway-core.workspace = true
|
|||
sway-error.workspace = true
|
||||
sway-features.workspace = true
|
||||
sway-types.workspace = true
|
||||
swayfmt.workspace = true
|
||||
swayfmt.workspace = true
|
||||
|
|
|
@ -8,6 +8,13 @@ homepage.workspace = true
|
|||
license.workspace = true
|
||||
repository.workspace = true
|
||||
|
||||
[lib]
|
||||
path = "src/lib.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "forc-node"
|
||||
path = "src/main.rs"
|
||||
|
||||
[dependencies]
|
||||
anyhow.workspace = true
|
||||
clap = { workspace = true, features = ["derive", "string"] }
|
||||
|
@ -31,10 +38,3 @@ serde_json.workspace = true
|
|||
tempfile.workspace = true
|
||||
tokio = { workspace = true, features = ["full"] }
|
||||
wiremock.workspace = true
|
||||
|
||||
[lib]
|
||||
path = "src/lib.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "forc-node"
|
||||
path = "src/main.rs"
|
||||
|
|
|
@ -61,14 +61,14 @@ impl TestExecutor {
|
|||
|
||||
// Prepare the transaction metadata.
|
||||
let secret_key = SecretKey::random(rng);
|
||||
let utxo_id = rng.gen();
|
||||
let utxo_id = rng.r#gen();
|
||||
let amount = 1;
|
||||
let maturity = 1.into();
|
||||
// NOTE: fuel-core is using dynamic asset id and interacting with the fuel-core, using static
|
||||
// asset id is not correct. But since forc-test maintains its own interpreter instance, correct
|
||||
// base asset id is indeed the static `tx::AssetId::BASE`.
|
||||
let asset_id = tx::AssetId::BASE;
|
||||
let tx_pointer = rng.gen();
|
||||
let tx_pointer = rng.r#gen();
|
||||
let block_height = (u32::MAX >> 1).into();
|
||||
let gas_price = 0;
|
||||
|
||||
|
|
|
@ -661,14 +661,14 @@ fn deployment_transaction(
|
|||
|
||||
// Prepare the transaction metadata.
|
||||
let secret_key = SecretKey::random(rng);
|
||||
let utxo_id = rng.gen();
|
||||
let utxo_id = rng.r#gen();
|
||||
let amount = 1;
|
||||
let maturity = 1u32.into();
|
||||
// NOTE: fuel-core is using dynamic asset id and interacting with the fuel-core, using static
|
||||
// asset id is not correct. But since forc-test maintains its own interpreter instance, correct
|
||||
// base asset id is indeed the static `tx::AssetId::BASE`.
|
||||
let asset_id = tx::AssetId::BASE;
|
||||
let tx_pointer = rng.gen();
|
||||
let tx_pointer = rng.r#gen();
|
||||
let block_height = (u32::MAX >> 1).into();
|
||||
|
||||
let tx = tx::TransactionBuilder::create(bytecode.as_slice().into(), salt, storage_slots)
|
||||
|
|
|
@ -8,6 +8,9 @@ homepage.workspace = true
|
|||
license.workspace = true
|
||||
repository.workspace = true
|
||||
|
||||
[features]
|
||||
tx = ["dep:fuel-tx", "dep:fuel-abi-types", "dep:fuels-core"]
|
||||
|
||||
[dependencies]
|
||||
annotate-snippets.workspace = true
|
||||
ansiterm.workspace = true
|
||||
|
@ -40,6 +43,3 @@ unicode-xid.workspace = true
|
|||
|
||||
[dev-dependencies]
|
||||
mark-flaky-tests.workspace = true
|
||||
|
||||
[features]
|
||||
tx = ["dep:fuel-tx", "dep:fuel-abi-types", "dep:fuels-core"]
|
||||
|
|
|
@ -16,6 +16,12 @@ path = "src/lib.rs"
|
|||
name = "forc"
|
||||
path = "src/main.rs"
|
||||
|
||||
[features]
|
||||
default = []
|
||||
test = []
|
||||
util = []
|
||||
profile = []
|
||||
|
||||
[dependencies]
|
||||
annotate-snippets.workspace = true
|
||||
ansiterm.workspace = true
|
||||
|
@ -48,12 +54,6 @@ url.workspace = true
|
|||
walkdir.workspace = true
|
||||
whoami.workspace = true
|
||||
|
||||
[features]
|
||||
default = []
|
||||
test = []
|
||||
util = []
|
||||
profile = []
|
||||
|
||||
[dev-dependencies]
|
||||
completest-pty.workspace = true
|
||||
rexpect.workspace = true
|
||||
|
|
|
@ -4,14 +4,14 @@ version = "0.0.0"
|
|||
edition = "2021"
|
||||
publish = false
|
||||
|
||||
[[bin]]
|
||||
name = "mdbook-forc-documenter"
|
||||
path = "src/bin/mdbook-forc-documenter.rs"
|
||||
|
||||
[lib]
|
||||
name = "mdbook_forc_documenter"
|
||||
path = "src/lib.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "mdbook-forc-documenter"
|
||||
path = "src/bin/mdbook-forc-documenter.rs"
|
||||
|
||||
[dependencies]
|
||||
anyhow.workspace = true
|
||||
clap = { workspace = true, features = ["derive"] }
|
||||
|
|
|
@ -8,6 +8,9 @@ homepage.workspace = true
|
|||
license.workspace = true
|
||||
repository.workspace = true
|
||||
|
||||
[target.'cfg(not(target_os = "macos"))'.dependencies]
|
||||
sysinfo.workspace = true
|
||||
|
||||
[dependencies]
|
||||
clap = { workspace = true, features = ["derive"] }
|
||||
dirs.workspace = true
|
||||
|
@ -49,8 +52,5 @@ tracing.workspace = true
|
|||
uint.workspace = true
|
||||
vec1.workspace = true
|
||||
|
||||
[target.'cfg(not(target_os = "macos"))'.dependencies]
|
||||
sysinfo.workspace = true
|
||||
|
||||
[lints.clippy]
|
||||
iter_over_hash_type = "deny"
|
||||
|
|
|
@ -539,9 +539,11 @@ fn print_instruction(op: &Instruction) {
|
|||
Instruction::K256(x) => f("K256", x.unpack()),
|
||||
Instruction::S256(x) => f("S256", x.unpack()),
|
||||
Instruction::TIME(x) => f("TIME", x.unpack()),
|
||||
Instruction::NIOP(x) => f("NIOP", x.unpack()),
|
||||
Instruction::NOOP(_) => f("NOOP", ()),
|
||||
Instruction::FLAG(x) => f("FLAG", x.unpack()),
|
||||
Instruction::BAL(x) => f("BAL", x.unpack()),
|
||||
Instruction::JAL(x) => f("JAL", x.unpack()),
|
||||
Instruction::JMP(x) => f("JMP", x.unpack()),
|
||||
Instruction::JNE(x) => f("JNE", x.unpack()),
|
||||
Instruction::SMO(x) => f("SMO", x.unpack()),
|
||||
|
@ -558,8 +560,12 @@ fn print_instruction(op: &Instruction) {
|
|||
Instruction::XORI(x) => f("XORI", x.unpack()),
|
||||
Instruction::JNEI(x) => f("JNEI", x.unpack()),
|
||||
Instruction::LB(x) => f("LB", x.unpack()),
|
||||
Instruction::LQW(x) => f("LQW", x.unpack()),
|
||||
Instruction::LHW(x) => f("LHW", x.unpack()),
|
||||
Instruction::LW(x) => f("LW", x.unpack()),
|
||||
Instruction::SB(x) => f("SB", x.unpack()),
|
||||
Instruction::SQW(x) => f("SQW", x.unpack()),
|
||||
Instruction::SHW(x) => f("SHW", x.unpack()),
|
||||
Instruction::SW(x) => f("SW", x.unpack()),
|
||||
Instruction::MCPI(x) => f("MCPI", x.unpack()),
|
||||
Instruction::GTF(x) => f("GTF", x.unpack()),
|
||||
|
|
|
@ -8,6 +8,9 @@ homepage.workspace = true
|
|||
license.workspace = true
|
||||
repository.workspace = true
|
||||
|
||||
[features]
|
||||
default = []
|
||||
|
||||
[dependencies]
|
||||
either.workspace = true
|
||||
in_definite.workspace = true
|
||||
|
@ -17,8 +20,5 @@ strsim.workspace = true
|
|||
sway-types.workspace = true
|
||||
thiserror.workspace = true
|
||||
|
||||
[features]
|
||||
default = []
|
||||
|
||||
[lints.clippy]
|
||||
iter_over_hash_type = "deny"
|
||||
|
|
|
@ -8,6 +8,9 @@ homepage.workspace = true
|
|||
license.workspace = true
|
||||
repository.workspace = true
|
||||
|
||||
[lib]
|
||||
bench = false
|
||||
|
||||
[dependencies]
|
||||
anyhow.workspace = true
|
||||
crossbeam-channel.workspace = true
|
||||
|
@ -69,8 +72,5 @@ tower = { workspace = true, default-features = false, features = ["util"] }
|
|||
name = "bench_main"
|
||||
harness = false
|
||||
|
||||
[lib]
|
||||
bench = false
|
||||
|
||||
[lints.clippy]
|
||||
iter_over_hash_type = "deny"
|
||||
|
|
|
@ -8,6 +8,9 @@ homepage.workspace = true
|
|||
license.workspace = true
|
||||
repository.workspace = true
|
||||
|
||||
[features]
|
||||
no-span-debug = []
|
||||
|
||||
[dependencies]
|
||||
fuel-asm.workspace = true
|
||||
fuel-crypto.workspace = true
|
||||
|
@ -23,8 +26,5 @@ sway-utils.workspace = true
|
|||
thiserror.workspace = true
|
||||
toml.workspace = true
|
||||
|
||||
[features]
|
||||
no-span-debug = []
|
||||
|
||||
[lints.clippy]
|
||||
iter_over_hash_type = "deny"
|
||||
|
|
|
@ -178,10 +178,10 @@ pub(crate) fn runs_in_vm(
|
|||
tb.with_params(params)
|
||||
.add_unsigned_coin_input(
|
||||
SecretKey::random(rng),
|
||||
rng.gen(),
|
||||
rng.r#gen(),
|
||||
1,
|
||||
Default::default(),
|
||||
rng.gen(),
|
||||
rng.r#gen(),
|
||||
)
|
||||
.maturity(maturity);
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
---
|
||||
source: test/src/snapshot/mod.rs
|
||||
assertion_line: 162
|
||||
---
|
||||
> forc test --path test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panicking_contract --release --experimental error_type --test-threads 1 --logs --reverts
|
||||
exit status: 0
|
||||
|
@ -14,73 +13,73 @@ output:
|
|||
|
||||
tested -- panicking_contract
|
||||
|
||||
test test_directly_panicking_method ... ok (???, 1677 gas)
|
||||
test test_directly_panicking_method ... ok (???, 1637 gas)
|
||||
revert code: ffffffff00000000
|
||||
├─ panic message: Error C.
|
||||
├─ panic value: C(true)
|
||||
└─ panicked in: panicking_contract@1.2.3, src/main.sw:22:9
|
||||
decoded log values:
|
||||
C(true), log rb: 5503570629422409978
|
||||
test test_nested_panic_inlined ... ok (???, 3036 gas)
|
||||
test test_nested_panic_inlined ... ok (???, 2996 gas)
|
||||
revert code: ffffffff00000005
|
||||
├─ panic message: Error E.
|
||||
├─ panic value: E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }])
|
||||
└─ panicked in: panicking_lib, src/lib.sw:41:9
|
||||
decoded log values:
|
||||
E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }]), log rb: 5503570629422409978
|
||||
test test_nested_panic_inlined_same_revert_code ... ok (???, 3036 gas)
|
||||
test test_nested_panic_inlined_same_revert_code ... ok (???, 2996 gas)
|
||||
revert code: ffffffff00000005
|
||||
├─ panic message: Error E.
|
||||
├─ panic value: E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }])
|
||||
└─ panicked in: panicking_lib, src/lib.sw:41:9
|
||||
decoded log values:
|
||||
E([AsciiString { data: "this" }, AsciiString { data: "is not" }, AsciiString { data: "the best practice" }]), log rb: 5503570629422409978
|
||||
test test_nested_panic_not_inlined ... ok (???, 3241 gas)
|
||||
test test_nested_panic_not_inlined ... ok (???, 3201 gas)
|
||||
revert code: ffffffff00000006
|
||||
├─ panic message: Error E.
|
||||
├─ panic value: E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }])
|
||||
└─ panicked in: panicking_lib, src/lib.sw:35:5
|
||||
decoded log values:
|
||||
E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }]), log rb: 5503570629422409978
|
||||
test test_nested_panic_not_inlined_same_revert_code ... ok (???, 3241 gas)
|
||||
test test_nested_panic_not_inlined_same_revert_code ... ok (???, 3201 gas)
|
||||
revert code: ffffffff00000006
|
||||
├─ panic message: Error E.
|
||||
├─ panic value: E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }])
|
||||
└─ panicked in: panicking_lib, src/lib.sw:35:5
|
||||
decoded log values:
|
||||
E([AsciiString { data: "to have" }, AsciiString { data: "strings" }, AsciiString { data: "in error enum variants" }]), log rb: 5503570629422409978
|
||||
test test_generic_panic_with_unit ... ok (???, 2141 gas)
|
||||
test test_generic_panic_with_unit ... ok (???, 2101 gas)
|
||||
revert code: ffffffff00000004
|
||||
├─ panic value: ()
|
||||
└─ panicked in: panicking_lib, src/lib.sw:74:5
|
||||
decoded log values:
|
||||
(), log rb: 3330666440490685604
|
||||
test test_generic_panic_with_unit_same_revert_code ... ok (???, 2141 gas)
|
||||
test test_generic_panic_with_unit_same_revert_code ... ok (???, 2101 gas)
|
||||
revert code: ffffffff00000004
|
||||
├─ panic value: ()
|
||||
└─ panicked in: panicking_lib, src/lib.sw:74:5
|
||||
decoded log values:
|
||||
(), log rb: 3330666440490685604
|
||||
test test_generic_panic_with_str ... ok (???, 2157 gas)
|
||||
test test_generic_panic_with_str ... ok (???, 2117 gas)
|
||||
revert code: ffffffff00000002
|
||||
├─ panic message: generic panic with string
|
||||
└─ panicked in: panicking_lib, src/lib.sw:74:5
|
||||
decoded log values:
|
||||
AsciiString { data: "generic panic with string" }, log rb: 10098701174489624218
|
||||
test test_generic_panic_with_different_str_same_revert_code ... ok (???, 1815 gas)
|
||||
test test_generic_panic_with_different_str_same_revert_code ... ok (???, 1775 gas)
|
||||
revert code: ffffffff00000002
|
||||
├─ panic message: generic panic with different string
|
||||
└─ panicked in: panicking_lib, src/lib.sw:74:5
|
||||
decoded log values:
|
||||
AsciiString { data: "generic panic with different string" }, log rb: 10098701174489624218
|
||||
test test_generic_panic_with_error_type_enum ... ok (???, 1951 gas)
|
||||
test test_generic_panic_with_error_type_enum ... ok (???, 1911 gas)
|
||||
revert code: ffffffff00000003
|
||||
├─ panic message: Error A.
|
||||
├─ panic value: A
|
||||
└─ panicked in: panicking_lib, src/lib.sw:74:5
|
||||
decoded log values:
|
||||
A, log rb: 5503570629422409978
|
||||
test test_generic_panic_with_error_type_enum_different_variant_same_revert_code ... ok (???, 2124 gas)
|
||||
test test_generic_panic_with_error_type_enum_different_variant_same_revert_code ... ok (???, 2084 gas)
|
||||
revert code: ffffffff00000003
|
||||
├─ panic message: Error B.
|
||||
├─ panic value: B(42)
|
||||
|
|
2751
test/src/sdk-harness/Cargo.lock
generated
2751
test/src/sdk-harness/Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
authors = ["Fuel Labs <contact@fuel.sh>"]
|
||||
edition = "2021"
|
||||
edition = "2024"
|
||||
license = "Apache-2.0"
|
||||
name = "tests"
|
||||
version = "0.0.0"
|
||||
|
@ -10,15 +10,15 @@ publish = false
|
|||
assert_matches = "1.5"
|
||||
|
||||
# Dependencies from the `fuel-core` repository:
|
||||
fuel-core = { version = "0.43", default-features = false }
|
||||
fuel-core = { version = "0.44", default-features = false }
|
||||
# Using full semver as the workspace Cargo.toml (see the comment there)
|
||||
fuel-core-client = { version = "0.43.2", default-features = false }
|
||||
fuel-core-client = { version = "0.44.0", default-features = false }
|
||||
|
||||
# Dependencies from the `fuel-vm` repository:
|
||||
fuel-vm = { version = "0.60", features = ["random"] }
|
||||
fuel-vm = { version = "0.62", features = ["random"] }
|
||||
|
||||
# Dependencies from the `fuels-rs` repository:
|
||||
fuels = { version = "0.72", features = ["fuel-core-lib"] }
|
||||
fuels = { version = "0.74", features = ["fuel-core-lib"] }
|
||||
|
||||
hex = "0.4"
|
||||
paste = "1.0"
|
||||
|
|
|
@ -35,7 +35,7 @@ async fn get_instance(wallet: Wallet) -> (TestAssetId<Wallet>, ContractId) {
|
|||
.contract_id;
|
||||
|
||||
wallet
|
||||
.force_transfer_to_contract(&fuelcontract_id, 1000, AssetId::BASE, TxPolicies::default())
|
||||
.force_transfer_to_contract(fuelcontract_id, 1000, AssetId::BASE, TxPolicies::default())
|
||||
.await
|
||||
.unwrap();
|
||||
let fuelcontract_instance = TestAssetId::new(fuelcontract_id.clone(), wallet);
|
||||
|
|
|
@ -512,7 +512,7 @@ async fn get_fuelcoin_instance(wallet: Wallet) -> (TestFuelCoinContract<Wallet>,
|
|||
.contract_id;
|
||||
|
||||
wallet
|
||||
.force_transfer_to_contract(&fuelcontract_id, 1000, AssetId::BASE, TxPolicies::default())
|
||||
.force_transfer_to_contract(fuelcontract_id, 1000, AssetId::BASE, TxPolicies::default())
|
||||
.await
|
||||
.unwrap();
|
||||
let fuelcontract_instance = TestFuelCoinContract::new(fuelcontract_id.clone(), wallet);
|
||||
|
|
|
@ -3,7 +3,7 @@ use fuels::{
|
|||
prelude::*,
|
||||
tx::UtxoId,
|
||||
types::{
|
||||
coin::{Coin, CoinStatus},
|
||||
coin::{Coin},
|
||||
coin_type::CoinType,
|
||||
input::Input,
|
||||
message::{Message, MessageStatus},
|
||||
|
@ -80,10 +80,7 @@ async fn input_message_msg_sender_from_contract() {
|
|||
let total_coins = [coins, coins_2].concat();
|
||||
|
||||
let msg = setup_single_message(
|
||||
&Bech32Address {
|
||||
hrp: "".to_string(),
|
||||
hash: Default::default(),
|
||||
},
|
||||
Address::default(),
|
||||
wallet_signer.address(),
|
||||
DEFAULT_COIN_AMOUNT,
|
||||
10.into(),
|
||||
|
@ -150,8 +147,8 @@ async fn caller_addresses_from_messages() {
|
|||
// Setup message
|
||||
let message_amount = 10;
|
||||
let message1 = Message {
|
||||
sender: signer_1.address().clone(),
|
||||
recipient: signer_1.address().clone(),
|
||||
sender: signer_1.address(),
|
||||
recipient: signer_1.address(),
|
||||
nonce: 0.into(),
|
||||
amount: message_amount,
|
||||
data: vec![],
|
||||
|
@ -159,8 +156,8 @@ async fn caller_addresses_from_messages() {
|
|||
status: MessageStatus::Unspent,
|
||||
};
|
||||
let message2 = Message {
|
||||
sender: signer_2.address().clone(),
|
||||
recipient: signer_2.address().clone(),
|
||||
sender: signer_2.address(),
|
||||
recipient: signer_2.address(),
|
||||
nonce: 1.into(),
|
||||
amount: message_amount,
|
||||
data: vec![],
|
||||
|
@ -168,8 +165,8 @@ async fn caller_addresses_from_messages() {
|
|||
status: MessageStatus::Unspent,
|
||||
};
|
||||
let message3 = Message {
|
||||
sender: signer_3.address().clone(),
|
||||
recipient: signer_3.address().clone(),
|
||||
sender: signer_3.address(),
|
||||
recipient: signer_3.address(),
|
||||
nonce: 2.into(),
|
||||
amount: message_amount,
|
||||
data: vec![],
|
||||
|
@ -184,12 +181,10 @@ async fn caller_addresses_from_messages() {
|
|||
// Setup Coin
|
||||
let coin_amount = 10;
|
||||
let coin = Coin {
|
||||
owner: signer_4.address().clone(),
|
||||
owner: signer_4.address(),
|
||||
utxo_id: UtxoId::new(Bytes32::zeroed(), 0),
|
||||
amount: coin_amount,
|
||||
asset_id: AssetId::default(),
|
||||
status: CoinStatus::Unspent,
|
||||
block_created: Default::default(),
|
||||
};
|
||||
|
||||
let mut node_config = NodeConfig::default();
|
||||
|
@ -221,7 +216,7 @@ async fn caller_addresses_from_messages() {
|
|||
.await
|
||||
.unwrap();
|
||||
|
||||
assert_eq!(result.value, vec![Address::from(*wallet4.address().hash())]);
|
||||
assert_eq!(result.value, vec![Address::from(*wallet4.address())]);
|
||||
|
||||
// Start building transactions
|
||||
let call_handler = auth_instance.methods().returns_caller_addresses();
|
||||
|
@ -230,8 +225,8 @@ async fn caller_addresses_from_messages() {
|
|||
// Inputs
|
||||
tb.inputs_mut().push(Input::ResourceSigned {
|
||||
resource: CoinType::Message(setup_single_message(
|
||||
&wallet1.address().clone(),
|
||||
&wallet1.address().clone(),
|
||||
wallet1.address(),
|
||||
wallet1.address(),
|
||||
message_amount,
|
||||
0.into(),
|
||||
vec![],
|
||||
|
@ -239,8 +234,8 @@ async fn caller_addresses_from_messages() {
|
|||
});
|
||||
tb.inputs_mut().push(Input::ResourceSigned {
|
||||
resource: CoinType::Message(setup_single_message(
|
||||
&wallet2.address().clone(),
|
||||
&wallet2.address().clone(),
|
||||
wallet2.address(),
|
||||
wallet2.address(),
|
||||
message_amount,
|
||||
1.into(),
|
||||
vec![],
|
||||
|
@ -248,8 +243,8 @@ async fn caller_addresses_from_messages() {
|
|||
});
|
||||
tb.inputs_mut().push(Input::ResourceSigned {
|
||||
resource: CoinType::Message(setup_single_message(
|
||||
&wallet3.address().clone(),
|
||||
&wallet3.address().clone(),
|
||||
wallet3.address(),
|
||||
wallet3.address(),
|
||||
message_amount,
|
||||
2.into(),
|
||||
vec![],
|
||||
|
@ -270,13 +265,13 @@ async fn caller_addresses_from_messages() {
|
|||
|
||||
assert!(result
|
||||
.value
|
||||
.contains(&Address::from(wallet1.address().clone())));
|
||||
.contains(&Address::from(wallet1.address())));
|
||||
assert!(result
|
||||
.value
|
||||
.contains(&Address::from(wallet2.address().clone())));
|
||||
.contains(&Address::from(wallet2.address())));
|
||||
assert!(result
|
||||
.value
|
||||
.contains(&Address::from(wallet3.address().clone())));
|
||||
.contains(&Address::from(wallet3.address())));
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
|
@ -289,36 +284,28 @@ async fn caller_addresses_from_coins() {
|
|||
// Setup Coin
|
||||
let coin_amount = 10;
|
||||
let coin1 = Coin {
|
||||
owner: signer_1.address().clone(),
|
||||
owner: signer_1.address(),
|
||||
utxo_id: UtxoId::new(Bytes32::zeroed(), 0),
|
||||
amount: coin_amount,
|
||||
asset_id: AssetId::default(),
|
||||
status: CoinStatus::Unspent,
|
||||
block_created: Default::default(),
|
||||
};
|
||||
let coin2 = Coin {
|
||||
owner: signer_2.address().clone(),
|
||||
owner: signer_2.address(),
|
||||
utxo_id: UtxoId::new(Bytes32::zeroed(), 1),
|
||||
amount: coin_amount,
|
||||
asset_id: AssetId::default(),
|
||||
status: CoinStatus::Unspent,
|
||||
block_created: Default::default(),
|
||||
};
|
||||
let coin3 = Coin {
|
||||
owner: signer_3.address().clone(),
|
||||
owner: signer_3.address(),
|
||||
utxo_id: UtxoId::new(Bytes32::zeroed(), 2),
|
||||
amount: coin_amount,
|
||||
asset_id: AssetId::default(),
|
||||
status: CoinStatus::Unspent,
|
||||
block_created: Default::default(),
|
||||
};
|
||||
let coin4 = Coin {
|
||||
owner: signer_4.address().clone(),
|
||||
owner: signer_4.address(),
|
||||
utxo_id: UtxoId::new(Bytes32::zeroed(), 3),
|
||||
amount: coin_amount,
|
||||
asset_id: AssetId::default(),
|
||||
status: CoinStatus::Unspent,
|
||||
block_created: Default::default(),
|
||||
};
|
||||
|
||||
let mut coin_vec: Vec<Coin> = Vec::new();
|
||||
|
@ -356,7 +343,7 @@ async fn caller_addresses_from_coins() {
|
|||
.await
|
||||
.unwrap();
|
||||
|
||||
assert_eq!(result.value, vec![Address::from(*wallet4.address().hash())]);
|
||||
assert_eq!(result.value, vec![Address::from(*wallet4.address())]);
|
||||
|
||||
// Start building transactions
|
||||
let call_handler = auth_instance.methods().returns_caller_addresses();
|
||||
|
@ -365,33 +352,27 @@ async fn caller_addresses_from_coins() {
|
|||
// Inputs
|
||||
tb.inputs_mut().push(Input::ResourceSigned {
|
||||
resource: CoinType::Coin(Coin {
|
||||
owner: wallet1.address().clone(),
|
||||
owner: wallet1.address(),
|
||||
utxo_id: UtxoId::new(Bytes32::zeroed(), 0),
|
||||
amount: coin_amount,
|
||||
asset_id: AssetId::default(),
|
||||
status: CoinStatus::Unspent,
|
||||
block_created: Default::default(),
|
||||
}),
|
||||
}),
|
||||
});
|
||||
tb.inputs_mut().push(Input::ResourceSigned {
|
||||
resource: CoinType::Coin(Coin {
|
||||
owner: wallet2.address().clone(),
|
||||
owner: wallet2.address(),
|
||||
utxo_id: UtxoId::new(Bytes32::zeroed(), 1),
|
||||
amount: coin_amount,
|
||||
asset_id: AssetId::default(),
|
||||
status: CoinStatus::Unspent,
|
||||
block_created: Default::default(),
|
||||
}),
|
||||
}),
|
||||
});
|
||||
tb.inputs_mut().push(Input::ResourceSigned {
|
||||
resource: CoinType::Coin(Coin {
|
||||
owner: wallet3.address().clone(),
|
||||
owner: wallet3.address(),
|
||||
utxo_id: UtxoId::new(Bytes32::zeroed(), 2),
|
||||
amount: coin_amount,
|
||||
asset_id: AssetId::default(),
|
||||
status: CoinStatus::Unspent,
|
||||
block_created: Default::default(),
|
||||
}),
|
||||
}),
|
||||
});
|
||||
|
||||
// Build transaction
|
||||
|
@ -408,13 +389,13 @@ async fn caller_addresses_from_coins() {
|
|||
|
||||
assert!(result
|
||||
.value
|
||||
.contains(&Address::from(wallet1.address().clone())));
|
||||
.contains(&Address::from(wallet1.address())));
|
||||
assert!(result
|
||||
.value
|
||||
.contains(&Address::from(wallet2.address().clone())));
|
||||
.contains(&Address::from(wallet2.address())));
|
||||
assert!(result
|
||||
.value
|
||||
.contains(&Address::from(wallet3.address().clone())));
|
||||
.contains(&Address::from(wallet3.address())));
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
|
@ -426,8 +407,8 @@ async fn caller_addresses_from_coins_and_messages() {
|
|||
|
||||
let message_amount = 10;
|
||||
let message1 = Message {
|
||||
sender: signer_1.address().clone(),
|
||||
recipient: signer_1.address().clone(),
|
||||
sender: signer_1.address(),
|
||||
recipient: signer_1.address(),
|
||||
nonce: 0.into(),
|
||||
amount: message_amount,
|
||||
data: vec![],
|
||||
|
@ -438,28 +419,22 @@ async fn caller_addresses_from_coins_and_messages() {
|
|||
// Setup Coin
|
||||
let coin_amount = 10;
|
||||
let coin2 = Coin {
|
||||
owner: signer_2.address().clone(),
|
||||
owner: signer_2.address(),
|
||||
utxo_id: UtxoId::new(Bytes32::zeroed(), 1),
|
||||
amount: coin_amount,
|
||||
asset_id: AssetId::default(),
|
||||
status: CoinStatus::Unspent,
|
||||
block_created: Default::default(),
|
||||
};
|
||||
let coin3 = Coin {
|
||||
owner: signer_3.address().clone(),
|
||||
owner: signer_3.address(),
|
||||
utxo_id: UtxoId::new(Bytes32::zeroed(), 2),
|
||||
amount: coin_amount,
|
||||
asset_id: AssetId::default(),
|
||||
status: CoinStatus::Unspent,
|
||||
block_created: Default::default(),
|
||||
};
|
||||
let coin4 = Coin {
|
||||
owner: signer_4.address().clone(),
|
||||
owner: signer_4.address(),
|
||||
utxo_id: UtxoId::new(Bytes32::zeroed(), 3),
|
||||
amount: coin_amount,
|
||||
asset_id: AssetId::default(),
|
||||
status: CoinStatus::Unspent,
|
||||
block_created: Default::default(),
|
||||
};
|
||||
|
||||
let mut coin_vec: Vec<Coin> = Vec::new();
|
||||
|
@ -497,7 +472,7 @@ async fn caller_addresses_from_coins_and_messages() {
|
|||
.await
|
||||
.unwrap();
|
||||
|
||||
assert_eq!(result.value, vec![Address::from(*wallet4.address().hash())]);
|
||||
assert_eq!(result.value, vec![Address::from(*wallet4.address())]);
|
||||
|
||||
// Start building transactions
|
||||
let call_handler = auth_instance.methods().returns_caller_addresses();
|
||||
|
@ -506,8 +481,8 @@ async fn caller_addresses_from_coins_and_messages() {
|
|||
// Inputs
|
||||
tb.inputs_mut().push(Input::ResourceSigned {
|
||||
resource: CoinType::Message(setup_single_message(
|
||||
&wallet1.address().clone(),
|
||||
&wallet1.address().clone(),
|
||||
wallet1.address(),
|
||||
wallet1.address(),
|
||||
message_amount,
|
||||
0.into(),
|
||||
vec![],
|
||||
|
@ -515,23 +490,19 @@ async fn caller_addresses_from_coins_and_messages() {
|
|||
});
|
||||
tb.inputs_mut().push(Input::ResourceSigned {
|
||||
resource: CoinType::Coin(Coin {
|
||||
owner: wallet2.address().clone(),
|
||||
owner: wallet2.address(),
|
||||
utxo_id: UtxoId::new(Bytes32::zeroed(), 1),
|
||||
amount: coin_amount,
|
||||
asset_id: AssetId::default(),
|
||||
status: CoinStatus::Unspent,
|
||||
block_created: Default::default(),
|
||||
}),
|
||||
}),
|
||||
});
|
||||
tb.inputs_mut().push(Input::ResourceSigned {
|
||||
resource: CoinType::Coin(Coin {
|
||||
owner: wallet3.address().clone(),
|
||||
owner: wallet3.address(),
|
||||
utxo_id: UtxoId::new(Bytes32::zeroed(), 2),
|
||||
amount: coin_amount,
|
||||
asset_id: AssetId::default(),
|
||||
status: CoinStatus::Unspent,
|
||||
block_created: Default::default(),
|
||||
}),
|
||||
}),
|
||||
});
|
||||
|
||||
// Build transaction
|
||||
|
@ -548,13 +519,13 @@ async fn caller_addresses_from_coins_and_messages() {
|
|||
|
||||
assert!(result
|
||||
.value
|
||||
.contains(&Address::from(wallet1.address().clone())));
|
||||
.contains(&Address::from(wallet1.address())));
|
||||
assert!(result
|
||||
.value
|
||||
.contains(&Address::from(wallet2.address().clone())));
|
||||
.contains(&Address::from(wallet2.address())));
|
||||
assert!(result
|
||||
.value
|
||||
.contains(&Address::from(wallet3.address().clone())));
|
||||
.contains(&Address::from(wallet3.address())));
|
||||
}
|
||||
|
||||
async fn get_contracts() -> (
|
||||
|
@ -617,9 +588,8 @@ async fn can_get_predicate_address() {
|
|||
"0xa9e0330870e3ed1f537684021c02ad88d8116e91daff9651413169a77b26e509";
|
||||
let predicate_address =
|
||||
Address::from_str(hex_predicate_address).expect("failed to create Address from string");
|
||||
let predicate_bech32_address = Bech32Address::from(predicate_address);
|
||||
let predicate_data = AuthPredicateEncoder::default()
|
||||
.encode_data(predicate_bech32_address)
|
||||
.encode_data(predicate_address)
|
||||
.unwrap();
|
||||
let predicate: Predicate =
|
||||
Predicate::load_from("test_artifacts/auth_predicate/out/release/auth_predicate.bin")
|
||||
|
@ -629,7 +599,7 @@ async fn can_get_predicate_address() {
|
|||
|
||||
// If this test fails, it can be that the predicate address got changed.
|
||||
// Uncomment the next line, get the predicate address, and update it above.
|
||||
dbg!(&predicate);
|
||||
// dbg!(&predicate);
|
||||
|
||||
// Next, we lock some assets in this predicate using the first wallet:
|
||||
// First wallet transfers amount to predicate.
|
||||
|
@ -695,11 +665,11 @@ async fn when_incorrect_predicate_address_passed() {
|
|||
|
||||
// Setup predicate with incorrect address.
|
||||
let hex_predicate_address: &str =
|
||||
"0xf70528e17820e36c0868d25aac804f3e0750f90f0840d9e1d68a7e4e3c9290a8";
|
||||
"0xeddbd8cc2be5fb1d4ae24a5f789e61308750ff698865f311c9818d7eb76d4777";
|
||||
let predicate_address =
|
||||
Address::from_str(hex_predicate_address).expect("failed to create Address from string");
|
||||
let predicate_data = AuthPredicateEncoder::default()
|
||||
.encode_data(Bech32Address::from(predicate_address))
|
||||
.encode_data(predicate_address)
|
||||
.unwrap();
|
||||
let predicate: Predicate =
|
||||
Predicate::load_from("test_artifacts/auth_predicate/out/release/auth_predicate.bin")
|
||||
|
@ -743,13 +713,12 @@ async fn can_get_predicate_address_in_message() {
|
|||
"0xa9e0330870e3ed1f537684021c02ad88d8116e91daff9651413169a77b26e509";
|
||||
let predicate_address =
|
||||
Address::from_str(hex_predicate_address).expect("failed to create Address from string");
|
||||
let predicate_bech32_address = Bech32Address::from(predicate_address);
|
||||
|
||||
// Setup message
|
||||
let message_amount = 1;
|
||||
let message = Message {
|
||||
sender: Bech32Address::default(),
|
||||
recipient: predicate_bech32_address.clone(),
|
||||
sender: Address::default(),
|
||||
recipient: predicate_address,
|
||||
nonce: 0.into(),
|
||||
amount: message_amount,
|
||||
data: vec![],
|
||||
|
@ -762,12 +731,10 @@ async fn can_get_predicate_address_in_message() {
|
|||
// Setup Coin
|
||||
let coin_amount = 0;
|
||||
let coin = Coin {
|
||||
owner: predicate_bech32_address.clone(),
|
||||
owner: predicate_address,
|
||||
utxo_id: UtxoId::new(Bytes32::zeroed(), 0),
|
||||
amount: coin_amount,
|
||||
asset_id: AssetId::default(),
|
||||
status: CoinStatus::Unspent,
|
||||
block_created: Default::default(),
|
||||
};
|
||||
let mut coin_vec: Vec<Coin> = Vec::new();
|
||||
coin_vec.push(coin);
|
||||
|
@ -781,7 +748,7 @@ async fn can_get_predicate_address_in_message() {
|
|||
|
||||
// Setup predicate.
|
||||
let predicate_data = AuthPredicateEncoder::default()
|
||||
.encode_data(predicate_bech32_address)
|
||||
.encode_data(predicate_address)
|
||||
.unwrap();
|
||||
let predicate: Predicate =
|
||||
Predicate::load_from("test_artifacts/auth_predicate/out/release/auth_predicate.bin")
|
||||
|
@ -798,7 +765,7 @@ async fn can_get_predicate_address_in_message() {
|
|||
.get_asset_balance(&AssetId::default())
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(balance, message_amount);
|
||||
assert_eq!(balance, message_amount as u128);
|
||||
|
||||
// Spend the message
|
||||
predicate
|
||||
|
@ -820,5 +787,5 @@ async fn can_get_predicate_address_in_message() {
|
|||
|
||||
// Funds were transferred
|
||||
let wallet_balance = wallet.get_asset_balance(&AssetId::default()).await.unwrap();
|
||||
assert_eq!(wallet_balance, message_amount);
|
||||
assert_eq!(wallet_balance, message_amount as u128);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ use fuel_core::types::fuel_tx::ContractIdExt;
|
|||
use fuel_vm::consts::VM_MAX_RAM;
|
||||
use fuels::{
|
||||
prelude::*,
|
||||
types::{Bits256, Bytes32, ContractId},
|
||||
types::{Bits256, SubAssetId, ContractId},
|
||||
};
|
||||
|
||||
abigen!(
|
||||
|
@ -74,7 +74,7 @@ async fn can_get_this_balance() {
|
|||
|
||||
let result = context_instance
|
||||
.methods()
|
||||
.get_this_balance(Bits256(*caller_id.asset_id(&Bytes32::zeroed())))
|
||||
.get_this_balance(Bits256(*caller_id.asset_id(&SubAssetId::zeroed())))
|
||||
.call()
|
||||
.await
|
||||
.unwrap();
|
||||
|
@ -96,7 +96,7 @@ async fn can_get_balance_of_contract() {
|
|||
|
||||
let result = context_instance
|
||||
.methods()
|
||||
.get_balance_of_contract(Bits256(*caller_id.asset_id(&Bytes32::zeroed())), caller_id)
|
||||
.get_balance_of_contract(Bits256(*caller_id.asset_id(&SubAssetId::zeroed())), caller_id)
|
||||
.with_contracts(&[&caller_instance])
|
||||
.call()
|
||||
.await
|
||||
|
@ -150,7 +150,7 @@ async fn can_get_msg_id() {
|
|||
|
||||
assert_eq!(
|
||||
result.value,
|
||||
Bits256(*caller_id.asset_id(&Bytes32::zeroed()))
|
||||
Bits256(*caller_id.asset_id(&SubAssetId::zeroed()))
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ async fn can_get_bytecode_root() {
|
|||
|
||||
async fn get_test_contract_instance(
|
||||
wallet: Wallet,
|
||||
) -> (ContractBytecodeTest<Wallet>, Bech32ContractId) {
|
||||
) -> (ContractBytecodeTest<Wallet>, ContractId) {
|
||||
let id = Contract::load_from(
|
||||
"test_projects/contract_bytecode/out/release/contract_bytecode.bin",
|
||||
LoadConfiguration::default(),
|
||||
|
|
|
@ -20,7 +20,7 @@ async fn setup_env() -> Result<(
|
|||
Bytes64,
|
||||
)> {
|
||||
let mut rng = StdRng::seed_from_u64(1000);
|
||||
let msg_bytes: Bytes32 = rng.gen();
|
||||
let msg_bytes: Bytes32 = rng.r#gen();
|
||||
let private_key = SecretKey::random(&mut rng);
|
||||
let public_key = PublicKey::from(&private_key);
|
||||
let msg = Message::from_bytes(*msg_bytes);
|
||||
|
@ -106,5 +106,5 @@ async fn can_recover_address() {
|
|||
.await
|
||||
.unwrap();
|
||||
|
||||
assert_eq!(Bech32Address::from(response.value), *wallet.address());
|
||||
assert_eq!(Address::from(response.value), wallet.address());
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ async fn ec_recover_and_match_predicate_test() -> Result<()> {
|
|||
|
||||
let all_coins = [signer_1.address(), signer_2.address(), signer_3.address()]
|
||||
.iter()
|
||||
.flat_map(|wallet| setup_single_asset_coins(wallet, AssetId::default(), 10, 1_000_000))
|
||||
.flat_map(|wallet| setup_single_asset_coins(*wallet, AssetId::default(), 10, 1_000_000))
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
let mut node_config = NodeConfig::default();
|
||||
|
@ -95,9 +95,9 @@ async fn ec_recover_and_match_predicate_test() -> Result<()> {
|
|||
.await?;
|
||||
|
||||
let predicate_balance = provider
|
||||
.get_asset_balance(predicate.address(), asset_id)
|
||||
.get_asset_balance(&predicate.address(), &asset_id)
|
||||
.await?;
|
||||
assert_eq!(predicate_balance, amount_to_predicate);
|
||||
assert_eq!(predicate_balance, amount_to_predicate as u128);
|
||||
|
||||
predicate
|
||||
.transfer(
|
||||
|
@ -109,10 +109,10 @@ async fn ec_recover_and_match_predicate_test() -> Result<()> {
|
|||
.await?;
|
||||
|
||||
let receiver_balance_after = receiver.get_asset_balance(&asset_id).await?;
|
||||
assert_eq!(amount_to_predicate, receiver_balance_after);
|
||||
assert_eq!(amount_to_predicate as u128, receiver_balance_after);
|
||||
|
||||
let predicate_balance = provider
|
||||
.get_asset_balance(predicate.address(), asset_id)
|
||||
.get_asset_balance(&predicate.address(), &asset_id)
|
||||
.await?;
|
||||
assert_eq!(predicate_balance, 0);
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ async fn setup_env() -> Result<(
|
|||
[u8; 32],
|
||||
)> {
|
||||
let mut rng = StdRng::seed_from_u64(1000);
|
||||
let msg_bytes: Bytes32 = rng.gen();
|
||||
let msg_bytes: Bytes32 = rng.r#gen();
|
||||
let private_key = SecretKey::random(&mut rng);
|
||||
let public_key = PublicKey::from(&private_key);
|
||||
let signer = PrivateKeySigner::new(private_key);
|
||||
|
|
|
@ -32,7 +32,7 @@ async fn get_messages_contract_instance() -> (TestMessagesContract<Wallet>, Cont
|
|||
// Send assets to the contract to be able withdraw via `smo`.
|
||||
wallets[0]
|
||||
.force_transfer_to_contract(
|
||||
&messages_contract_id,
|
||||
messages_contract_id,
|
||||
amount_per_coin >> 1,
|
||||
AssetId::BASE,
|
||||
TxPolicies::default(),
|
||||
|
|
|
@ -75,7 +75,7 @@ async fn submit_to_predicate(
|
|||
predicate_data: Vec<u8>,
|
||||
) -> Result<()> {
|
||||
let filter = ResourceFilter {
|
||||
from: predicate_address.into(),
|
||||
from: predicate_address,
|
||||
asset_id: Some(asset_id),
|
||||
amount: amount_to_predicate.into(),
|
||||
..Default::default()
|
||||
|
@ -116,10 +116,10 @@ async fn submit_to_predicate(
|
|||
wallet.provider().send_transaction_and_await_commit(new_tx).await.map(|_| ())
|
||||
}
|
||||
|
||||
async fn get_balance(wallet: &Wallet, address: Address, asset_id: AssetId) -> u64 {
|
||||
async fn get_balance(wallet: &Wallet, address: Address, asset_id: AssetId) -> u128 {
|
||||
wallet
|
||||
.provider()
|
||||
.get_asset_balance(&address.into(), asset_id)
|
||||
.get_asset_balance(&address.into(), &asset_id)
|
||||
.await
|
||||
.unwrap()
|
||||
}
|
||||
|
@ -156,7 +156,7 @@ async fn valid_predicate_data_simple() {
|
|||
|
||||
let receiver_balance_after = get_balance(&wallet, receiver_address, asset_id).await;
|
||||
assert_eq!(
|
||||
receiver_balance_before + amount_to_predicate - 1,
|
||||
receiver_balance_before + amount_to_predicate as u128 - 1,
|
||||
receiver_balance_after
|
||||
);
|
||||
|
||||
|
@ -198,5 +198,5 @@ async fn invalid_predicate_data_simple() {
|
|||
assert_eq!(receiver_balance_before, receiver_balance_after);
|
||||
|
||||
let predicate_balance = get_balance(&wallet, predicate_address, asset_id).await;
|
||||
assert_eq!(predicate_balance, amount_to_predicate);
|
||||
assert_eq!(predicate_balance, amount_to_predicate as u128);
|
||||
}
|
||||
|
|
|
@ -109,10 +109,10 @@ async fn submit_to_predicate(
|
|||
let _call_result = provider.send_transaction_and_await_commit(new_tx).await;
|
||||
}
|
||||
|
||||
async fn get_balance(wallet: &Wallet, address: Address, asset_id: AssetId) -> u64 {
|
||||
async fn get_balance(wallet: &Wallet, address: Address, asset_id: AssetId) -> u128 {
|
||||
wallet
|
||||
.provider()
|
||||
.get_asset_balance(&address.into(), asset_id)
|
||||
.get_asset_balance(&address.into(), &asset_id)
|
||||
.await
|
||||
.unwrap()
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ async fn should_pass_with_valid_struct() {
|
|||
|
||||
let receiver_balance_after = get_balance(&wallet, receiver_address, asset_id).await;
|
||||
assert_eq!(
|
||||
receiver_balance_before + amount_to_predicate,
|
||||
receiver_balance_before + amount_to_predicate as u128,
|
||||
receiver_balance_after
|
||||
);
|
||||
|
||||
|
@ -199,7 +199,7 @@ async fn should_fail_with_invalid_struct_u64() {
|
|||
assert_eq!(receiver_balance_before, receiver_balance_after);
|
||||
|
||||
let predicate_balance = get_balance(&wallet, predicate_address, asset_id).await;
|
||||
assert_eq!(predicate_balance, amount_to_predicate);
|
||||
assert_eq!(predicate_balance, amount_to_predicate as u128);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
|
@ -233,5 +233,5 @@ async fn should_fail_with_invalid_struct_bool() {
|
|||
assert_eq!(receiver_balance_before, receiver_balance_after);
|
||||
|
||||
let predicate_balance = get_balance(&wallet, predicate_address, asset_id).await;
|
||||
assert_eq!(predicate_balance, amount_to_predicate);
|
||||
assert_eq!(predicate_balance, amount_to_predicate as u128);
|
||||
}
|
||||
|
|
|
@ -70,10 +70,10 @@ async fn create_predicate(
|
|||
provider.send_transaction_and_await_commit(tx).await.unwrap();
|
||||
}
|
||||
|
||||
async fn get_balance(wallet: &Wallet, address: Address, asset_id: AssetId) -> u64 {
|
||||
async fn get_balance(wallet: &Wallet, address: Address, asset_id: AssetId) -> u128 {
|
||||
wallet
|
||||
.provider()
|
||||
.get_asset_balance(&address.into(), asset_id)
|
||||
.get_asset_balance(&address.into(), &asset_id)
|
||||
.await
|
||||
.unwrap()
|
||||
}
|
||||
|
@ -156,7 +156,7 @@ async fn test_string_slice_predicate() {
|
|||
|
||||
let receiver_balance_after = get_balance(&wallet, receiver_address, asset_id).await;
|
||||
assert_eq!(
|
||||
receiver_balance_before + amount_to_predicate,
|
||||
receiver_balance_before + amount_to_predicate as u128,
|
||||
receiver_balance_after
|
||||
);
|
||||
|
||||
|
|
|
@ -82,10 +82,7 @@ async fn get_contracts(msg_has_data: bool) -> (TxContractTest<Wallet>, ContractI
|
|||
coins.append(&mut deployment_coins);
|
||||
|
||||
let msg = setup_single_message(
|
||||
&Bech32Address {
|
||||
hrp: "".to_string(),
|
||||
hash: Default::default(),
|
||||
},
|
||||
Address::default(),
|
||||
wallet_signer.address(),
|
||||
DEFAULT_COIN_AMOUNT,
|
||||
69.into(),
|
||||
|
@ -124,9 +121,9 @@ async fn generate_predicate_inputs(amount: u64, wallet: &Wallet) -> (Vec<u8>, Sd
|
|||
|
||||
let predicate_root = predicate.address();
|
||||
|
||||
let balance: u64 = wallet.get_asset_balance(&AssetId::default()).await.unwrap();
|
||||
let balance: u128 = wallet.get_asset_balance(&AssetId::default()).await.unwrap();
|
||||
|
||||
assert!(balance >= amount);
|
||||
assert!(balance >= amount as u128);
|
||||
|
||||
wallet
|
||||
.transfer(
|
||||
|
@ -194,7 +191,7 @@ async fn setup_output_predicate(
|
|||
.encode_data(
|
||||
index,
|
||||
Bits256([0u8; 32]),
|
||||
Bits256(*wallet1.address().hash()),
|
||||
Bits256(*wallet1.address()),
|
||||
expected_output_type,
|
||||
)
|
||||
.unwrap();
|
||||
|
@ -529,7 +526,7 @@ mod tx {
|
|||
|
||||
let num_coins = 100;
|
||||
let coins = setup_single_asset_coins(
|
||||
&signer.address(),
|
||||
signer.address(),
|
||||
AssetId::zeroed(),
|
||||
num_coins,
|
||||
DEFAULT_COIN_AMOUNT,
|
||||
|
@ -595,7 +592,7 @@ mod tx {
|
|||
|
||||
// Outputs for predicate
|
||||
let predicate_output =
|
||||
wallet.get_asset_outputs_for_amount(&wallet.address(), *base_asset_id, 1);
|
||||
wallet.get_asset_outputs_for_amount(wallet.address(), *base_asset_id, 1);
|
||||
|
||||
// Append the predicate to the transaction
|
||||
builder.inputs.push(predicate_input.get(0).unwrap().clone());
|
||||
|
@ -623,7 +620,7 @@ mod tx {
|
|||
|
||||
let num_coins = 100;
|
||||
let coins = setup_single_asset_coins(
|
||||
&signer.address(),
|
||||
signer.address(),
|
||||
AssetId::zeroed(),
|
||||
num_coins,
|
||||
DEFAULT_COIN_AMOUNT,
|
||||
|
@ -694,7 +691,7 @@ mod tx {
|
|||
|
||||
// Outputs for predicate
|
||||
let predicate_output =
|
||||
wallet.get_asset_outputs_for_amount(&wallet.address(), *base_asset_id, 1);
|
||||
wallet.get_asset_outputs_for_amount(wallet.address(), *base_asset_id, 1);
|
||||
|
||||
// Append the predicate to the transaction
|
||||
builder.inputs.push(predicate_input.get(0).unwrap().clone());
|
||||
|
@ -782,7 +779,7 @@ mod tx {
|
|||
|
||||
// Outputs for predicate
|
||||
let predicate_output =
|
||||
wallet.get_asset_outputs_for_amount(&wallet.address(), *base_asset_id, 1);
|
||||
wallet.get_asset_outputs_for_amount(wallet.address(), *base_asset_id, 1);
|
||||
|
||||
let mut builder = BlobTransactionBuilder::default().with_blob(blob);
|
||||
|
||||
|
@ -885,7 +882,7 @@ mod tx {
|
|||
|
||||
// Outputs for predicate
|
||||
let predicate_output =
|
||||
wallet.get_asset_outputs_for_amount(&wallet.address(), *base_asset_id, 1);
|
||||
wallet.get_asset_outputs_for_amount(wallet.address(), *base_asset_id, 1);
|
||||
|
||||
// Append the predicate to the transaction
|
||||
builder.inputs.push(predicate_input.get(0).unwrap().clone());
|
||||
|
@ -1098,7 +1095,7 @@ mod inputs {
|
|||
|
||||
// Outputs for predicate
|
||||
let predicate_output =
|
||||
wallet.get_asset_outputs_for_amount(&wallet.address(), *base_asset_id, 1);
|
||||
wallet.get_asset_outputs_for_amount(wallet.address(), *base_asset_id, 1);
|
||||
|
||||
// Append the predicate to the transaction
|
||||
builder.inputs.push(predicate_input.get(0).unwrap().clone());
|
||||
|
@ -1187,7 +1184,7 @@ mod inputs {
|
|||
|
||||
// Outputs for predicate
|
||||
let predicate_output =
|
||||
wallet.get_asset_outputs_for_amount(&wallet.address(), *base_asset_id, 1);
|
||||
wallet.get_asset_outputs_for_amount(wallet.address(), *base_asset_id, 1);
|
||||
|
||||
// Append the predicate to the transaction
|
||||
builder.inputs.push(predicate_input.get(0).unwrap().clone());
|
||||
|
@ -1228,7 +1225,7 @@ mod inputs {
|
|||
.unwrap();
|
||||
assert_eq!(
|
||||
response.value.unwrap().as_slice(),
|
||||
message.sender.hash().as_slice()
|
||||
message.sender.as_slice()
|
||||
);
|
||||
|
||||
// Assert none returned when transaction type is not a message
|
||||
|
@ -1246,7 +1243,7 @@ mod inputs {
|
|||
let (contract_instance, _, wallet, _) = get_contracts(false).await;
|
||||
|
||||
let message = &wallet.get_messages().await.unwrap()[0];
|
||||
let recipient = message.recipient.hash;
|
||||
let recipient = message.recipient;
|
||||
|
||||
let response = contract_instance
|
||||
.methods()
|
||||
|
@ -1554,7 +1551,7 @@ mod outputs {
|
|||
|
||||
// Predicate has funds
|
||||
let predicate_balance = predicate.get_asset_balance(base_asset_id).await.unwrap();
|
||||
assert_eq!(predicate_balance, predicate_coin_amount);
|
||||
assert_eq!(predicate_balance, predicate_coin_amount as u128);
|
||||
|
||||
// Get contract ready for deployment
|
||||
let binary = fs::read(TX_CONTRACT_BYTECODE_PATH).unwrap();
|
||||
|
@ -1581,7 +1578,7 @@ mod outputs {
|
|||
|
||||
// Outputs
|
||||
let mut outputs = wallet.get_asset_outputs_for_amount(
|
||||
&wallet.address(),
|
||||
wallet.address(),
|
||||
*base_asset_id,
|
||||
predicate_coin_amount,
|
||||
);
|
||||
|
@ -1638,7 +1635,7 @@ mod outputs {
|
|||
|
||||
let new_balance = predicate.get_asset_balance(&asset_id).await.unwrap();
|
||||
let expected_fee = 1;
|
||||
assert_eq!(balance - transfer_amount - expected_fee, new_balance);
|
||||
assert_eq!(balance - transfer_amount as u128 - expected_fee, new_balance);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
|
@ -1846,7 +1843,7 @@ mod outputs {
|
|||
let instance = TxOutputContract::new(contract_id.clone(), wallet.clone());
|
||||
// Send tokens to the contract
|
||||
let _ = wallet
|
||||
.force_transfer_to_contract(&contract_id, 10, asset_id, TxPolicies::default())
|
||||
.force_transfer_to_contract(contract_id, 10, asset_id, TxPolicies::default())
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
|
@ -1886,12 +1883,12 @@ mod outputs {
|
|||
|
||||
// Assert the wallet 1 has received the change
|
||||
let wallet_1_balance = wallet.get_asset_balance(&asset_id).await.unwrap();
|
||||
let change_amount = predicate_balance_before - transfer_amount - tx_status.total_fee();
|
||||
let change_amount = predicate_balance_before - transfer_amount as u128 - tx_status.total_fee() as u128;
|
||||
assert_eq!(wallet_1_balance, wallet_1_balance_before + change_amount);
|
||||
|
||||
// Assert the wallet 2 has received the transfer amount
|
||||
let wallet_2_balance = wallet_2.get_asset_balance(&asset_id).await.unwrap();
|
||||
assert_eq!(wallet_2_balance, wallet_2_balance_before + transfer_amount);
|
||||
assert_eq!(wallet_2_balance, wallet_2_balance_before + transfer_amount as u128);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
|
@ -1914,7 +1911,7 @@ mod outputs {
|
|||
|
||||
// Send tokens to the contract
|
||||
let _ = wallet
|
||||
.force_transfer_to_contract(&contract_id, 10, asset_id, TxPolicies::default())
|
||||
.force_transfer_to_contract(contract_id, 10, asset_id, TxPolicies::default())
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue