Rust Fuel Updates (#2029)

### Description

This brings fuel up to the latest version. The main change required was
to to abigen process. After some digging I figured out they just moved
it to a new crate.

### Drive-by changes

- Updated an error message I ran into when trying to run the validator
to be more descriptive
- Found an unlinked file which I was able to delete
- Add `*.ignore` files to gitignore. This allows me to block out some
configs I was using for testing.

### Related issues

- Fixes hyperlane-xyz/issues#410

### Backward compatibility

_Are these changes backward compatible?_

Yes

_Are there any infrastructure implications, e.g. changes that would
prohibit deploying older commits using this infra tooling?_

None


### Testing

_What kind of testing have these changes undergone?_

Manual - Ran the validator against a local node
pull/2063/head
Mattie Conover 2 years ago committed by GitHub
parent aea77a10f7
commit 7d6e5d5281
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .gitignore
  2. 459
      rust/Cargo.lock
  3. 2
      rust/Cargo.toml
  4. 15
      rust/chains/hyperlane-fuel/Cargo.toml
  5. 8
      rust/chains/hyperlane-fuel/src/conversions.rs
  6. 2
      rust/chains/hyperlane-fuel/src/mailbox.rs
  7. 2
      rust/hyperlane-base/Cargo.toml
  8. 2
      rust/hyperlane-base/src/settings/chains.rs
  9. 7
      rust/utils/abigen/Cargo.toml
  10. 21
      rust/utils/abigen/src/lib.rs

2
.gitignore vendored

@ -26,3 +26,5 @@ solidity/artifacts
yarn-error.log
.idea
**/*.ignore

459
rust/Cargo.lock generated

@ -19,6 +19,7 @@ dependencies = [
"Inflector",
"ethers",
"fuels",
"fuels-code-gen",
"which",
]
@ -71,6 +72,17 @@ dependencies = [
"version_check",
]
[[package]]
name = "ahash"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f"
dependencies = [
"cfg-if",
"once_cell",
"version_check",
]
[[package]]
name = "aho-corasick"
version = "0.7.20"
@ -167,14 +179,12 @@ dependencies = [
]
[[package]]
name = "atty"
version = "0.2.14"
name = "atomic-polyfill"
version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
checksum = "e3ff7eb3f316534d83a8a2c3d1674ace8a5a71198eba31e2e2b597833f699b28"
dependencies = [
"hermit-abi 0.1.19",
"libc",
"winapi",
"critical-section",
]
[[package]]
@ -437,7 +447,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "40f9ca3698b2e4cb7c15571db0abc5551dca417a21ae8140460b50309bb2cc62"
dependencies = [
"borsh-derive",
"hashbrown",
"hashbrown 0.12.3",
]
[[package]]
@ -665,14 +675,11 @@ version = "3.2.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5"
dependencies = [
"atty",
"bitflags",
"clap_derive",
"clap_lex",
"indexmap",
"once_cell",
"strsim",
"termcolor",
"textwrap",
]
@ -698,6 +705,12 @@ dependencies = [
"os_str_bytes",
]
[[package]]
name = "cobs"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15"
[[package]]
name = "codespan-reporting"
version = "0.11.1"
@ -851,6 +864,33 @@ dependencies = [
"unicode-segmentation",
]
[[package]]
name = "cookie"
version = "0.16.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb"
dependencies = [
"percent-encoding",
"time 0.3.20",
"version_check",
]
[[package]]
name = "cookie_store"
version = "0.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e4b6aa369f41f5faa04bb80c9b1f4216ea81646ed6124d76ba5c49a7aafd9cd"
dependencies = [
"cookie",
"idna 0.2.3",
"log",
"publicsuffix",
"serde",
"serde_json",
"time 0.3.20",
"url",
]
[[package]]
name = "core-foundation"
version = "0.9.3"
@ -894,6 +934,12 @@ dependencies = [
"cfg-if",
]
[[package]]
name = "critical-section"
version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6548a0ad5d2549e111e1f6a11a6c2e2d00ce6a3dafe22948d67c2b443f775e52"
[[package]]
name = "crossbeam-channel"
version = "0.5.7"
@ -1171,7 +1217,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "907076dfda823b0b36d2a1bb5f90c96660a5bbcd7729e10727f07858f22c4edc"
dependencies = [
"cfg-if",
"hashbrown",
"hashbrown 0.12.3",
"lock_api",
"once_cell",
"parking_lot_core 0.9.7",
@ -1880,28 +1926,41 @@ version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa"
[[package]]
name = "fuel-abi-types"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "47d99a7aeb41cdabffa38418b00fd57b5571dc58ee5af606e845a088befecd36"
dependencies = [
"lazy_static",
"regex",
"serde",
"thiserror",
]
[[package]]
name = "fuel-asm"
version = "0.10.0"
version = "0.26.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "781568e982a90f25bfaf019196ca135fdf58a1826a8e68fbb1af2ad8b3c2a6fc"
checksum = "2848e936ce953d9571771279b270ee6f098c04ad5cbb7227bf5dc04abfc57b59"
dependencies = [
"fuel-types",
"serde",
]
[[package]]
name = "fuel-chain-config"
version = "0.15.3"
name = "fuel-core-chain-config"
version = "0.17.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b273c337a78db9bdc57da4266cf74f5776a31650913bcfb7cacbaedf1930df92"
checksum = "8b40e415a8fe65ec37c498ac676d6282b1b8b6b0ce2c85758ac07fcf098e40c0"
dependencies = [
"anyhow",
"bincode",
"fuel-core-interfaces",
"fuel-poa-coordinator",
"bech32 0.9.1",
"fuel-core-storage",
"fuel-core-types",
"hex 0.4.3",
"itertools",
"postcard",
"rand",
"serde",
"serde_json",
@ -1910,35 +1969,67 @@ dependencies = [
]
[[package]]
name = "fuel-core-interfaces"
version = "0.15.3"
name = "fuel-core-client"
version = "0.17.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2bd0576d5888093bfbc3a57af078dd7e487d5cc2174eb1bdfefa94c88afa37a6"
checksum = "4b0901d6ca2a9d6cb60f597120887f4a9b8ae25e72a9c349eff66d6517facb32"
dependencies = [
"anyhow",
"cynic",
"derive_more",
"eventsource-client",
"fuel-core-types",
"futures",
"hex 0.4.3",
"hyper-rustls 0.22.1",
"itertools",
"reqwest",
"serde",
"serde_json",
"tai64",
"thiserror",
"tracing",
]
[[package]]
name = "fuel-core-storage"
version = "0.17.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10599f1034f524942e6ab2e54f852a587a16f33d5910ec85810c32068e543df7"
dependencies = [
"anyhow",
"fuel-core-types",
"fuel-vm",
"thiserror",
]
[[package]]
name = "fuel-core-types"
version = "0.17.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e74e9a062260ab8b0064c9597547231bf772779054eb60d07dbe7e4237f075bc"
dependencies = [
"anyhow",
"async-trait",
"derive_more",
"fuel-vm",
"lazy_static",
"parking_lot 0.12.1",
"secrecy",
"serde",
"tai64",
"thiserror",
"tokio",
"zeroize",
]
[[package]]
name = "fuel-crypto"
version = "0.6.2"
version = "0.26.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "365c114728301916a58c932c304feb8836c51f65e0153a3f2157bf6cbb4c32ef"
checksum = "efba8a3c2c91bdec93b5328b31f71167a42c23555a8885cb7d55ab66632d8fa1"
dependencies = [
"borrown",
"coins-bip32",
"coins-bip39",
"fuel-types",
"getrandom",
"lazy_static",
"rand",
"secp256k1",
@ -1947,72 +2038,32 @@ dependencies = [
"zeroize",
]
[[package]]
name = "fuel-gql-client"
version = "0.15.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e9dcb67bfe1a19451877e5238b77921d66629092fe9cb74086931d37701dd008"
dependencies = [
"anyhow",
"clap",
"cynic",
"derive_more",
"eventsource-client",
"fuel-vm",
"futures",
"hex 0.4.3",
"hyper-rustls 0.22.1",
"itertools",
"reqwest",
"serde",
"serde_json",
"tai64",
"thiserror",
]
[[package]]
name = "fuel-merkle"
version = "0.4.1"
version = "0.26.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12e56cc8be0a2ea7cfb30ae4696bf5f658a9447df1b32af699b6273a11fdcfa3"
checksum = "fe9d6caf8ad593cd8665e431aec18c1b4550db2e0f52d958547fca81c2c07077"
dependencies = [
"digest 0.10.6",
"fuel-storage",
"hashbrown",
"hashbrown 0.13.2",
"hex 0.4.3",
"sha2 0.10.6",
"thiserror",
]
[[package]]
name = "fuel-poa-coordinator"
version = "0.15.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "47d0c652fde519c791943636c1bd98ee74df5e51cfb8f6529257212402b3b7e6"
dependencies = [
"anyhow",
"async-trait",
"fuel-core-interfaces",
"humantime-serde",
"parking_lot 0.12.1",
"serde",
"tokio",
"tracing",
]
[[package]]
name = "fuel-storage"
version = "0.3.0"
version = "0.26.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b0f895423d18472d60eb078cf949608ff3fe6e42e91d41b85993b11528d2c4c3"
checksum = "cc7969a1fab462d0ed9aadb9df98ff40c92b9d5b7e029de6e48d40a068e49e05"
[[package]]
name = "fuel-tx"
version = "0.23.1"
version = "0.26.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dffd148866f191397915b4a407455ece148197890ce5cf86d4b3f1eedcc7f35e"
checksum = "8e0bbf8d062f8a41395184b7d60c1bb674254545dd64a0026beda65005de8bc7"
dependencies = [
"bitflags",
"derivative",
"fuel-asm",
"fuel-crypto",
@ -2027,9 +2078,9 @@ dependencies = [
[[package]]
name = "fuel-types"
version = "0.5.3"
version = "0.26.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "403dcac5f0788a8fbdb6cfa0e5690dd4fe4278648da674d7e430711abf90b570"
checksum = "9b8c43ba619e6259a74c9368109006937dfd62cc0b875c2ae13ae6ffa52264f2"
dependencies = [
"rand",
"serde",
@ -2037,10 +2088,11 @@ dependencies = [
[[package]]
name = "fuel-vm"
version = "0.22.7"
version = "0.26.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6540c62a717f927704b44fd6fa0ea456a86c4e5732aadb191bb428f1b4937fda"
checksum = "87dbbf70e3be9243d5cb237e6e3ad2ef18fcad8c725f6c50e2451546e3f61636"
dependencies = [
"bitflags",
"fuel-asm",
"fuel-crypto",
"fuel-merkle",
@ -2058,78 +2110,89 @@ dependencies = [
[[package]]
name = "fuels"
version = "0.33.0"
version = "0.38.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b3110f3301c368eecb9c35fdc0c4ed7e8c9b73dc4b3855017bf6dd49a01656cc"
checksum = "9eede2cde3dd4e8cba56ed5bf4412836d7be280e013e392b2756af99ffb9e714"
dependencies = [
"fuel-gql-client",
"fuels-abigen-macro",
"fuels-contract",
"fuel-core-client",
"fuel-tx",
"fuels-core",
"fuels-macros",
"fuels-programs",
"fuels-signers",
"fuels-test-helpers",
"fuels-types",
]
[[package]]
name = "fuels-abigen-macro"
version = "0.33.0"
name = "fuels-code-gen"
version = "0.38.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0eda4a42704c3e3c3e100d7604ac4a1a2dab26eb7bfd62031e6af93ce6f2a9ad"
checksum = "96d03eee7fa041bb4da8cdecc84b81f1ab8e5810d67bcec0c090bdd58f07e955"
dependencies = [
"Inflector",
"fuels-core",
"fuel-abi-types",
"itertools",
"lazy_static",
"proc-macro2",
"quote",
"rand",
"regex",
"serde_json",
"syn 1.0.109",
]
[[package]]
name = "fuels-contract"
version = "0.33.0"
name = "fuels-core"
version = "0.38.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33a8841208ab59958c0bac5118738cc3f6fa91d7bdef7751807344622008e803"
checksum = "8fd7273ee45a548acbd95e67405809e4b1778f4973851c16633e75b902f0ea9e"
dependencies = [
"anyhow",
"bytes",
"fuel-gql-client",
"fuel-tx",
"fuels-core",
"fuels-signers",
"fuel-types",
"fuel-vm",
"fuels-types",
"futures",
"hex 0.4.3",
"itertools",
"sha2 0.9.9",
]
[[package]]
name = "fuels-macros"
version = "0.38.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6107ffb7dda1051d1db5d1bc209a66d3c2911a8fc844cf3662ca4b705556b57a"
dependencies = [
"Inflector",
"fuel-abi-types",
"fuels-code-gen",
"itertools",
"lazy_static",
"proc-macro2",
"quote",
"rand",
"regex",
"serde",
"serde_json",
"sha2 0.9.9",
"strum 0.21.0",
"strum_macros 0.21.1",
"thiserror",
"tokio",
"syn 1.0.109",
]
[[package]]
name = "fuels-core"
version = "0.33.0"
name = "fuels-programs"
version = "0.38.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "147fc4f999eb2367467b09390d991811ca8d951ccc704246f3ddcea9e413a435"
checksum = "57c1034d747824c089622ca9ec400dc44a7a7119d9caf001116d8befa441bd47"
dependencies = [
"Inflector",
"anyhow",
"bytes",
"fuel-abi-types",
"fuel-tx",
"fuel-types",
"fuel-vm",
"fuels-core",
"fuels-signers",
"fuels-types",
"futures",
"hex 0.4.3",
"itertools",
"lazy_static",
"proc-macro2",
"quote",
"rand",
"regex",
"serde",
@ -2137,24 +2200,26 @@ dependencies = [
"sha2 0.9.9",
"strum 0.21.0",
"strum_macros 0.21.1",
"syn 1.0.109",
"thiserror",
"tokio",
]
[[package]]
name = "fuels-signers"
version = "0.33.0"
version = "0.38.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "18b2d832fbf4115a139981ad5a3823bc579505274faa1c74cdef1e90fc4a4b1d"
checksum = "862c60e598272158d3877896b1a47ae6109733f4538711a4d898c571a88aacb7"
dependencies = [
"async-trait",
"bytes",
"chrono",
"elliptic-curve 0.11.12",
"eth-keystore 0.3.0",
"fuel-core-client",
"fuel-crypto",
"fuel-gql-client",
"fuel-tx",
"fuel-types",
"fuel-vm",
"fuels-core",
"fuels-types",
"hex 0.4.3",
@ -2162,25 +2227,26 @@ dependencies = [
"rand",
"serde",
"sha2 0.9.9",
"tai64",
"thiserror",
"tokio",
]
[[package]]
name = "fuels-test-helpers"
version = "0.33.0"
version = "0.38.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9567d6ede64654fa8edf3a3be22d0e8a2d672648aacb17476c5b3f5ca70ca1e6"
checksum = "c51cb48e1a813b61d811f0811d9758e0f4527097b6a17fccf613ecc3595d3e4d"
dependencies = [
"anyhow",
"fuel-chain-config",
"fuel-core-interfaces",
"fuel-gql-client",
"fuel-core-chain-config",
"fuel-core-client",
"fuel-core-types",
"fuel-tx",
"fuel-types",
"fuels-contract",
"fuels-core",
"fuel-vm",
"fuels-signers",
"fuels-types",
"futures",
"hex 0.4.3",
"portpicker",
"rand",
@ -2194,16 +2260,19 @@ dependencies = [
[[package]]
name = "fuels-types"
version = "0.33.0"
version = "0.38.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b44b707a20ce7b4fd7cd3451e672552e9851fd9024422d68a875f6b12ab184e5"
checksum = "7e2ee9c34502c6427661beb51ee954b2c7c50e51a9bb518f2a7d512682cddd31"
dependencies = [
"anyhow",
"bech32 0.9.1",
"chrono",
"fuel-chain-config",
"fuel-gql-client",
"fuel-abi-types",
"fuel-asm",
"fuel-core-chain-config",
"fuel-core-client",
"fuel-tx",
"fuel-types",
"fuels-macros",
"hex 0.4.3",
"itertools",
"lazy_static",
@ -2214,7 +2283,6 @@ dependencies = [
"strum 0.21.0",
"strum_macros 0.21.1",
"thiserror",
"tokio",
]
[[package]]
@ -2432,13 +2500,31 @@ dependencies = [
"tracing",
]
[[package]]
name = "hash32"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67"
dependencies = [
"byteorder",
]
[[package]]
name = "hashbrown"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
dependencies = [
"ahash",
"ahash 0.7.6",
]
[[package]]
name = "hashbrown"
version = "0.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e"
dependencies = [
"ahash 0.8.3",
]
[[package]]
@ -2456,7 +2542,7 @@ version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "69fe1fcf8b4278d860ad0548329f892a3631fb63f82574df68275f34cdbe0ffa"
dependencies = [
"hashbrown",
"hashbrown 0.12.3",
]
[[package]]
@ -2484,6 +2570,20 @@ dependencies = [
"http",
]
[[package]]
name = "heapless"
version = "0.7.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "db04bc24a18b9ea980628ecf00e6c0264f3c1426dac36c00cb49b6fbad8b0743"
dependencies = [
"atomic-polyfill",
"hash32",
"rustc_version",
"serde",
"spin 0.9.6",
"stable_deref_trait",
]
[[package]]
name = "heck"
version = "0.3.3"
@ -2502,15 +2602,6 @@ dependencies = [
"unicode-segmentation",
]
[[package]]
name = "hermit-abi"
version = "0.1.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
dependencies = [
"libc",
]
[[package]]
name = "hermit-abi"
version = "0.2.6"
@ -2604,22 +2695,6 @@ version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421"
[[package]]
name = "humantime"
version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
[[package]]
name = "humantime-serde"
version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57a3db5ea5923d99402c94e9feb261dc5ee9b4efa158b0315f788cf549cc200c"
dependencies = [
"humantime",
"serde",
]
[[package]]
name = "hyper"
version = "0.14.25"
@ -2863,6 +2938,17 @@ version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
[[package]]
name = "idna"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8"
dependencies = [
"matches",
"unicode-bidi",
"unicode-normalization",
]
[[package]]
name = "idna"
version = "0.3.0"
@ -2924,7 +3010,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399"
dependencies = [
"autocfg",
"hashbrown",
"hashbrown 0.12.3",
]
[[package]]
@ -3157,6 +3243,12 @@ dependencies = [
"regex-automata",
]
[[package]]
name = "matches"
version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5"
[[package]]
name = "md-5"
version = "0.9.1"
@ -3677,7 +3769,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ccd746e37177e1711c20dd619a1620f34f5c8b569c53590a72dedd5344d8924a"
dependencies = [
"dlv-list",
"hashbrown",
"hashbrown 0.12.3",
]
[[package]]
@ -3977,6 +4069,17 @@ dependencies = [
"rand",
]
[[package]]
name = "postcard"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cfa512cd0d087cc9f99ad30a1bf64795b67871edbead083ffc3a4dfafa59aa00"
dependencies = [
"cobs",
"heapless",
"serde",
]
[[package]]
name = "ppv-lite86"
version = "0.2.17"
@ -4100,6 +4203,12 @@ version = "2.28.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94"
[[package]]
name = "psl-types"
version = "2.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33cb294fe86a74cbcf50d4445b37da762029549ebeea341421c7c70370f86cac"
[[package]]
name = "ptr_meta"
version = "0.1.4"
@ -4120,6 +4229,16 @@ dependencies = [
"syn 1.0.109",
]
[[package]]
name = "publicsuffix"
version = "2.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96a8c1bda5ae1af7f99a2962e49df150414a43d62404644d98dd5c3a93d07457"
dependencies = [
"idna 0.3.0",
"psl-types",
]
[[package]]
name = "quick-error"
version = "1.2.3"
@ -4270,6 +4389,7 @@ checksum = "0ba30cc2c0cd02af1222ed216ba659cdb2f879dfe3181852fe7c50b1d0005949"
dependencies = [
"base64 0.21.0",
"bytes",
"cookie_store",
"encoding_rs",
"futures-core",
"futures-util",
@ -4324,7 +4444,7 @@ dependencies = [
"cc",
"libc",
"once_cell",
"spin",
"spin 0.5.2",
"untrusted",
"web-sys",
"winapi",
@ -4346,7 +4466,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c30f1d45d9aa61cbc8cd1eb87705470892289bb2d01943e7803b873a57404dc3"
dependencies = [
"bytecheck",
"hashbrown",
"hashbrown 0.12.3",
"ptr_meta",
"rend",
"rkyv_derive",
@ -5284,6 +5404,15 @@ version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d"
[[package]]
name = "spin"
version = "0.9.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5d6e0250b93c8427a177b849d144a96d5acc57006149479403d7861ab721e34"
dependencies = [
"lock_api",
]
[[package]]
name = "spki"
version = "0.6.0"
@ -5321,7 +5450,7 @@ version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dcbc16ddba161afc99e14d1713a453747a2b07fc097d2009f4c300ec99286105"
dependencies = [
"ahash",
"ahash 0.7.6",
"atoi",
"base64 0.13.1",
"bigdecimal",
@ -5401,6 +5530,12 @@ dependencies = [
"tokio-native-tls",
]
[[package]]
name = "stable_deref_trait"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
[[package]]
name = "static_assertions"
version = "1.1.0"
@ -6092,7 +6227,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643"
dependencies = [
"form_urlencoded",
"idna",
"idna 0.3.0",
"percent-encoding",
]

@ -36,6 +36,8 @@ ethers-contract = { git = "https://github.com/hyperlane-xyz/ethers-rs", tag = "2
ethers-providers = { git = "https://github.com/hyperlane-xyz/ethers-rs", tag = "2023-02-10-01" }
ethers-signers = { git = "https://github.com/hyperlane-xyz/ethers-rs", tag = "2023-02-10-01", features = ["aws"] }
eyre = "0.6"
fuels = "0.38"
fuels-code-gen = "0.38"
futures = "0.3"
futures-util = "0.3"
itertools = "0.10"

@ -8,14 +8,15 @@ publish.workspace = true
version.workspace = true
[dependencies]
fuels = "0.33"
hyperlane-core = { path = "../../hyperlane-core" }
async-trait = { version = "0.1", default-features = false }
thiserror = "1.0"
serde = "1.0"
anyhow = "1.0"
tracing-futures = "0.2"
tracing = { version = "0.1", features = ["release_max_level_debug"] }
async-trait.workspace = true
fuels.workspace = true
serde.workspace = true
thiserror.workspace = true
tracing-futures.workspace = true
tracing.workspace = true
hyperlane-core = { path = "../../hyperlane-core" }
[build-dependencies]
abigen = { path = "../../utils/abigen", features = ["fuels"] }

@ -43,11 +43,9 @@ impl_h256!(
|v| H256::from(*v.hash)
);
impl_h256!(
fuels::prelude::Bits256,
|v| fuels::prelude::Bits256(v.0),
|v| H256::from(v.0)
);
impl_h256!(fuels::types::Bits256, |v| fuels::types::Bits256(v.0), |v| {
H256::from(v.0)
});
impl_h256!(
fuels::prelude::ContractId,

@ -43,7 +43,7 @@ impl FuelMailbox {
impl HyperlaneContract for FuelMailbox {
fn address(&self) -> H256 {
self.contract.get_contract_id().into_h256()
self.contract.contract_id().into_h256()
}
}

@ -15,7 +15,7 @@ config.workspace = true
derive-new.workspace = true
ethers.workspace = true
eyre.workspace = true
fuels = "0.33"
fuels.workspace = true
futures-util.workspace = true
mockall = "0.11"
paste.workspace = true

@ -131,7 +131,7 @@ pub struct ChainSetup {
impl ChainSetup {
/// Get the chain connection config or generate an error
pub fn connection(&self) -> Result<&ChainConnectionConf> {
self.connection.as_ref().ok_or_else(|| eyre!("Missing chain configuration for {}; this includes protocol and connection information", self.name))
self.connection.as_ref().ok_or_else(|| eyre!("Missing chain configuration for {}; this includes protocol type and the connection information", self.name))
}
/// Try to convert the chain settings into an HyperlaneProvider.

@ -11,11 +11,12 @@ version.workspace = true
[dependencies]
Inflector = "0.11"
ethers = { workspace = true, optional = true }
fuels = { version = "0.33", optional = true }
which = {version = "4.3", optional = true }
fuels = { workspace = true, optional = true }
fuels-code-gen = { workspace = true, optional = true }
which = { version = "4.3", optional = true }
[features]
default = []
ethers = ["dep:ethers"]
fmt = ["dep:which"]
fuels = ["dep:fuels", "fmt"]
fuels = ["dep:fuels", "dep:fuels-code-gen", "fmt"]

@ -1,3 +1,4 @@
use fuels_code_gen::ProgramType;
use std::collections::BTreeSet;
use std::ffi::OsStr;
use std::fs::{self, File};
@ -54,6 +55,7 @@ pub fn generate_bindings_for_dir(
println!("Creating module file at {}", mod_file_path.display());
let mut mod_file = File::create(&mod_file_path).expect("could not create modfile");
writeln!(mod_file, "#![allow(warnings)]").unwrap();
writeln!(mod_file, "#![allow(clippy::all)]").unwrap();
write!(mod_file, "#![allow(missing_docs)]\n\n").unwrap();
for m in modules {
@ -101,14 +103,21 @@ pub fn generate_bindings(
}
#[cfg(feature = "fuels")]
if build_type == BuildType::Fuels {
fuels::core::code_gen::abigen::Abigen::new(contract_name, abi_source)
.expect("could not instantiate Abigen")
.generate()
.expect("could not generate bindings")
.write_to_file(&output_file)
let tokens = fuels_code_gen::Abigen::generate(
vec![fuels_code_gen::AbigenTarget {
name: contract_name.into(),
abi: abi_source.into(),
program_type: ProgramType::Contract,
}],
false,
)
.expect("could not generate bindings")
.to_string();
let mut outfile = File::create(&output_file).expect("Could not open output file");
outfile
.write_all(tokens.as_bytes())
.expect("Could not write bindings to file");
// apparently fuels was too lazy to do this for us
fmt_file(&output_file);
}

Loading…
Cancel
Save