From ec88fb38af775704b0b3ecfab04813e6f0c2ce49 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Oct 2024 09:10:36 +1000 Subject: [PATCH 01/15] Update xdr, env, sdk, strkey deps --- Cargo.lock | 291 +++++++++++++++--- Cargo.toml | 56 ++-- cmd/crates/soroban-spec-tools/src/contract.rs | 15 +- .../test-wasms/custom_account/src/lib.rs | 4 +- .../src/commands/contract/info/env_meta.rs | 15 +- cmd/soroban-cli/src/commands/version.rs | 13 +- 6 files changed, 311 insertions(+), 83 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 21df05973..e229212ae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,6 +17,18 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + [[package]] name = "aho-corasick" version = "1.1.3" @@ -111,12 +123,136 @@ version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" +[[package]] +name = "ark-bls12-381" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", + "itertools 0.10.5", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "digest 0.10.7", + "itertools 0.10.5", + "num-bigint", + "num-traits", + "paste", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "digest 0.10.7", + "num-bigint", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand", +] + [[package]] name = "arrayref" version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + [[package]] name = "ascii-canvas" version = "3.0.0" @@ -1098,6 +1234,17 @@ dependencies = [ "serde", ] +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "derive_arbitrary" version = "1.3.2" @@ -1256,9 +1403,9 @@ checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "ecdsa" -version = "0.16.7" +version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0997c976637b606099b9985693efa3581e84e41f5c11ba5255f88711058ad428" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der", "digest 0.10.7", @@ -2570,11 +2717,23 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + [[package]] name = "hashbrown" version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", +] [[package]] name = "heck" @@ -3266,9 +3425,9 @@ dependencies = [ [[package]] name = "k256" -version = "0.13.1" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" +checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" dependencies = [ "cfg-if", "ecdsa", @@ -3528,6 +3687,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "multi-stash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "685a9ac4b61f4e728e1d2c6a7844609c16527aeb5e6c865915c08e619c16410f" + [[package]] name = "native-tls" version = "0.2.12" @@ -5091,11 +5256,11 @@ dependencies = [ [[package]] name = "soroban-builtin-sdk-macros" -version = "21.2.1" +version = "22.0.0-rc.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f57a68ef8777e28e274de0f3a88ad9a5a41d9a2eb461b4dd800b086f0e83b80" +checksum = "6e4c8668199d95e3061cd42e1b96a91451c656a238a607fa53f96f0a3fdcf5f3" dependencies = [ - "itertools 0.11.0", + "itertools 0.10.5", "proc-macro2", "quote", "syn 2.0.77", @@ -5193,9 +5358,9 @@ dependencies = [ [[package]] name = "soroban-env-common" -version = "21.2.1" +version = "22.0.0-rc.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd1c89463835fe6da996318156d39f424b4f167c725ec692e5a7a2d4e694b3d" +checksum = "6bdf1d66133d6b29e2834acea79decb57c47c71aa01885cae2b9ad621d67525c" dependencies = [ "arbitrary", "crate-git-revision 0.0.6", @@ -5212,9 +5377,9 @@ dependencies = [ [[package]] name = "soroban-env-guest" -version = "21.2.1" +version = "22.0.0-rc.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bfb2536811045d5cd0c656a324cbe9ce4467eb734c7946b74410d90dea5d0ce" +checksum = "fa9610ac8a4a900e6f35b2ed171bc325c7e9883929f5e9da758e85f1226dd284" dependencies = [ "soroban-env-common", "static_assertions", @@ -5222,11 +5387,14 @@ dependencies = [ [[package]] name = "soroban-env-host" -version = "21.2.1" +version = "22.0.0-rc.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b7a32c28f281c423189f1298960194f0e0fc4eeb72378028171e556d8cd6160" +checksum = "0c695d22888ede1f98c016a4a690be307817d133be0e0f32a25fd6e53bb6c929" dependencies = [ - "backtrace", + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", "curve25519-dalek 4.1.3", "ecdsa", "ed25519-dalek 2.1.1", @@ -5249,17 +5417,17 @@ dependencies = [ "soroban-env-common", "soroban-wasmi", "static_assertions", - "stellar-strkey 0.0.8", + "stellar-strkey 0.0.9", "wasmparser 0.116.1", ] [[package]] name = "soroban-env-macros" -version = "21.2.1" +version = "22.0.0-rc.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "242926fe5e0d922f12d3796cd7cd02dd824e5ef1caa088f45fce20b618309f64" +checksum = "d926d0daa3ba798cd70ce962ea10012e630d75088352369a6d248b2644dd7a2c" dependencies = [ - "itertools 0.11.0", + "itertools 0.10.5", "proc-macro2", "quote", "serde", @@ -5274,9 +5442,9 @@ version = "21.5.0" [[package]] name = "soroban-ledger-snapshot" -version = "21.7.2" +version = "22.0.0-rc.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf596b2083946a95914a55d7d29cee6a8095b515fd06211851f45bf6af5a496" +checksum = "c07ca63290730b803f0637e00994f803d2f24cc6383ac8680724050d07690a89" dependencies = [ "serde", "serde_json", @@ -5288,9 +5456,9 @@ dependencies = [ [[package]] name = "soroban-sdk" -version = "21.7.2" +version = "22.0.0-rc.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69e39bf9e8ab05579c836e8e5be5f2f4c5ba75e7337ece20e975e82fc3a9d41e" +checksum = "68b715e15357dbdda2fe0626005b75c2253bb3786deec3001d4077462a9dadd3" dependencies = [ "arbitrary", "bytes-lit", @@ -5303,18 +5471,18 @@ dependencies = [ "soroban-env-host", "soroban-ledger-snapshot", "soroban-sdk-macros", - "stellar-strkey 0.0.8", + "stellar-strkey 0.0.9", ] [[package]] name = "soroban-sdk-macros" -version = "21.7.2" +version = "22.0.0-rc.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da03fa00b8ca6e392f013359c06d790d2d379f9c8d6f8a6dfe563ec64311e5d3" +checksum = "00d1b8d96ccf53ea9c30d86352756cace630ca5c7e1200fff32ffc793bedd593" dependencies = [ "crate-git-revision 0.0.6", "darling", - "itertools 0.11.0", + "itertools 0.10.5", "proc-macro2", "quote", "rustc_version", @@ -5328,9 +5496,9 @@ dependencies = [ [[package]] name = "soroban-spec" -version = "21.7.2" +version = "22.0.0-rc.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64c723195463d8742bcb481520bd8b8325da66c39ea236ad46261e6af992e8a8" +checksum = "4603430fd36848da7189e758d7f3fe1d7bbfef024e8aad2230a8be8252a583c1" dependencies = [ "base64 0.13.1", "stellar-xdr", @@ -5354,9 +5522,9 @@ dependencies = [ [[package]] name = "soroban-spec-rust" -version = "21.7.2" +version = "22.0.0-rc.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0f1b0ec2af54e38f138910f09e101b100130efe625f69ece51c76dd4f06f8b2" +checksum = "f5d5f3fe5b27e0b1c1d9ecdff04c4e31f5cd4d12cdc052d54f0e4995cf637b9c" dependencies = [ "prettyplease", "proc-macro2", @@ -5439,22 +5607,26 @@ dependencies = [ [[package]] name = "soroban-token-sdk" -version = "21.7.2" +version = "22.0.0-rc.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c6ede0da76646037f3ea5db9ccd37830865444bb24f137cb8f0af8282c784f5" +checksum = "7baa9e15d0838973cfa0aa0eee6e0fa062bec2e4a115c82396f452fa6148d731" dependencies = [ "soroban-sdk", ] [[package]] name = "soroban-wasmi" -version = "0.31.1-soroban.20.0.1" +version = "0.36.1-soroban.22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "710403de32d0e0c35375518cb995d4fc056d0d48966f2e56ea471b8cb8fc9719" +checksum = "7044ea0ee6ff67039df1f232f0d3d98121f69a0409e944774912fc5f043c280f" dependencies = [ + "arrayvec", + "multi-stash", + "num-derive", + "num-traits", "smallvec", "spin", - "wasmi_arena", + "wasmi_collections", "wasmi_core", "wasmparser-nostd", ] @@ -5530,8 +5702,7 @@ dependencies = [ [[package]] name = "stellar-rpc-client" version = "21.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c735c8e456fa7c37f72dd2a6abc022a111b3bf9b0520d50eef091eb1336ad370" +source = "git+https://github.com/stellar/rs-stellar-rpc-client?branch=main#9f748334fffb2762db01b566dee455eea3095c79" dependencies = [ "clap", "hex", @@ -5542,8 +5713,9 @@ dependencies = [ "serde", "serde-aux", "serde_json", + "serde_with", "sha2 0.10.8", - "stellar-strkey 0.0.8", + "stellar-strkey 0.0.9", "stellar-xdr", "termcolor", "termcolor_output", @@ -5563,6 +5735,17 @@ dependencies = [ "thiserror", ] +[[package]] +name = "stellar-strkey" +version = "0.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e3aa3ed00e70082cb43febc1c2afa5056b9bb3e348bbb43d0cd0aa88a611144" +dependencies = [ + "crate-git-revision 0.0.6", + "data-encoding", + "thiserror", +] + [[package]] name = "stellar-strkey" version = "0.0.11" @@ -5575,9 +5758,9 @@ dependencies = [ [[package]] name = "stellar-xdr" -version = "21.2.0" +version = "22.0.0-rc.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2675a71212ed39a806e415b0dbf4702879ff288ec7f5ee996dda42a135512b50" +checksum = "c88dc0e928b9cb65ea43836b52560bb4ead3e32895f5019ca223dc7cd1966cbf" dependencies = [ "arbitrary", "base64 0.13.1", @@ -5589,10 +5772,21 @@ dependencies = [ "serde", "serde_json", "serde_with", - "stellar-strkey 0.0.8", + "stellar-strkey 0.0.9", "thiserror", ] +[[package]] +name = "string-interner" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c6a0d765f5807e98a091107bae0a56ea3799f66a5de47b2c84c94a39c09974e" +dependencies = [ + "cfg-if", + "hashbrown 0.14.5", + "serde", +] + [[package]] name = "string_cache" version = "0.8.7" @@ -6548,16 +6742,21 @@ dependencies = [ ] [[package]] -name = "wasmi_arena" -version = "0.4.1" +name = "wasmi_collections" +version = "0.36.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "104a7f73be44570cac297b3035d76b169d6599637631cf37a1703326a0727073" +checksum = "a1ee1cf2328e7fbb8654fda8449395c64c36ef5a30511e79fae0265a96e1a446" +dependencies = [ + "ahash", + "hashbrown 0.14.5", + "string-interner", +] [[package]] name = "wasmi_core" -version = "0.13.0" +version = "0.36.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf1a7db34bff95b85c261002720c00c3a6168256dcb93041d3fa2054d19856a" +checksum = "4e77c1e701d21edfd263e5c6c940861202c6b840c715040cfdca6211bf8857aa" dependencies = [ "downcast-rs", "libm", diff --git a/Cargo.toml b/Cargo.toml index 4cf12b4d9..448ae3767 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,17 +14,10 @@ exclude = ["cmd/crates/soroban-test/tests/fixtures/hello"] version = "21.5.0" rust-version = "1.81.0" -[workspace.dependencies.soroban-env-host] -version = "=21.2.1" - -[workspace.dependencies.soroban-simulation] -version = "=21.2.1" - -[workspace.dependencies.soroban-spec] -version = "=21.7.2" - -[workspace.dependencies.soroban-spec-rust] -version = "=21.7.2" +# Dependencies located in this repo: +[workspace.dependencies.soroban-cli] +version = "=21.5.0" +path = "cmd/soroban-cli" [workspace.dependencies.soroban-spec-json] version = "=21.5.0" @@ -38,27 +31,42 @@ path = "./cmd/crates/soroban-spec-typescript" version = "21.5.0" path = "./cmd/crates/soroban-spec-tools" +# Dependencies from the rs-stellar-xdr repo: +[workspace.dependencies.stellar-xdr] +version = "=22.0.0-rc.1.1" +default-features = true + +# Dependencies from the rs-soroban-env repo: +[workspace.dependencies.soroban-env-host] +version = "=22.0.0-rc.1.1" + +[workspace.dependencies.soroban-simulation] +version = "=22.0.0-rc.1.1" + +# Dependencies from the rs-soroban-sdk repo: +[workspace.dependencies.soroban-spec] +version = "=22.0.0-rc.1.1" + +[workspace.dependencies.soroban-spec-rust] +version = "=22.0.0-rc.1.1" + [workspace.dependencies.soroban-sdk] -version = "=21.7.2" +version = "=22.0.0-rc.1.1" [workspace.dependencies.soroban-token-sdk] -version = "=21.7.2" +version = "=22.0.0-rc.1.1" [workspace.dependencies.soroban-ledger-snapshot] -version = "=21.7.2" - -[workspace.dependencies.soroban-cli] -version = "=21.5.0" -path = "cmd/soroban-cli" +version = "=22.0.0-rc.1.1" +# Dependencies from the rs-stellar-rpc-client repo: [workspace.dependencies.soroban-rpc] package = "stellar-rpc-client" version = "21.4.0" +git = "https://github.com/stellar/rs-stellar-rpc-client" +branch = "main" -[workspace.dependencies.stellar-xdr] -version = "21.2.0" -default-features = true - +# Dependencies from elsewhere shared by crates: [workspace.dependencies] stellar-strkey = "0.0.11" sep5 = "0.0.4" @@ -70,11 +78,9 @@ hex = "0.4.3" itertools = "0.10.0" async-trait = "0.1.76" bollard = "0.16.0" - serde-aux = "4.1.2" serde_json = "1.0.82" serde = "1.0.82" - clap = { version = "4.1.8", features = [ "derive", "env", @@ -92,8 +98,6 @@ ulid = "1.1" termcolor = "1.1.3" termcolor_output = "1.0.1" ed25519-dalek = ">= 2.1.1" - -# networking http = "1.0.0" jsonrpsee-http-client = "0.20.1" jsonrpsee-core = "0.20.1" diff --git a/cmd/crates/soroban-spec-tools/src/contract.rs b/cmd/crates/soroban-spec-tools/src/contract.rs index 334b2425f..a0741d6f1 100644 --- a/cmd/crates/soroban-spec-tools/src/contract.rs +++ b/cmd/crates/soroban-spec-tools/src/contract.rs @@ -3,6 +3,7 @@ use std::{ fmt::Display, io::{self, Cursor}, }; +use stellar_xdr::curr::ScEnvMetaEntryInterfaceVersion; use soroban_env_host::xdr::{ self, Limited, Limits, ReadXdr, ScEnvMetaEntry, ScMetaEntry, ScMetaV0, ScSpecEntry, @@ -121,10 +122,16 @@ impl Display for Spec { writeln!(f, "Env Meta: {env_meta}")?; for env_meta_entry in &self.env_meta { match env_meta_entry { - ScEnvMetaEntry::ScEnvMetaKindInterfaceVersion(v) => { - let protocol = v >> 32; - let interface = v & 0xffff_ffff; - writeln!(f, " • Interface Version: {v} (protocol: {protocol}, interface: {interface})")?; + ScEnvMetaEntry::ScEnvMetaKindInterfaceVersion( + ScEnvMetaEntryInterfaceVersion { + protocol, + pre_release, + }, + ) => { + writeln!(f, " • Protocol Version: {protocol}")?; + if pre_release != &0 { + writeln!(f, " • Pre-release Version: {pre_release})")?; + } } } } diff --git a/cmd/crates/soroban-test/tests/fixtures/test-wasms/custom_account/src/lib.rs b/cmd/crates/soroban-test/tests/fixtures/test-wasms/custom_account/src/lib.rs index c71324110..062c1d1cf 100644 --- a/cmd/crates/soroban-test/tests/fixtures/test-wasms/custom_account/src/lib.rs +++ b/cmd/crates/soroban-test/tests/fixtures/test-wasms/custom_account/src/lib.rs @@ -115,7 +115,9 @@ impl CustomAccountInterface for Contract { return Err(Error::NotPermitted); } } - Context::CreateContractHostFn(_) => return Err(Error::InvalidContext), + Context::CreateContractHostFn(_) | Context::CreateContractWithCtorHostFn(_) => { + return Err(Error::InvalidContext) + } }; } diff --git a/cmd/soroban-cli/src/commands/contract/info/env_meta.rs b/cmd/soroban-cli/src/commands/contract/info/env_meta.rs index 03225c328..3b24d8da7 100644 --- a/cmd/soroban-cli/src/commands/contract/info/env_meta.rs +++ b/cmd/soroban-cli/src/commands/contract/info/env_meta.rs @@ -1,6 +1,7 @@ use std::fmt::Debug; use clap::{command, Parser}; +use soroban_sdk::xdr::ScEnvMetaEntryInterfaceVersion; use stellar_xdr::curr::ScEnvMetaEntry; use soroban_spec_tools::contract; @@ -54,12 +55,16 @@ impl Cmd { let mut meta_str = "Contract env-meta:\n".to_string(); for env_meta_entry in &spec.env_meta { match env_meta_entry { - ScEnvMetaEntry::ScEnvMetaKindInterfaceVersion(v) => { - let protocol = v >> 32; - let interface = v & 0xffff_ffff; + ScEnvMetaEntry::ScEnvMetaKindInterfaceVersion( + ScEnvMetaEntryInterfaceVersion { + protocol, + pre_release, + }, + ) => { meta_str.push_str(&format!(" • Protocol: v{protocol}\n")); - meta_str.push_str(&format!(" • Interface: v{interface}\n")); - meta_str.push_str(&format!(" • Interface Version: {v}\n")); + if pre_release != &0 { + meta_str.push_str(&format!(" • Pre-release: v{pre_release}\n")); + } } } } diff --git a/cmd/soroban-cli/src/commands/version.rs b/cmd/soroban-cli/src/commands/version.rs index 5e6d0e4dd..c2786467b 100644 --- a/cmd/soroban-cli/src/commands/version.rs +++ b/cmd/soroban-cli/src/commands/version.rs @@ -27,7 +27,18 @@ pub fn long() -> String { [ format!("{} ({})", pkg(), git()), format!("soroban-env {} ({})", env.pkg, env.rev), - format!("soroban-env interface version {}", meta::INTERFACE_VERSION), + format!( + "soroban-env protocol version {}", + meta::INTERFACE_VERSION.protocol + ), + (if meta::INTERFACE_VERSION.pre_release == 0 { + "soroban-env pre-release version n/a".to_string() + } else { + format!( + "soroban-env pre-release version {}", + meta::INTERFACE_VERSION.pre_release + ) + }), format!( "stellar-xdr {} ({}) xdr curr ({})", From 152f40a676fb0081f0eeb3f90405480076b4f275 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Oct 2024 10:11:10 +1000 Subject: [PATCH 02/15] fix --- .../tests/fixtures/test-wasms/hello_world/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/crates/soroban-test/tests/fixtures/test-wasms/hello_world/src/lib.rs b/cmd/crates/soroban-test/tests/fixtures/test-wasms/hello_world/src/lib.rs index 40006a1b7..b4b53c237 100644 --- a/cmd/crates/soroban-test/tests/fixtures/test-wasms/hello_world/src/lib.rs +++ b/cmd/crates/soroban-test/tests/fixtures/test-wasms/hello_world/src/lib.rs @@ -77,7 +77,7 @@ mod test { #[test] fn test_hello() { let env = Env::default(); - let contract_id = env.register_contract(None, Contract); + let contract_id = env.register(Contract, ()); let client = ContractClient::new(&env, &contract_id); let world = symbol_short!("world"); let res = client.hello(&world); From b9259d939e060e9e2c4b797a34e4462a6af3e67c Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Oct 2024 11:14:13 +1000 Subject: [PATCH 03/15] help --- FULL_HELP_DOCS.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/FULL_HELP_DOCS.md b/FULL_HELP_DOCS.md index be20ae24a..18cb53b4f 100644 --- a/FULL_HELP_DOCS.md +++ b/FULL_HELP_DOCS.md @@ -1636,6 +1636,7 @@ Decode and encode XDR * `guess` — Guess the XDR type * `decode` — Decode XDR * `encode` — Encode XDR +* `compare` — Compare two XDR values with each other * `version` — Print version information ###### **Arguments:** @@ -1774,6 +1775,31 @@ Encode XDR Default value: `single-base64` + Possible values: `single`, `single-base64`, `stream` + + + + +## `stellar xdr compare` + +Compare two XDR values with each other + +Outputs: `-1` when the left XDR value is less than the right XDR value, `0` when the left XDR value is equal to the right XDR value, `1` when the left XDR value is greater than the right XDR value + +**Usage:** `stellar xdr compare [OPTIONS] --type ` + +###### **Arguments:** + +* `` — XDR file to decode and compare with the right value +* `` — XDR file to decode and compare with the left value + +###### **Options:** + +* `--type ` — XDR type of both inputs +* `--input ` + + Default value: `single-base64` + Possible values: `single`, `single-base64` From 4b760956ab57a308055122b45ae4baeddfb44ea0 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Oct 2024 12:02:55 +1000 Subject: [PATCH 04/15] fix imports --- cmd/crates/soroban-spec-tools/Cargo.toml | 3 --- .../src/commands/contract/info/env_meta.rs | 12 +++++++----- .../src/commands/tx/new/set_trustline_flags.rs | 4 +--- cmd/soroban-cli/src/commands/tx/xdr.rs | 3 +-- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/cmd/crates/soroban-spec-tools/Cargo.toml b/cmd/crates/soroban-spec-tools/Cargo.toml index 514b82924..05733b5b8 100644 --- a/cmd/crates/soroban-spec-tools/Cargo.toml +++ b/cmd/crates/soroban-spec-tools/Cargo.toml @@ -29,9 +29,6 @@ hex = { workspace = true } wasmparser = { workspace = true } base64 = { workspace = true } thiserror = "1.0.31" -# soroban-ledger-snapshot = { workspace = true } -# soroban-sdk = { workspace = true } -# sep5 = { workspace = true } [dev-dependencies] diff --git a/cmd/soroban-cli/src/commands/contract/info/env_meta.rs b/cmd/soroban-cli/src/commands/contract/info/env_meta.rs index 3b24d8da7..bc2d03bc6 100644 --- a/cmd/soroban-cli/src/commands/contract/info/env_meta.rs +++ b/cmd/soroban-cli/src/commands/contract/info/env_meta.rs @@ -1,15 +1,17 @@ use std::fmt::Debug; use clap::{command, Parser}; -use soroban_sdk::xdr::ScEnvMetaEntryInterfaceVersion; -use stellar_xdr::curr::ScEnvMetaEntry; use soroban_spec_tools::contract; use soroban_spec_tools::contract::Spec; -use crate::commands::contract::info::env_meta::Error::{NoEnvMetaPresent, NoSACEnvMeta}; -use crate::commands::contract::info::shared; -use crate::commands::contract::info::shared::{fetch_wasm, MetasInfoOutput}; +use crate::{ + commands::contract::info::{ + env_meta::Error::{NoEnvMetaPresent, NoSACEnvMeta}, + shared::{self, fetch_wasm, MetasInfoOutput}, + }, + xdr::{ScEnvMetaEntry, ScEnvMetaEntryInterfaceVersion}, +}; #[derive(Parser, Debug, Clone)] pub struct Cmd { diff --git a/cmd/soroban-cli/src/commands/tx/new/set_trustline_flags.rs b/cmd/soroban-cli/src/commands/tx/new/set_trustline_flags.rs index 2955fe5b0..d9b70ecbd 100644 --- a/cmd/soroban-cli/src/commands/tx/new/set_trustline_flags.rs +++ b/cmd/soroban-cli/src/commands/tx/new/set_trustline_flags.rs @@ -1,8 +1,6 @@ use clap::{command, Parser}; -use soroban_sdk::xdr::{self}; - -use crate::{commands::tx, tx::builder}; +use crate::{commands::tx, tx::builder, xdr}; #[allow(clippy::struct_excessive_bools, clippy::doc_markdown)] #[derive(Parser, Debug, Clone)] diff --git a/cmd/soroban-cli/src/commands/tx/xdr.rs b/cmd/soroban-cli/src/commands/tx/xdr.rs index 71bd59af6..fcacce9ac 100644 --- a/cmd/soroban-cli/src/commands/tx/xdr.rs +++ b/cmd/soroban-cli/src/commands/tx/xdr.rs @@ -3,8 +3,7 @@ use std::{ path::PathBuf, }; -use soroban_env_host::xdr::ReadXdr; -use soroban_sdk::xdr::{Limits, Transaction, TransactionEnvelope, TransactionV1Envelope}; +use crate::xdr::{Limits, ReadXdr, Transaction, TransactionEnvelope, TransactionV1Envelope}; #[derive(Debug, thiserror::Error)] pub enum Error { From 1c84d6ecb04efe9eb0438fff1c7daca260d247fa Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Oct 2024 12:05:58 +1000 Subject: [PATCH 05/15] tidy --- cmd/crates/soroban-spec-tools/src/contract.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cmd/crates/soroban-spec-tools/src/contract.rs b/cmd/crates/soroban-spec-tools/src/contract.rs index a0741d6f1..c9f6f86ff 100644 --- a/cmd/crates/soroban-spec-tools/src/contract.rs +++ b/cmd/crates/soroban-spec-tools/src/contract.rs @@ -3,12 +3,11 @@ use std::{ fmt::Display, io::{self, Cursor}, }; -use stellar_xdr::curr::ScEnvMetaEntryInterfaceVersion; use soroban_env_host::xdr::{ - self, Limited, Limits, ReadXdr, ScEnvMetaEntry, ScMetaEntry, ScMetaV0, ScSpecEntry, - ScSpecFunctionV0, ScSpecUdtEnumV0, ScSpecUdtErrorEnumV0, ScSpecUdtStructV0, ScSpecUdtUnionV0, - StringM, WriteXdr, + self, Limited, Limits, ReadXdr, ScEnvMetaEntry, ScEnvMetaEntryInterfaceVersion, ScMetaEntry, + ScMetaV0, ScSpecEntry, ScSpecFunctionV0, ScSpecUdtEnumV0, ScSpecUdtErrorEnumV0, + ScSpecUdtStructV0, ScSpecUdtUnionV0, StringM, WriteXdr, }; pub struct Spec { From a874c45b887db05ac7cc802a39eec89415ca10a4 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Oct 2024 12:08:19 +1000 Subject: [PATCH 06/15] remove unnecessary double import for xdr --- Cargo.lock | 1 - cmd/crates/soroban-spec-tools/Cargo.toml | 1 - cmd/crates/soroban-spec-tools/src/contract.rs | 6 +++--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e229212ae..7a85ad931 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5545,7 +5545,6 @@ dependencies = [ "hex", "itertools 0.10.5", "serde_json", - "soroban-env-host", "soroban-spec", "stellar-strkey 0.0.11", "stellar-xdr", diff --git a/cmd/crates/soroban-spec-tools/Cargo.toml b/cmd/crates/soroban-spec-tools/Cargo.toml index 05733b5b8..42268cb31 100644 --- a/cmd/crates/soroban-spec-tools/Cargo.toml +++ b/cmd/crates/soroban-spec-tools/Cargo.toml @@ -20,7 +20,6 @@ crate-type = ["rlib"] soroban-spec = { workspace = true } stellar-strkey = { workspace = true } stellar-xdr = { workspace = true, features = ["curr", "std", "serde"] } -soroban-env-host = { workspace = true } serde_json = { workspace = true } itertools = { workspace = true } diff --git a/cmd/crates/soroban-spec-tools/src/contract.rs b/cmd/crates/soroban-spec-tools/src/contract.rs index c9f6f86ff..9984a19d1 100644 --- a/cmd/crates/soroban-spec-tools/src/contract.rs +++ b/cmd/crates/soroban-spec-tools/src/contract.rs @@ -4,9 +4,9 @@ use std::{ io::{self, Cursor}, }; -use soroban_env_host::xdr::{ - self, Limited, Limits, ReadXdr, ScEnvMetaEntry, ScEnvMetaEntryInterfaceVersion, ScMetaEntry, - ScMetaV0, ScSpecEntry, ScSpecFunctionV0, ScSpecUdtEnumV0, ScSpecUdtErrorEnumV0, +use stellar_xdr::curr::{ + self as xdr, Limited, Limits, ReadXdr, ScEnvMetaEntry, ScEnvMetaEntryInterfaceVersion, + ScMetaEntry, ScMetaV0, ScSpecEntry, ScSpecFunctionV0, ScSpecUdtEnumV0, ScSpecUdtErrorEnumV0, ScSpecUdtStructV0, ScSpecUdtUnionV0, StringM, WriteXdr, }; From ca8cc17ac421a428f695d8b3f05d85c9f66ed427 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Oct 2024 12:58:58 +1000 Subject: [PATCH 07/15] remove artificial dependencies on soroban-env-host --- Cargo.lock | 4 ---- Cargo.toml | 7 ------- cmd/crates/soroban-spec-tools/Cargo.toml | 1 - cmd/crates/soroban-test/Cargo.toml | 2 -- cmd/crates/soroban-test/src/wasm.rs | 2 +- .../soroban-test/tests/it/arg_parsing.rs | 2 +- .../soroban-test/tests/it/integration/tx.rs | 2 +- .../soroban-test/tests/it/integration/util.rs | 6 ++++-- cmd/crates/stellar-ledger/Cargo.toml | 1 - cmd/crates/stellar-ledger/src/lib.rs | 6 +++--- .../tests/test/emulator_tests.rs | 4 ++-- cmd/soroban-cli/Cargo.toml | 1 - .../src/commands/contract/arg_parsing.rs | 2 +- .../src/commands/contract/deploy/asset.rs | 19 ++++++------------- .../src/commands/contract/deploy/wasm.rs | 17 ++++++----------- .../src/commands/contract/extend.rs | 2 +- .../src/commands/contract/id/asset.rs | 2 +- .../src/commands/contract/id/wasm.rs | 2 +- .../src/commands/contract/info/shared.rs | 2 +- .../src/commands/contract/inspect.rs | 2 +- .../src/commands/contract/install.rs | 2 +- .../src/commands/contract/invoke.rs | 19 ++++++------------- cmd/soroban-cli/src/commands/contract/mod.rs | 6 +++--- cmd/soroban-cli/src/commands/contract/read.rs | 15 ++++----------- .../src/commands/contract/restore.rs | 2 +- cmd/soroban-cli/src/commands/events.rs | 2 +- cmd/soroban-cli/src/commands/tx/hash.rs | 2 +- cmd/soroban-cli/src/commands/txn_result.rs | 2 +- cmd/soroban-cli/src/commands/version.rs | 17 +---------------- cmd/soroban-cli/src/fee.rs | 2 +- cmd/soroban-cli/src/get_spec.rs | 6 ++---- cmd/soroban-cli/src/key.rs | 2 +- cmd/soroban-cli/src/lib.rs | 2 +- cmd/soroban-cli/src/log.rs | 5 +---- cmd/soroban-cli/src/log/auth.rs | 2 +- cmd/soroban-cli/src/log/budget.rs | 5 ----- cmd/soroban-cli/src/log/cost.rs | 2 +- cmd/soroban-cli/src/log/footprint.rs | 2 +- cmd/soroban-cli/src/log/host_event.rs | 7 ------- cmd/soroban-cli/src/print.rs | 2 +- cmd/soroban-cli/src/signer.rs | 2 +- cmd/soroban-cli/src/tx/builder/transaction.rs | 2 +- cmd/soroban-cli/src/utils.rs | 4 ++-- cmd/soroban-cli/src/wasm.rs | 2 +- 44 files changed, 64 insertions(+), 136 deletions(-) delete mode 100644 cmd/soroban-cli/src/log/budget.rs delete mode 100644 cmd/soroban-cli/src/log/host_event.rs diff --git a/Cargo.lock b/Cargo.lock index 7a85ad931..f4d763647 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5322,7 +5322,6 @@ dependencies = [ "serde_json", "sha2 0.10.8", "shlex", - "soroban-env-host", "soroban-ledger-snapshot", "soroban-sdk", "soroban-spec", @@ -5589,9 +5588,7 @@ dependencies = [ "serde_json", "sha2 0.10.8", "soroban-cli", - "soroban-env-host", "soroban-ledger-snapshot", - "soroban-sdk", "soroban-spec", "soroban-spec-tools", "stellar-rpc-client", @@ -5686,7 +5683,6 @@ dependencies = [ "serial_test", "sha2 0.9.9", "slip10", - "soroban-env-host", "soroban-spec", "stellar-rpc-client", "stellar-strkey 0.0.11", diff --git a/Cargo.toml b/Cargo.toml index 448ae3767..ef052c569 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,13 +36,6 @@ path = "./cmd/crates/soroban-spec-tools" version = "=22.0.0-rc.1.1" default-features = true -# Dependencies from the rs-soroban-env repo: -[workspace.dependencies.soroban-env-host] -version = "=22.0.0-rc.1.1" - -[workspace.dependencies.soroban-simulation] -version = "=22.0.0-rc.1.1" - # Dependencies from the rs-soroban-sdk repo: [workspace.dependencies.soroban-spec] version = "=22.0.0-rc.1.1" diff --git a/cmd/crates/soroban-spec-tools/Cargo.toml b/cmd/crates/soroban-spec-tools/Cargo.toml index 42268cb31..43da1bede 100644 --- a/cmd/crates/soroban-spec-tools/Cargo.toml +++ b/cmd/crates/soroban-spec-tools/Cargo.toml @@ -20,7 +20,6 @@ crate-type = ["rlib"] soroban-spec = { workspace = true } stellar-strkey = { workspace = true } stellar-xdr = { workspace = true, features = ["curr", "std", "serde"] } - serde_json = { workspace = true } itertools = { workspace = true } ethnum = { workspace = true } diff --git a/cmd/crates/soroban-test/Cargo.toml b/cmd/crates/soroban-test/Cargo.toml index a34b7c65c..b240494e4 100644 --- a/cmd/crates/soroban-test/Cargo.toml +++ b/cmd/crates/soroban-test/Cargo.toml @@ -17,12 +17,10 @@ crate-type = ["rlib", "cdylib"] [dependencies] -soroban-env-host = { workspace = true } soroban-spec = { workspace = true } soroban-spec-tools = { workspace = true } soroban-ledger-snapshot = { workspace = true } stellar-strkey = { workspace = true } -soroban-sdk = { workspace = true } sep5 = { workspace = true } soroban-cli = { workspace = true } soroban-rpc = { workspace = true } diff --git a/cmd/crates/soroban-test/src/wasm.rs b/cmd/crates/soroban-test/src/wasm.rs index d03114b93..3e473ed46 100644 --- a/cmd/crates/soroban-test/src/wasm.rs +++ b/cmd/crates/soroban-test/src/wasm.rs @@ -1,7 +1,7 @@ use std::{fmt::Display, fs, path::PathBuf}; use sha2::{Digest, Sha256}; -use soroban_env_host::xdr; +use soroban_cli::xdr; #[derive(thiserror::Error, Debug)] pub enum Error { diff --git a/cmd/crates/soroban-test/tests/it/arg_parsing.rs b/cmd/crates/soroban-test/tests/it/arg_parsing.rs index c245fd8c9..d25d22354 100644 --- a/cmd/crates/soroban-test/tests/it/arg_parsing.rs +++ b/cmd/crates/soroban-test/tests/it/arg_parsing.rs @@ -1,6 +1,6 @@ use crate::util::CUSTOM_TYPES; use serde_json::json; -use soroban_env_host::xdr::{ +use soroban_cli::xdr::{ ScBytes, ScSpecTypeBytesN, ScSpecTypeDef, ScSpecTypeOption, ScSpecTypeUdt, ScVal, }; use soroban_spec_tools::{from_string_primitive, Spec}; diff --git a/cmd/crates/soroban-test/tests/it/integration/tx.rs b/cmd/crates/soroban-test/tests/it/integration/tx.rs index 66c4b69fe..030ee8a8e 100644 --- a/cmd/crates/soroban-test/tests/it/integration/tx.rs +++ b/cmd/crates/soroban-test/tests/it/integration/tx.rs @@ -1,4 +1,4 @@ -use soroban_sdk::xdr::{Limits, ReadXdr, TransactionEnvelope, WriteXdr}; +use soroban_cli::xdr::{Limits, ReadXdr, TransactionEnvelope, WriteXdr}; use soroban_test::{AssertExt, TestEnv}; use crate::integration::util::{deploy_contract, DeployKind, HELLO_WORLD}; diff --git a/cmd/crates/soroban-test/tests/it/integration/util.rs b/cmd/crates/soroban-test/tests/it/integration/util.rs index 6feae7860..438428e38 100644 --- a/cmd/crates/soroban-test/tests/it/integration/util.rs +++ b/cmd/crates/soroban-test/tests/it/integration/util.rs @@ -1,5 +1,7 @@ -use soroban_cli::commands; -use soroban_sdk::xdr::{Limits, WriteXdr}; +use soroban_cli::{ + commands, + xdr::{Limits, WriteXdr}, +}; use soroban_test::{TestEnv, Wasm}; use std::fmt::Display; diff --git a/cmd/crates/stellar-ledger/Cargo.toml b/cmd/crates/stellar-ledger/Cargo.toml index b8894b71d..abf73c375 100644 --- a/cmd/crates/stellar-ledger/Cargo.toml +++ b/cmd/crates/stellar-ledger/Cargo.toml @@ -17,7 +17,6 @@ serde = "1.0.82" serde_derive = "1.0.82" serde_json = "1.0.82" sha2 = "0.9.9" -soroban-env-host = { workspace = true } ed25519-dalek = { workspace = true } stellar-strkey = { workspace = true } ledger-transport-hid = "0.10.0" diff --git a/cmd/crates/stellar-ledger/src/lib.rs b/cmd/crates/stellar-ledger/src/lib.rs index c74365af2..4000b8243 100644 --- a/cmd/crates/stellar-ledger/src/lib.rs +++ b/cmd/crates/stellar-ledger/src/lib.rs @@ -5,7 +5,7 @@ use ledger_transport_hid::{ LedgerHIDError, TransportNativeHID, }; -use soroban_env_host::xdr::{Hash, Transaction}; +use crate::xdr::{Hash, Transaction}; use std::vec; use stellar_strkey::DecodeError; use stellar_xdr::curr::{ @@ -312,10 +312,10 @@ mod test { use crate::Blob; use test_helpers::test::emulator_http_transport::EmulatorHttpTransport; - use soroban_env_host::xdr::Transaction; + use crate::xdr::Transaction; use std::vec; - use soroban_env_host::xdr::{self, Operation, OperationBody, Uint256}; + use crate::xdr::{self, Operation, OperationBody, Uint256}; use crate::{test_network_hash, Error, LedgerSigner}; diff --git a/cmd/crates/stellar-ledger/tests/test/emulator_tests.rs b/cmd/crates/stellar-ledger/tests/test/emulator_tests.rs index d45981eef..fe34d2611 100644 --- a/cmd/crates/stellar-ledger/tests/test/emulator_tests.rs +++ b/cmd/crates/stellar-ledger/tests/test/emulator_tests.rs @@ -1,8 +1,8 @@ use ledger_transport::Exchange; use once_cell::sync::Lazy; use serde::Deserialize; -use soroban_env_host::xdr::{self, Operation, OperationBody, Uint256}; -use soroban_env_host::xdr::{Hash, Transaction}; +use crate::xdr::{self, Operation, OperationBody, Uint256}; +use crate::xdr::{Hash, Transaction}; use std::ops::Range; use std::sync::Mutex; use std::vec; diff --git a/cmd/soroban-cli/Cargo.toml b/cmd/soroban-cli/Cargo.toml index 5f4cc7c5a..64ff7fbca 100644 --- a/cmd/soroban-cli/Cargo.toml +++ b/cmd/soroban-cli/Cargo.toml @@ -40,7 +40,6 @@ opt = ["dep:wasm-opt"] [dependencies] stellar-xdr = { workspace = true, features = ["cli"] } -soroban-env-host = { workspace = true } soroban-spec = { workspace = true } soroban-spec-json = { workspace = true } soroban-spec-rust = { workspace = true } diff --git a/cmd/soroban-cli/src/commands/contract/arg_parsing.rs b/cmd/soroban-cli/src/commands/contract/arg_parsing.rs index 4a8af47e2..2eb3c2696 100644 --- a/cmd/soroban-cli/src/commands/contract/arg_parsing.rs +++ b/cmd/soroban-cli/src/commands/contract/arg_parsing.rs @@ -8,7 +8,7 @@ use clap::value_parser; use ed25519_dalek::SigningKey; use heck::ToKebabCase; -use soroban_env_host::xdr::{ +use crate::xdr::{ self, Hash, InvokeContractArgs, ScAddress, ScSpecEntry, ScSpecFunctionV0, ScSpecTypeDef, ScVal, ScVec, }; diff --git a/cmd/soroban-cli/src/commands/contract/deploy/asset.rs b/cmd/soroban-cli/src/commands/contract/deploy/asset.rs index d2fcb62c4..c5e852847 100644 --- a/cmd/soroban-cli/src/commands/contract/deploy/asset.rs +++ b/cmd/soroban-cli/src/commands/contract/deploy/asset.rs @@ -1,13 +1,10 @@ -use clap::{arg, command, Parser}; -use soroban_env_host::{ - xdr::{ - Asset, ContractDataDurability, ContractExecutable, ContractIdPreimage, CreateContractArgs, - Error as XdrError, Hash, HostFunction, InvokeHostFunctionOp, LedgerKey::ContractData, - LedgerKeyContractData, Limits, Memo, MuxedAccount, Operation, OperationBody, Preconditions, - ScAddress, ScVal, SequenceNumber, Transaction, TransactionExt, VecM, WriteXdr, - }, - HostError, +use crate::xdr::{ + Asset, ContractDataDurability, ContractExecutable, ContractIdPreimage, CreateContractArgs, + Error as XdrError, Hash, HostFunction, InvokeHostFunctionOp, LedgerKey::ContractData, + LedgerKeyContractData, Limits, Memo, MuxedAccount, Operation, OperationBody, Preconditions, + ScAddress, ScVal, SequenceNumber, Transaction, TransactionExt, VecM, WriteXdr, }; +use clap::{arg, command, Parser}; use std::convert::Infallible; use std::{array::TryFromSliceError, fmt::Debug, num::ParseIntError}; @@ -25,10 +22,6 @@ use crate::{ #[derive(thiserror::Error, Debug)] pub enum Error { - #[error(transparent)] - // TODO: the Display impl of host errors is pretty user-unfriendly - // (it just calls Debug). I think we can do better than that - Host(#[from] HostError), #[error("error parsing int: {0}")] ParseIntError(#[from] ParseIntError), #[error(transparent)] diff --git a/cmd/soroban-cli/src/commands/contract/deploy/wasm.rs b/cmd/soroban-cli/src/commands/contract/deploy/wasm.rs index 42b31dd7d..45f85bac1 100644 --- a/cmd/soroban-cli/src/commands/contract/deploy/wasm.rs +++ b/cmd/soroban-cli/src/commands/contract/deploy/wasm.rs @@ -2,18 +2,15 @@ use std::array::TryFromSliceError; use std::fmt::Debug; use std::num::ParseIntError; +use crate::xdr::{ + AccountId, ContractExecutable, ContractIdPreimage, ContractIdPreimageFromAddress, + CreateContractArgs, Error as XdrError, Hash, HostFunction, InvokeHostFunctionOp, Limits, Memo, + MuxedAccount, Operation, OperationBody, Preconditions, PublicKey, ScAddress, SequenceNumber, + Transaction, TransactionExt, Uint256, VecM, WriteXdr, +}; use clap::{arg, command, Parser}; use rand::Rng; use regex::Regex; -use soroban_env_host::{ - xdr::{ - AccountId, ContractExecutable, ContractIdPreimage, ContractIdPreimageFromAddress, - CreateContractArgs, Error as XdrError, Hash, HostFunction, InvokeHostFunctionOp, Limits, - Memo, MuxedAccount, Operation, OperationBody, Preconditions, PublicKey, ScAddress, - SequenceNumber, Transaction, TransactionExt, Uint256, VecM, WriteXdr, - }, - HostError, -}; use crate::{ commands::{contract::install, HEADING_RPC}, @@ -69,8 +66,6 @@ pub struct Cmd { pub enum Error { #[error(transparent)] Install(#[from] install::Error), - #[error(transparent)] - Host(#[from] HostError), #[error("error parsing int: {0}")] ParseIntError(#[from] ParseIntError), #[error("internal conversion error: {0}")] diff --git a/cmd/soroban-cli/src/commands/contract/extend.rs b/cmd/soroban-cli/src/commands/contract/extend.rs index b06cacf3e..728f0e5b1 100644 --- a/cmd/soroban-cli/src/commands/contract/extend.rs +++ b/cmd/soroban-cli/src/commands/contract/extend.rs @@ -1,7 +1,7 @@ use std::{fmt::Debug, path::Path, str::FromStr}; use clap::{command, Parser}; -use soroban_env_host::xdr::{ +use crate::xdr::{ Error as XdrError, ExtendFootprintTtlOp, ExtensionPoint, LedgerEntry, LedgerEntryChange, LedgerEntryData, LedgerFootprint, Limits, Memo, Operation, OperationBody, Preconditions, SequenceNumber, SorobanResources, SorobanTransactionData, Transaction, TransactionExt, diff --git a/cmd/soroban-cli/src/commands/contract/id/asset.rs b/cmd/soroban-cli/src/commands/contract/id/asset.rs index 63b3017a1..06c3d2a48 100644 --- a/cmd/soroban-cli/src/commands/contract/id/asset.rs +++ b/cmd/soroban-cli/src/commands/contract/id/asset.rs @@ -20,7 +20,7 @@ pub enum Error { #[error(transparent)] ConfigError(#[from] config::Error), #[error(transparent)] - Xdr(#[from] soroban_env_host::xdr::Error), + Xdr(#[from] crate::xdr::Error), } impl Cmd { pub fn run(&self) -> Result<(), Error> { diff --git a/cmd/soroban-cli/src/commands/contract/id/wasm.rs b/cmd/soroban-cli/src/commands/contract/id/wasm.rs index c020e94b2..a840982dd 100644 --- a/cmd/soroban-cli/src/commands/contract/id/wasm.rs +++ b/cmd/soroban-cli/src/commands/contract/id/wasm.rs @@ -1,6 +1,6 @@ use clap::{arg, command, Parser}; use sha2::{Digest, Sha256}; -use soroban_env_host::xdr::{ +use crate::xdr::{ self, AccountId, ContractIdPreimage, ContractIdPreimageFromAddress, Hash, HashIdPreimage, HashIdPreimageContractId, Limits, PublicKey, ScAddress, Uint256, WriteXdr, }; diff --git a/cmd/soroban-cli/src/commands/contract/info/shared.rs b/cmd/soroban-cli/src/commands/contract/info/shared.rs index 25cbc9258..2413758ab 100644 --- a/cmd/soroban-cli/src/commands/contract/info/shared.rs +++ b/cmd/soroban-cli/src/commands/contract/info/shared.rs @@ -1,7 +1,7 @@ use std::path::PathBuf; use clap::arg; -use soroban_env_host::xdr; +use crate::xdr; use soroban_rpc::Client; use crate::commands::contract::info::shared::Error::InvalidWasmHash; diff --git a/cmd/soroban-cli/src/commands/contract/inspect.rs b/cmd/soroban-cli/src/commands/contract/inspect.rs index 36a1a2302..e37fa9cd5 100644 --- a/cmd/soroban-cli/src/commands/contract/inspect.rs +++ b/cmd/soroban-cli/src/commands/contract/inspect.rs @@ -1,5 +1,5 @@ use clap::{command, Parser}; -use soroban_env_host::xdr; +use crate::xdr; use soroban_spec_tools::contract; use std::{fmt::Debug, path::PathBuf}; use tracing::debug; diff --git a/cmd/soroban-cli/src/commands/contract/install.rs b/cmd/soroban-cli/src/commands/contract/install.rs index 9e8f6b098..aff0e9594 100644 --- a/cmd/soroban-cli/src/commands/contract/install.rs +++ b/cmd/soroban-cli/src/commands/contract/install.rs @@ -3,7 +3,7 @@ use std::fmt::Debug; use std::num::ParseIntError; use clap::{command, Parser}; -use soroban_env_host::xdr::{ +use crate::xdr::{ self, ContractCodeEntryExt, Error as XdrError, Hash, HostFunction, InvokeHostFunctionOp, LedgerEntryData, Limits, OperationBody, ReadXdr, ScMetaEntry, ScMetaV0, Transaction, TransactionResult, TransactionResultResult, VecM, WriteXdr, diff --git a/cmd/soroban-cli/src/commands/contract/invoke.rs b/cmd/soroban-cli/src/commands/contract/invoke.rs index fa90ef9b3..ae247b8fa 100644 --- a/cmd/soroban-cli/src/commands/contract/invoke.rs +++ b/cmd/soroban-cli/src/commands/contract/invoke.rs @@ -7,15 +7,12 @@ use std::{fmt::Debug, fs, io}; use clap::{arg, command, Parser, ValueEnum}; -use soroban_env_host::{ - xdr::{ - self, AccountEntry, AccountEntryExt, AccountId, ContractEvent, ContractEventType, - DiagnosticEvent, HostFunction, InvokeContractArgs, InvokeHostFunctionOp, LedgerEntryData, - Limits, Memo, MuxedAccount, Operation, OperationBody, Preconditions, PublicKey, - ScSpecEntry, SequenceNumber, String32, StringM, Thresholds, Transaction, TransactionExt, - Uint256, VecM, WriteXdr, - }, - HostError, +use crate::xdr::{ + self, AccountEntry, AccountEntryExt, AccountId, ContractEvent, ContractEventType, + DiagnosticEvent, HostFunction, InvokeContractArgs, InvokeHostFunctionOp, LedgerEntryData, + Limits, Memo, MuxedAccount, Operation, OperationBody, Preconditions, PublicKey, ScSpecEntry, + SequenceNumber, String32, StringM, Thresholds, Transaction, TransactionExt, Uint256, VecM, + WriteXdr, }; use soroban_rpc::{SimulateHostFunctionResult, SimulateTransactionResponse}; @@ -79,10 +76,6 @@ impl Pwd for Cmd { pub enum Error { #[error("cannot add contract to ledger entries: {0}")] CannotAddContractToLedgerEntries(xdr::Error), - #[error(transparent)] - // TODO: the Display impl of host errors is pretty user-unfriendly - // (it just calls Debug). I think we can do better than that - Host(#[from] HostError), #[error("reading file {0:?}: {1}")] CannotReadContractFile(PathBuf, io::Error), #[error("committing file {filepath}: {error}")] diff --git a/cmd/soroban-cli/src/commands/contract/mod.rs b/cmd/soroban-cli/src/commands/contract/mod.rs index 761784de9..c4789529a 100644 --- a/cmd/soroban-cli/src/commands/contract/mod.rs +++ b/cmd/soroban-cli/src/commands/contract/mod.rs @@ -167,11 +167,11 @@ pub enum Durability { Temporary, } -impl From<&Durability> for soroban_env_host::xdr::ContractDataDurability { +impl From<&Durability> for crate::xdr::ContractDataDurability { fn from(d: &Durability) -> Self { match d { - Durability::Persistent => soroban_env_host::xdr::ContractDataDurability::Persistent, - Durability::Temporary => soroban_env_host::xdr::ContractDataDurability::Temporary, + Durability::Persistent => crate::xdr::ContractDataDurability::Persistent, + Durability::Temporary => crate::xdr::ContractDataDurability::Temporary, } } } diff --git a/cmd/soroban-cli/src/commands/contract/read.rs b/cmd/soroban-cli/src/commands/contract/read.rs index 3cb253bb1..3c26a956e 100644 --- a/cmd/soroban-cli/src/commands/contract/read.rs +++ b/cmd/soroban-cli/src/commands/contract/read.rs @@ -3,14 +3,11 @@ use std::{ io::{self, stdout}, }; -use clap::{command, Parser, ValueEnum}; -use soroban_env_host::{ - xdr::{ - ContractDataEntry, Error as XdrError, LedgerEntryData, LedgerKey, LedgerKeyContractData, - Limits, ScVal, WriteXdr, - }, - HostError, +use crate::xdr::{ + ContractDataEntry, Error as XdrError, LedgerEntryData, LedgerKey, LedgerKeyContractData, + Limits, ScVal, WriteXdr, }; +use clap::{command, Parser, ValueEnum}; use crate::{ commands::{global, NetworkRunnable}, @@ -77,10 +74,6 @@ pub enum Error { Rpc(#[from] rpc::Error), #[error(transparent)] Xdr(#[from] XdrError), - #[error(transparent)] - // TODO: the Display impl of host errors is pretty user-unfriendly - // (it just calls Debug). I think we can do better than that - Host(#[from] HostError), #[error("no matching contract data entries were found for the specified contract id")] NoContractDataEntryFoundForContractID, #[error(transparent)] diff --git a/cmd/soroban-cli/src/commands/contract/restore.rs b/cmd/soroban-cli/src/commands/contract/restore.rs index 05fa90695..f5617dd27 100644 --- a/cmd/soroban-cli/src/commands/contract/restore.rs +++ b/cmd/soroban-cli/src/commands/contract/restore.rs @@ -1,7 +1,7 @@ use std::{fmt::Debug, path::Path, str::FromStr}; use clap::{command, Parser}; -use soroban_env_host::xdr::{ +use crate::xdr::{ Error as XdrError, ExtensionPoint, LedgerEntry, LedgerEntryChange, LedgerEntryData, LedgerFootprint, Limits, Memo, Operation, OperationBody, OperationMeta, Preconditions, RestoreFootprintOp, SequenceNumber, SorobanResources, SorobanTransactionData, Transaction, diff --git a/cmd/soroban-cli/src/commands/events.rs b/cmd/soroban-cli/src/commands/events.rs index 5e2bda66f..0c4cfcc0e 100644 --- a/cmd/soroban-cli/src/commands/events.rs +++ b/cmd/soroban-cli/src/commands/events.rs @@ -1,7 +1,7 @@ use clap::{arg, command, Parser}; use std::io; -use soroban_env_host::xdr::{self, Limits, ReadXdr}; +use crate::xdr::{self, Limits, ReadXdr}; use super::{global, NetworkRunnable}; use crate::config::{self, locator, network}; diff --git a/cmd/soroban-cli/src/commands/tx/hash.rs b/cmd/soroban-cli/src/commands/tx/hash.rs index 8d8ec6d82..c422302f6 100644 --- a/cmd/soroban-cli/src/commands/tx/hash.rs +++ b/cmd/soroban-cli/src/commands/tx/hash.rs @@ -7,7 +7,7 @@ pub enum Error { #[error(transparent)] TxEnvelopeFromStdin(#[from] super::xdr::Error), #[error(transparent)] - XdrToBase64(#[from] soroban_env_host::xdr::Error), + XdrToBase64(#[from] crate::xdr::Error), #[error(transparent)] Config(#[from] network::Error), } diff --git a/cmd/soroban-cli/src/commands/txn_result.rs b/cmd/soroban-cli/src/commands/txn_result.rs index 08482e94f..d6b308b3a 100644 --- a/cmd/soroban-cli/src/commands/txn_result.rs +++ b/cmd/soroban-cli/src/commands/txn_result.rs @@ -1,4 +1,4 @@ -use soroban_env_host::xdr::{Transaction, TransactionEnvelope, TransactionV1Envelope, VecM}; +use crate::xdr::{Transaction, TransactionEnvelope, TransactionV1Envelope, VecM}; #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)] pub enum TxnResult { diff --git a/cmd/soroban-cli/src/commands/version.rs b/cmd/soroban-cli/src/commands/version.rs index c2786467b..f785399e9 100644 --- a/cmd/soroban-cli/src/commands/version.rs +++ b/cmd/soroban-cli/src/commands/version.rs @@ -1,5 +1,4 @@ use clap::Parser; -use soroban_env_host::meta; use std::fmt::Debug; #[derive(Parser, Debug, Clone)] @@ -22,23 +21,9 @@ pub fn git() -> &'static str { } pub fn long() -> String { - let env = soroban_env_host::VERSION; - let xdr = soroban_env_host::VERSION.xdr; + let xdr = stellar_xdr::VERSION; [ format!("{} ({})", pkg(), git()), - format!("soroban-env {} ({})", env.pkg, env.rev), - format!( - "soroban-env protocol version {}", - meta::INTERFACE_VERSION.protocol - ), - (if meta::INTERFACE_VERSION.pre_release == 0 { - "soroban-env pre-release version n/a".to_string() - } else { - format!( - "soroban-env pre-release version {}", - meta::INTERFACE_VERSION.pre_release - ) - }), format!( "stellar-xdr {} ({}) xdr curr ({})", diff --git a/cmd/soroban-cli/src/fee.rs b/cmd/soroban-cli/src/fee.rs index 698d66007..600b7e0b1 100644 --- a/cmd/soroban-cli/src/fee.rs +++ b/cmd/soroban-cli/src/fee.rs @@ -1,6 +1,6 @@ use clap::arg; -use soroban_env_host::xdr; +use crate::xdr; use soroban_rpc::Assembled; use crate::commands::HEADING_RPC; diff --git a/cmd/soroban-cli/src/get_spec.rs b/cmd/soroban-cli/src/get_spec.rs index 125fa984c..26e609543 100644 --- a/cmd/soroban-cli/src/get_spec.rs +++ b/cmd/soroban-cli/src/get_spec.rs @@ -1,8 +1,6 @@ -use soroban_env_host::xdr; +use crate::xdr; -use soroban_env_host::xdr::{ - ContractDataEntry, ContractExecutable, ScContractInstance, ScSpecEntry, ScVal, -}; +use crate::xdr::{ContractDataEntry, ContractExecutable, ScContractInstance, ScSpecEntry, ScVal}; use soroban_spec::read::FromWasmError; pub use soroban_spec_tools::contract as contract_spec; diff --git a/cmd/soroban-cli/src/key.rs b/cmd/soroban-cli/src/key.rs index b4fd358aa..6c236c1a4 100644 --- a/cmd/soroban-cli/src/key.rs +++ b/cmd/soroban-cli/src/key.rs @@ -4,7 +4,7 @@ use crate::{ wasm, }; use clap::arg; -use soroban_env_host::xdr::{ +use crate::xdr::{ self, LedgerKey, LedgerKeyContractCode, LedgerKeyContractData, Limits, ReadXdr, ScAddress, ScVal, }; diff --git a/cmd/soroban-cli/src/lib.rs b/cmd/soroban-cli/src/lib.rs index f5ea21884..14807dac6 100644 --- a/cmd/soroban-cli/src/lib.rs +++ b/cmd/soroban-cli/src/lib.rs @@ -5,8 +5,8 @@ )] use std::path::Path; -pub(crate) use soroban_env_host::xdr; pub(crate) use soroban_rpc as rpc; +pub use stellar_xdr::curr as xdr; mod cli; pub use cli::main; diff --git a/cmd/soroban-cli/src/log.rs b/cmd/soroban-cli/src/log.rs index 28ed4041b..1a1c27035 100644 --- a/cmd/soroban-cli/src/log.rs +++ b/cmd/soroban-cli/src/log.rs @@ -1,17 +1,14 @@ use crate::xdr; + pub mod auth; -pub mod budget; pub mod cost; pub mod event; pub mod footprint; -pub mod host_event; pub use auth::*; -pub use budget::*; pub use cost::*; pub use event::*; pub use footprint::*; -pub use host_event::*; pub fn extract_events(tx_meta: &xdr::TransactionMeta) -> Vec { match tx_meta { diff --git a/cmd/soroban-cli/src/log/auth.rs b/cmd/soroban-cli/src/log/auth.rs index c37e7ed3e..4a6b4bea8 100644 --- a/cmd/soroban-cli/src/log/auth.rs +++ b/cmd/soroban-cli/src/log/auth.rs @@ -1,4 +1,4 @@ -use soroban_env_host::xdr::{SorobanAuthorizationEntry, VecM}; +use crate::xdr::{SorobanAuthorizationEntry, VecM}; pub fn auth(auth: &[VecM]) { if !auth.is_empty() { diff --git a/cmd/soroban-cli/src/log/budget.rs b/cmd/soroban-cli/src/log/budget.rs deleted file mode 100644 index 59ff4aad4..000000000 --- a/cmd/soroban-cli/src/log/budget.rs +++ /dev/null @@ -1,5 +0,0 @@ -use soroban_env_host::budget::Budget; - -pub fn budget(budget: &Budget) { - tracing::debug!("{budget:#?}"); -} diff --git a/cmd/soroban-cli/src/log/cost.rs b/cmd/soroban-cli/src/log/cost.rs index 3e049a6cd..8dfc18df6 100644 --- a/cmd/soroban-cli/src/log/cost.rs +++ b/cmd/soroban-cli/src/log/cost.rs @@ -1,4 +1,4 @@ -use soroban_env_host::xdr::SorobanResources; +use crate::xdr::SorobanResources; use std::fmt::{Debug, Display}; struct Cost<'a>(&'a SorobanResources); diff --git a/cmd/soroban-cli/src/log/footprint.rs b/cmd/soroban-cli/src/log/footprint.rs index bfbc9f7a3..7c351de1d 100644 --- a/cmd/soroban-cli/src/log/footprint.rs +++ b/cmd/soroban-cli/src/log/footprint.rs @@ -1,4 +1,4 @@ -use soroban_env_host::xdr::LedgerFootprint; +use crate::xdr::LedgerFootprint; pub fn footprint(footprint: &LedgerFootprint) { tracing::debug!("{footprint:#?}"); diff --git a/cmd/soroban-cli/src/log/host_event.rs b/cmd/soroban-cli/src/log/host_event.rs deleted file mode 100644 index 4238a74c3..000000000 --- a/cmd/soroban-cli/src/log/host_event.rs +++ /dev/null @@ -1,7 +0,0 @@ -use soroban_env_host::events::HostEvent; - -pub fn host_events(events: &[HostEvent]) { - for (i, event) in events.iter().enumerate() { - tracing::info!("{i}: {event:#?}"); - } -} diff --git a/cmd/soroban-cli/src/print.rs b/cmd/soroban-cli/src/print.rs index 5b98687bd..5b8ca2bd2 100644 --- a/cmd/soroban-cli/src/print.rs +++ b/cmd/soroban-cli/src/print.rs @@ -1,6 +1,6 @@ use std::{env, fmt::Display}; -use soroban_env_host::xdr::{Error as XdrError, Transaction}; +use crate::xdr::{Error as XdrError, Transaction}; use crate::{ config::network::Network, utils::explorer_url_for_transaction, utils::transaction_hash, diff --git a/cmd/soroban-cli/src/signer.rs b/cmd/soroban-cli/src/signer.rs index bf02fdb17..5bf22499c 100644 --- a/cmd/soroban-cli/src/signer.rs +++ b/cmd/soroban-cli/src/signer.rs @@ -1,7 +1,7 @@ use ed25519_dalek::ed25519::signature::Signer as _; use sha2::{Digest, Sha256}; -use soroban_env_host::xdr::{ +use crate::xdr::{ self, AccountId, DecoratedSignature, Hash, HashIdPreimage, HashIdPreimageSorobanAuthorization, InvokeHostFunctionOp, Limits, Operation, OperationBody, PublicKey, ScAddress, ScMap, ScSymbol, ScVal, Signature, SignatureHint, SorobanAddressCredentials, SorobanAuthorizationEntry, diff --git a/cmd/soroban-cli/src/tx/builder/transaction.rs b/cmd/soroban-cli/src/tx/builder/transaction.rs index 51232d5c5..7cd922679 100644 --- a/cmd/soroban-cli/src/tx/builder/transaction.rs +++ b/cmd/soroban-cli/src/tx/builder/transaction.rs @@ -28,7 +28,7 @@ impl TxExt for xdr::Transaction { source_account, fee, seq_num: seq_num.into(), - cond: soroban_env_host::xdr::Preconditions::None, + cond: crate::xdr::Preconditions::None, memo: Memo::None, operations: [operation].try_into().unwrap(), ext: TransactionExt::V0, diff --git a/cmd/soroban-cli/src/utils.rs b/cmd/soroban-cli/src/utils.rs index 8d0090042..bc1936ddd 100644 --- a/cmd/soroban-cli/src/utils.rs +++ b/cmd/soroban-cli/src/utils.rs @@ -2,7 +2,7 @@ use phf::phf_map; use sha2::{Digest, Sha256}; use stellar_strkey::ed25519::PrivateKey; -use soroban_env_host::xdr::{ +use crate::xdr::{ self, Asset, ContractIdPreimage, Hash, HashIdPreimage, HashIdPreimageContractId, Limits, ScMap, ScMapEntry, ScVal, Transaction, TransactionSignaturePayload, TransactionSignaturePayloadTaggedTransaction, WriteXdr, @@ -162,7 +162,7 @@ pub fn get_name_from_stellar_asset_contract_storage(storage: &ScMap) -> Option Date: Thu, 3 Oct 2024 13:01:56 +1000 Subject: [PATCH 08/15] remove obsolete dep relationship checks --- .github/workflows/dependency-check.yml | 6 --- scripts/check-dependencies.bash | 61 -------------------------- 2 files changed, 67 deletions(-) delete mode 100755 scripts/check-dependencies.bash diff --git a/.github/workflows/dependency-check.yml b/.github/workflows/dependency-check.yml index cef838a7c..fe8c0e8bc 100644 --- a/.github/workflows/dependency-check.yml +++ b/.github/workflows/dependency-check.yml @@ -14,12 +14,6 @@ defaults: shell: bash jobs: - dependency-sanity-checker: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - run: rustup update - - run: scripts/check-dependencies.bash validate-rust-git-rev-deps: runs-on: ubuntu-latest steps: diff --git a/scripts/check-dependencies.bash b/scripts/check-dependencies.bash deleted file mode 100755 index c82d2f2b1..000000000 --- a/scripts/check-dependencies.bash +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash - -set -e - -SED=sed -if [ -z "$(sed --version 2>&1 | grep GNU)" ]; then - SED=gsed -fi - -CURL="curl -sL --fail-with-body" -if ! CARGO_OUTPUT=$(cargo tree -p soroban-env-host 2>&1); then - echo "The project depends on multiple versions of the soroban-env-host Rust library, please unify them." - echo "Make sure the soroban-sdk dependency indirectly points to the same soroban-env-host dependency imported explicitly." - echo - echo "This is soroban-env-host version imported by soroban-sdk:" - cargo tree --depth 1 -p soroban-sdk | grep env-host - echo - echo - echo - echo "Full error:" - echo $CARGO_OUTPUT - exit 1 -fi - -# revision of the https://github.com/stellar/rs-stellar-xdr library used by the Rust code -RS_STELLAR_XDR_REVISION="" - -# revision of https://github.com/stellar/stellar-xdr/ used by the Rust code -STELLAR_XDR_REVISION_FROM_RUST="" - -function stellar_xdr_version_from_rust_dep_tree { - LINE=$(grep stellar-xdr | head -n 1) - # try to obtain a commit - COMMIT=$(echo $LINE | $SED -n 's/.*rev=\(.*\)#.*/\1/p') - if [ -n "$COMMIT" ]; then - echo "$COMMIT" - return - fi - # obtain a crate version - echo $LINE | $SED -n 's/.*stellar-xdr \(v\)\{0,1\}\([^ ]*\).*/\2/p' -} - -if CARGO_OUTPUT=$(cargo tree --depth 0 -p stellar-xdr 2>&1); then - RS_STELLAR_XDR_REVISION=$(echo "$CARGO_OUTPUT" | stellar_xdr_version_from_rust_dep_tree) - if [ ${#RS_STELLAR_XDR_REVISION} -eq 40 ]; then - # revision is a git hash - STELLAR_XDR_REVISION_FROM_RUST=$($CURL https://raw.githubusercontent.com/stellar/rs-stellar-xdr/${RS_STELLAR_XDR_REVISION}/xdr/curr-version) - else - # revision is a crate version - CARGO_SRC_BASE_DIR=$(realpath ${CARGO_HOME:-$HOME/.cargo}/registry/src/index*) - STELLAR_XDR_REVISION_FROM_RUST=$(cat "${CARGO_SRC_BASE_DIR}/stellar-xdr-${RS_STELLAR_XDR_REVISION}/xdr/curr-version") - fi -else - echo "The project depends on multiple versions of the Rust rs-stellar-xdr library" - echo "Make sure a single version of stellar-xdr is used" - echo - echo - echo - echo "Full error:" - echo $CARGO_OUTPUT -fi From b40a940085e237cb301d9291d70e862b11b20e60 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Oct 2024 13:39:19 +1000 Subject: [PATCH 09/15] fmt --- cmd/crates/stellar-ledger/tests/test/emulator_tests.rs | 4 ++-- cmd/soroban-cli/src/commands/contract/extend.rs | 2 +- cmd/soroban-cli/src/commands/contract/id/wasm.rs | 4 ++-- cmd/soroban-cli/src/commands/contract/info/shared.rs | 2 +- cmd/soroban-cli/src/commands/contract/inspect.rs | 2 +- cmd/soroban-cli/src/commands/contract/install.rs | 2 +- cmd/soroban-cli/src/commands/contract/restore.rs | 2 +- cmd/soroban-cli/src/key.rs | 8 ++++---- cmd/soroban-cli/src/wasm.rs | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/cmd/crates/stellar-ledger/tests/test/emulator_tests.rs b/cmd/crates/stellar-ledger/tests/test/emulator_tests.rs index fe34d2611..ae9c12f06 100644 --- a/cmd/crates/stellar-ledger/tests/test/emulator_tests.rs +++ b/cmd/crates/stellar-ledger/tests/test/emulator_tests.rs @@ -1,8 +1,8 @@ +use crate::xdr::{self, Operation, OperationBody, Uint256}; +use crate::xdr::{Hash, Transaction}; use ledger_transport::Exchange; use once_cell::sync::Lazy; use serde::Deserialize; -use crate::xdr::{self, Operation, OperationBody, Uint256}; -use crate::xdr::{Hash, Transaction}; use std::ops::Range; use std::sync::Mutex; use std::vec; diff --git a/cmd/soroban-cli/src/commands/contract/extend.rs b/cmd/soroban-cli/src/commands/contract/extend.rs index 728f0e5b1..7a5bf3ab4 100644 --- a/cmd/soroban-cli/src/commands/contract/extend.rs +++ b/cmd/soroban-cli/src/commands/contract/extend.rs @@ -1,12 +1,12 @@ use std::{fmt::Debug, path::Path, str::FromStr}; -use clap::{command, Parser}; use crate::xdr::{ Error as XdrError, ExtendFootprintTtlOp, ExtensionPoint, LedgerEntry, LedgerEntryChange, LedgerEntryData, LedgerFootprint, Limits, Memo, Operation, OperationBody, Preconditions, SequenceNumber, SorobanResources, SorobanTransactionData, Transaction, TransactionExt, TransactionMeta, TransactionMetaV3, TtlEntry, WriteXdr, }; +use clap::{command, Parser}; use crate::{ commands::{ diff --git a/cmd/soroban-cli/src/commands/contract/id/wasm.rs b/cmd/soroban-cli/src/commands/contract/id/wasm.rs index a840982dd..349dd167b 100644 --- a/cmd/soroban-cli/src/commands/contract/id/wasm.rs +++ b/cmd/soroban-cli/src/commands/contract/id/wasm.rs @@ -1,9 +1,9 @@ -use clap::{arg, command, Parser}; -use sha2::{Digest, Sha256}; use crate::xdr::{ self, AccountId, ContractIdPreimage, ContractIdPreimageFromAddress, Hash, HashIdPreimage, HashIdPreimageContractId, Limits, PublicKey, ScAddress, Uint256, WriteXdr, }; +use clap::{arg, command, Parser}; +use sha2::{Digest, Sha256}; use crate::config; diff --git a/cmd/soroban-cli/src/commands/contract/info/shared.rs b/cmd/soroban-cli/src/commands/contract/info/shared.rs index 2413758ab..4113f7d5b 100644 --- a/cmd/soroban-cli/src/commands/contract/info/shared.rs +++ b/cmd/soroban-cli/src/commands/contract/info/shared.rs @@ -1,7 +1,7 @@ use std::path::PathBuf; -use clap::arg; use crate::xdr; +use clap::arg; use soroban_rpc::Client; use crate::commands::contract::info::shared::Error::InvalidWasmHash; diff --git a/cmd/soroban-cli/src/commands/contract/inspect.rs b/cmd/soroban-cli/src/commands/contract/inspect.rs index e37fa9cd5..dab9d0445 100644 --- a/cmd/soroban-cli/src/commands/contract/inspect.rs +++ b/cmd/soroban-cli/src/commands/contract/inspect.rs @@ -1,5 +1,5 @@ -use clap::{command, Parser}; use crate::xdr; +use clap::{command, Parser}; use soroban_spec_tools::contract; use std::{fmt::Debug, path::PathBuf}; use tracing::debug; diff --git a/cmd/soroban-cli/src/commands/contract/install.rs b/cmd/soroban-cli/src/commands/contract/install.rs index aff0e9594..6ef9ab22e 100644 --- a/cmd/soroban-cli/src/commands/contract/install.rs +++ b/cmd/soroban-cli/src/commands/contract/install.rs @@ -2,12 +2,12 @@ use std::array::TryFromSliceError; use std::fmt::Debug; use std::num::ParseIntError; -use clap::{command, Parser}; use crate::xdr::{ self, ContractCodeEntryExt, Error as XdrError, Hash, HostFunction, InvokeHostFunctionOp, LedgerEntryData, Limits, OperationBody, ReadXdr, ScMetaEntry, ScMetaV0, Transaction, TransactionResult, TransactionResultResult, VecM, WriteXdr, }; +use clap::{command, Parser}; use super::restore; use crate::commands::txn_result::{TxnEnvelopeResult, TxnResult}; diff --git a/cmd/soroban-cli/src/commands/contract/restore.rs b/cmd/soroban-cli/src/commands/contract/restore.rs index f5617dd27..627fd3eee 100644 --- a/cmd/soroban-cli/src/commands/contract/restore.rs +++ b/cmd/soroban-cli/src/commands/contract/restore.rs @@ -1,12 +1,12 @@ use std::{fmt::Debug, path::Path, str::FromStr}; -use clap::{command, Parser}; use crate::xdr::{ Error as XdrError, ExtensionPoint, LedgerEntry, LedgerEntryChange, LedgerEntryData, LedgerFootprint, Limits, Memo, Operation, OperationBody, OperationMeta, Preconditions, RestoreFootprintOp, SequenceNumber, SorobanResources, SorobanTransactionData, Transaction, TransactionExt, TransactionMeta, TransactionMetaV3, TtlEntry, WriteXdr, }; +use clap::{command, Parser}; use stellar_strkey::DecodeError; use crate::{ diff --git a/cmd/soroban-cli/src/key.rs b/cmd/soroban-cli/src/key.rs index 6c236c1a4..3f4dcaf7c 100644 --- a/cmd/soroban-cli/src/key.rs +++ b/cmd/soroban-cli/src/key.rs @@ -1,13 +1,13 @@ +use crate::xdr::{ + self, LedgerKey, LedgerKeyContractCode, LedgerKeyContractData, Limits, ReadXdr, ScAddress, + ScVal, +}; use crate::{ commands::contract::Durability, config::{locator, network::Network}, wasm, }; use clap::arg; -use crate::xdr::{ - self, LedgerKey, LedgerKeyContractCode, LedgerKeyContractData, Limits, ReadXdr, ScAddress, - ScVal, -}; use std::path::PathBuf; #[derive(thiserror::Error, Debug)] diff --git a/cmd/soroban-cli/src/wasm.rs b/cmd/soroban-cli/src/wasm.rs index 0c346fe12..bc202a4b3 100644 --- a/cmd/soroban-cli/src/wasm.rs +++ b/cmd/soroban-cli/src/wasm.rs @@ -1,8 +1,8 @@ use crate::config::locator; use crate::config::network::Network; +use crate::xdr::{self, Hash, LedgerKey, LedgerKeyContractCode}; use clap::arg; use sha2::{Digest, Sha256}; -use crate::xdr::{self, Hash, LedgerKey, LedgerKeyContractCode}; use soroban_rpc::Client; use soroban_spec_tools::contract::{self, Spec}; use std::{ From 612e60f2c03f2ef00da1a6b7024b87a6f4f73a9d Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Oct 2024 13:43:20 +1000 Subject: [PATCH 10/15] fix --- Cargo.toml | 2 +- cmd/crates/stellar-ledger/src/lib.rs | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ef052c569..95e7fdc31 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ members = [ "cmd/crates/soroban-test/tests/fixtures/test-wasms/*", "cmd/crates/soroban-test/tests/fixtures/hello", ] -default-members = ["cmd/soroban-cli", "cmd/crates/soroban-spec-tools", "cmd/crates/soroban-test"] +# default-members = ["cmd/soroban-cli", "cmd/crates/soroban-spec-tools", "cmd/crates/soroban-test"] exclude = ["cmd/crates/soroban-test/tests/fixtures/hello"] [workspace.package] diff --git a/cmd/crates/stellar-ledger/src/lib.rs b/cmd/crates/stellar-ledger/src/lib.rs index 4000b8243..e90c31bb9 100644 --- a/cmd/crates/stellar-ledger/src/lib.rs +++ b/cmd/crates/stellar-ledger/src/lib.rs @@ -5,12 +5,11 @@ use ledger_transport_hid::{ LedgerHIDError, TransportNativeHID, }; -use crate::xdr::{Hash, Transaction}; use std::vec; use stellar_strkey::DecodeError; use stellar_xdr::curr::{ - self as xdr, Limits, TransactionSignaturePayload, TransactionSignaturePayloadTaggedTransaction, - WriteXdr, + self as xdr, Hash, Limits, Transaction, TransactionSignaturePayload, + TransactionSignaturePayloadTaggedTransaction, WriteXdr, }; pub use crate::signer::Blob; @@ -312,10 +311,9 @@ mod test { use crate::Blob; use test_helpers::test::emulator_http_transport::EmulatorHttpTransport; - use crate::xdr::Transaction; use std::vec; - use crate::xdr::{self, Operation, OperationBody, Uint256}; + use super::xdr::{self, Operation, OperationBody, Transaction, Uint256}; use crate::{test_network_hash, Error, LedgerSigner}; From b2621e692a2eebab49367fbcc896a78d87fc6b30 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Oct 2024 13:43:32 +1000 Subject: [PATCH 11/15] undo --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 95e7fdc31..ef052c569 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ members = [ "cmd/crates/soroban-test/tests/fixtures/test-wasms/*", "cmd/crates/soroban-test/tests/fixtures/hello", ] -# default-members = ["cmd/soroban-cli", "cmd/crates/soroban-spec-tools", "cmd/crates/soroban-test"] +default-members = ["cmd/soroban-cli", "cmd/crates/soroban-spec-tools", "cmd/crates/soroban-test"] exclude = ["cmd/crates/soroban-test/tests/fixtures/hello"] [workspace.package] From 7aa4c518cf9be585f9070f78c16fcf2ec24b5e1c Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Oct 2024 14:53:12 +1000 Subject: [PATCH 12/15] fix --- cmd/crates/soroban-spec-tools/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/crates/soroban-spec-tools/Cargo.toml b/cmd/crates/soroban-spec-tools/Cargo.toml index 43da1bede..a17a5d31f 100644 --- a/cmd/crates/soroban-spec-tools/Cargo.toml +++ b/cmd/crates/soroban-spec-tools/Cargo.toml @@ -19,7 +19,7 @@ crate-type = ["rlib"] [dependencies] soroban-spec = { workspace = true } stellar-strkey = { workspace = true } -stellar-xdr = { workspace = true, features = ["curr", "std", "serde"] } +stellar-xdr = { workspace = true, features = ["curr", "std", "serde", "base64"] } serde_json = { workspace = true } itertools = { workspace = true } ethnum = { workspace = true } From ab35edf1e13696f42285d48c9c16f814f1739369 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 3 Oct 2024 15:06:04 +1000 Subject: [PATCH 13/15] fix --- cmd/crates/stellar-ledger/tests/test/emulator_tests.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/crates/stellar-ledger/tests/test/emulator_tests.rs b/cmd/crates/stellar-ledger/tests/test/emulator_tests.rs index ae9c12f06..1b0c09bab 100644 --- a/cmd/crates/stellar-ledger/tests/test/emulator_tests.rs +++ b/cmd/crates/stellar-ledger/tests/test/emulator_tests.rs @@ -1,5 +1,3 @@ -use crate::xdr::{self, Operation, OperationBody, Uint256}; -use crate::xdr::{Hash, Transaction}; use ledger_transport::Exchange; use once_cell::sync::Lazy; use serde::Deserialize; @@ -15,8 +13,10 @@ use std::sync::Arc; use std::{collections::HashMap, time::Duration}; use stellar_xdr::curr::{ - Memo, MuxedAccount, PaymentOp, Preconditions, SequenceNumber, TransactionExt, + self as xdr, Hash, Memo, MuxedAccount, Operation, OperationBody, PaymentOp, Preconditions, + SequenceNumber, Transaction, TransactionExt, Uint256, }; + use testcontainers::{core::ContainerPort, runners::AsyncRunner, ContainerAsync, ImageExt}; use tokio::time::sleep; From 2206348ca4d5cfb28739b8cdfaa75226028eafd6 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 9 Oct 2024 23:43:24 +1000 Subject: [PATCH 14/15] Keep sdk v21 for test wasms --- Cargo.lock | 311 +++++++++++++++--- .../test-wasms/custom_account/Cargo.toml | 4 +- .../test-wasms/custom_type/Cargo.toml | 4 +- .../test-wasms/hello_world/Cargo.toml | 4 +- .../tests/fixtures/test-wasms/swap/Cargo.toml | 4 +- .../fixtures/test-wasms/token/Cargo.toml | 4 +- .../tests/fixtures/test-wasms/udt/Cargo.toml | 4 +- .../contracts/add/Cargo.toml | 4 +- .../contracts/call/Cargo.toml | 4 +- .../workspace/contracts/add/Cargo.toml | 4 +- .../workspace/contracts/add/add2/Cargo.toml | 4 +- .../workspace/contracts/call/Cargo.toml | 4 +- 12 files changed, 284 insertions(+), 71 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a0ac05a81..33f0962d8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5281,6 +5281,18 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "soroban-builtin-sdk-macros" +version = "21.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f57a68ef8777e28e274de0f3a88ad9a5a41d9a2eb461b4dd800b086f0e83b80" +dependencies = [ + "itertools 0.11.0", + "proc-macro2", + "quote", + "syn 2.0.77", +] + [[package]] name = "soroban-builtin-sdk-macros" version = "22.0.0-rc.1.1" @@ -5347,16 +5359,16 @@ dependencies = [ "serde_json", "sha2 0.10.8", "shlex", - "soroban-ledger-snapshot", - "soroban-sdk", - "soroban-spec", + "soroban-ledger-snapshot 22.0.0-rc.1.1", + "soroban-sdk 22.0.0-rc.1.1", + "soroban-spec 22.0.0-rc.1.1", "soroban-spec-json", - "soroban-spec-rust", + "soroban-spec-rust 22.0.0-rc.1.1", "soroban-spec-tools", "soroban-spec-typescript", "stellar-rpc-client", "stellar-strkey 0.0.11", - "stellar-xdr", + "stellar-xdr 22.0.0-rc.1.1", "strsim 0.10.0", "strum 0.17.1", "strum_macros 0.17.1", @@ -5379,33 +5391,94 @@ dependencies = [ "which", ] +[[package]] +name = "soroban-env-common" +version = "21.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd1c89463835fe6da996318156d39f424b4f167c725ec692e5a7a2d4e694b3d" +dependencies = [ + "arbitrary", + "crate-git-revision 0.0.6", + "ethnum", + "num-derive", + "num-traits", + "serde", + "soroban-env-macros 21.2.1", + "soroban-wasmi 0.31.1-soroban.20.0.1", + "static_assertions", + "stellar-xdr 21.2.0", + "wasmparser 0.116.1", +] + [[package]] name = "soroban-env-common" version = "22.0.0-rc.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6bdf1d66133d6b29e2834acea79decb57c47c71aa01885cae2b9ad621d67525c" dependencies = [ - "arbitrary", "crate-git-revision 0.0.6", "ethnum", "num-derive", "num-traits", "serde", - "soroban-env-macros", - "soroban-wasmi", + "soroban-env-macros 22.0.0-rc.1.1", + "soroban-wasmi 0.36.1-soroban.22.0.0", "static_assertions", - "stellar-xdr", + "stellar-xdr 22.0.0-rc.1.1", "wasmparser 0.116.1", ] +[[package]] +name = "soroban-env-guest" +version = "21.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bfb2536811045d5cd0c656a324cbe9ce4467eb734c7946b74410d90dea5d0ce" +dependencies = [ + "soroban-env-common 21.2.1", + "static_assertions", +] + [[package]] name = "soroban-env-guest" version = "22.0.0-rc.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa9610ac8a4a900e6f35b2ed171bc325c7e9883929f5e9da758e85f1226dd284" dependencies = [ - "soroban-env-common", + "soroban-env-common 22.0.0-rc.1.1", + "static_assertions", +] + +[[package]] +name = "soroban-env-host" +version = "21.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b7a32c28f281c423189f1298960194f0e0fc4eeb72378028171e556d8cd6160" +dependencies = [ + "backtrace", + "curve25519-dalek 4.1.3", + "ecdsa", + "ed25519-dalek 2.1.1", + "elliptic-curve", + "generic-array", + "getrandom", + "hex-literal", + "hmac 0.12.1", + "k256", + "num-derive", + "num-integer", + "num-traits", + "p256", + "rand", + "rand_chacha", + "sec1", + "sha2 0.10.8", + "sha3", + "soroban-builtin-sdk-macros 21.2.1", + "soroban-env-common 21.2.1", + "soroban-wasmi 0.31.1-soroban.20.0.1", "static_assertions", + "stellar-strkey 0.0.8", + "wasmparser 0.116.1", ] [[package]] @@ -5436,14 +5509,29 @@ dependencies = [ "sec1", "sha2 0.10.8", "sha3", - "soroban-builtin-sdk-macros", - "soroban-env-common", - "soroban-wasmi", + "soroban-builtin-sdk-macros 22.0.0-rc.1.1", + "soroban-env-common 22.0.0-rc.1.1", + "soroban-wasmi 0.36.1-soroban.22.0.0", "static_assertions", "stellar-strkey 0.0.9", "wasmparser 0.116.1", ] +[[package]] +name = "soroban-env-macros" +version = "21.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "242926fe5e0d922f12d3796cd7cd02dd824e5ef1caa088f45fce20b618309f64" +dependencies = [ + "itertools 0.11.0", + "proc-macro2", + "quote", + "serde", + "serde_json", + "stellar-xdr 21.2.0", + "syn 2.0.77", +] + [[package]] name = "soroban-env-macros" version = "22.0.0-rc.1.1" @@ -5455,7 +5543,7 @@ dependencies = [ "quote", "serde", "serde_json", - "stellar-xdr", + "stellar-xdr 22.0.0-rc.1.1", "syn 2.0.77", ] @@ -5463,6 +5551,20 @@ dependencies = [ name = "soroban-hello" version = "21.5.0" +[[package]] +name = "soroban-ledger-snapshot" +version = "21.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84589856911dfd6731695c9b51c858aed6d4540118c0a1e5c4c858ea13bc744c" +dependencies = [ + "serde", + "serde_json", + "serde_with", + "soroban-env-common 21.2.1", + "soroban-env-host 21.2.1", + "thiserror", +] + [[package]] name = "soroban-ledger-snapshot" version = "22.0.0-rc.1.1" @@ -5472,16 +5574,16 @@ dependencies = [ "serde", "serde_json", "serde_with", - "soroban-env-common", - "soroban-env-host", + "soroban-env-common 22.0.0-rc.1.1", + "soroban-env-host 22.0.0-rc.1.1", "thiserror", ] [[package]] name = "soroban-sdk" -version = "22.0.0-rc.1.1" +version = "21.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b715e15357dbdda2fe0626005b75c2253bb3786deec3001d4077462a9dadd3" +checksum = "69e39bf9e8ab05579c836e8e5be5f2f4c5ba75e7337ece20e975e82fc3a9d41e" dependencies = [ "arbitrary", "bytes-lit", @@ -5490,13 +5592,50 @@ dependencies = [ "rand", "serde", "serde_json", - "soroban-env-guest", - "soroban-env-host", - "soroban-ledger-snapshot", - "soroban-sdk-macros", + "soroban-env-guest 21.2.1", + "soroban-env-host 21.2.1", + "soroban-ledger-snapshot 21.7.3", + "soroban-sdk-macros 21.7.3", + "stellar-strkey 0.0.8", +] + +[[package]] +name = "soroban-sdk" +version = "22.0.0-rc.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68b715e15357dbdda2fe0626005b75c2253bb3786deec3001d4077462a9dadd3" +dependencies = [ + "bytes-lit", + "rand", + "serde", + "serde_json", + "soroban-env-guest 22.0.0-rc.1.1", + "soroban-env-host 22.0.0-rc.1.1", + "soroban-ledger-snapshot 22.0.0-rc.1.1", + "soroban-sdk-macros 22.0.0-rc.1.1", "stellar-strkey 0.0.9", ] +[[package]] +name = "soroban-sdk-macros" +version = "21.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63c2173f1aacd56b4405eed71cb2a9694dff99d51ba72d4f0cbc5e4961fdabf4" +dependencies = [ + "crate-git-revision 0.0.6", + "darling", + "itertools 0.11.0", + "proc-macro2", + "quote", + "rustc_version", + "sha2 0.10.8", + "soroban-env-common 21.2.1", + "soroban-spec 21.7.3", + "soroban-spec-rust 21.7.3", + "stellar-xdr 21.2.0", + "syn 2.0.77", +] + [[package]] name = "soroban-sdk-macros" version = "22.0.0-rc.1.1" @@ -5510,13 +5649,25 @@ dependencies = [ "quote", "rustc_version", "sha2 0.10.8", - "soroban-env-common", - "soroban-spec", - "soroban-spec-rust", - "stellar-xdr", + "soroban-env-common 22.0.0-rc.1.1", + "soroban-spec 22.0.0-rc.1.1", + "soroban-spec-rust 22.0.0-rc.1.1", + "stellar-xdr 22.0.0-rc.1.1", "syn 2.0.77", ] +[[package]] +name = "soroban-spec" +version = "21.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7705bffbcc747c08e81698b87b4a787f8b268c25d88f777160091dc1ee8121cb" +dependencies = [ + "base64 0.13.1", + "stellar-xdr 21.2.0", + "thiserror", + "wasmparser 0.116.1", +] + [[package]] name = "soroban-spec" version = "22.0.0-rc.1.1" @@ -5524,7 +5675,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4603430fd36848da7189e758d7f3fe1d7bbfef024e8aad2230a8be8252a583c1" dependencies = [ "base64 0.13.1", - "stellar-xdr", + "stellar-xdr 22.0.0-rc.1.1", "thiserror", "wasmparser 0.116.1", ] @@ -5538,8 +5689,24 @@ dependencies = [ "serde_derive", "serde_json", "sha2 0.9.9", - "soroban-spec", - "stellar-xdr", + "soroban-spec 22.0.0-rc.1.1", + "stellar-xdr 22.0.0-rc.1.1", + "thiserror", +] + +[[package]] +name = "soroban-spec-rust" +version = "21.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48207ebc8616c2804a17203d1d86c53c3d3c804b682cbab011a135893db1cf78" +dependencies = [ + "prettyplease", + "proc-macro2", + "quote", + "sha2 0.10.8", + "soroban-spec 21.7.3", + "stellar-xdr 21.2.0", + "syn 2.0.77", "thiserror", ] @@ -5553,8 +5720,8 @@ dependencies = [ "proc-macro2", "quote", "sha2 0.10.8", - "soroban-spec", - "stellar-xdr", + "soroban-spec 22.0.0-rc.1.1", + "stellar-xdr 22.0.0-rc.1.1", "syn 2.0.77", "thiserror", ] @@ -5568,9 +5735,9 @@ dependencies = [ "hex", "itertools 0.10.5", "serde_json", - "soroban-spec", + "soroban-spec 22.0.0-rc.1.1", "stellar-strkey 0.0.11", - "stellar-xdr", + "stellar-xdr 22.0.0-rc.1.1", "thiserror", "tokio", "wasmparser 0.90.0", @@ -5591,8 +5758,8 @@ dependencies = [ "serde_derive", "serde_json", "sha2 0.9.9", - "soroban-spec", - "stellar-xdr", + "soroban-spec 22.0.0-rc.1.1", + "stellar-xdr 22.0.0-rc.1.1", "temp-dir", "thiserror", "walkdir", @@ -5612,8 +5779,8 @@ dependencies = [ "serde_json", "sha2 0.10.8", "soroban-cli", - "soroban-ledger-snapshot", - "soroban-spec", + "soroban-ledger-snapshot 22.0.0-rc.1.1", + "soroban-spec 22.0.0-rc.1.1", "soroban-spec-tools", "stellar-rpc-client", "stellar-strkey 0.0.11", @@ -5631,7 +5798,20 @@ version = "22.0.0-rc.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7baa9e15d0838973cfa0aa0eee6e0fa062bec2e4a115c82396f452fa6148d731" dependencies = [ - "soroban-sdk", + "soroban-sdk 22.0.0-rc.1.1", +] + +[[package]] +name = "soroban-wasmi" +version = "0.31.1-soroban.20.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "710403de32d0e0c35375518cb995d4fc056d0d48966f2e56ea471b8cb8fc9719" +dependencies = [ + "smallvec", + "spin", + "wasmi_arena", + "wasmi_core 0.13.0", + "wasmparser-nostd", ] [[package]] @@ -5647,7 +5827,7 @@ dependencies = [ "smallvec", "spin", "wasmi_collections", - "wasmi_core", + "wasmi_core 0.36.3", "wasmparser-nostd", ] @@ -5707,10 +5887,10 @@ dependencies = [ "serial_test", "sha2 0.9.9", "slip10", - "soroban-spec", + "soroban-spec 22.0.0-rc.1.1", "stellar-rpc-client", "stellar-strkey 0.0.11", - "stellar-xdr", + "stellar-xdr 22.0.0-rc.1.1", "test-case", "testcontainers", "thiserror", @@ -5735,7 +5915,7 @@ dependencies = [ "serde_with", "sha2 0.10.8", "stellar-strkey 0.0.9", - "stellar-xdr", + "stellar-xdr 22.0.0-rc.1.1", "termcolor", "termcolor_output", "thiserror", @@ -5775,13 +5955,28 @@ dependencies = [ "data-encoding", ] +[[package]] +name = "stellar-xdr" +version = "21.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2675a71212ed39a806e415b0dbf4702879ff288ec7f5ee996dda42a135512b50" +dependencies = [ + "arbitrary", + "base64 0.13.1", + "crate-git-revision 0.0.6", + "escape-bytes", + "hex", + "serde", + "serde_with", + "stellar-strkey 0.0.8", +] + [[package]] name = "stellar-xdr" version = "22.0.0-rc.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c88dc0e928b9cb65ea43836b52560bb4ead3e32895f5019ca223dc7cd1966cbf" dependencies = [ - "arbitrary", "base64 0.13.1", "clap", "crate-git-revision 0.0.6", @@ -6053,35 +6248,35 @@ dependencies = [ name = "test_custom_account" version = "21.5.0" dependencies = [ - "soroban-sdk", + "soroban-sdk 21.7.2", ] [[package]] name = "test_custom_types" version = "21.5.0" dependencies = [ - "soroban-sdk", + "soroban-sdk 21.7.2", ] [[package]] name = "test_hello_world" version = "21.5.0" dependencies = [ - "soroban-sdk", + "soroban-sdk 21.7.2", ] [[package]] name = "test_swap" version = "21.5.0" dependencies = [ - "soroban-sdk", + "soroban-sdk 21.7.2", ] [[package]] name = "test_token" version = "21.5.0" dependencies = [ - "soroban-sdk", + "soroban-sdk 21.7.2", "soroban-token-sdk", ] @@ -6089,7 +6284,7 @@ dependencies = [ name = "test_udt" version = "21.5.0" dependencies = [ - "soroban-sdk", + "soroban-sdk 21.7.2", ] [[package]] @@ -6755,6 +6950,12 @@ dependencies = [ "web-sys", ] +[[package]] +name = "wasmi_arena" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "104a7f73be44570cac297b3035d76b169d6599637631cf37a1703326a0727073" + [[package]] name = "wasmi_collections" version = "0.36.3" @@ -6766,6 +6967,18 @@ dependencies = [ "string-interner", ] +[[package]] +name = "wasmi_core" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf1a7db34bff95b85c261002720c00c3a6168256dcb93041d3fa2054d19856a" +dependencies = [ + "downcast-rs", + "libm", + "num-traits", + "paste", +] + [[package]] name = "wasmi_core" version = "0.36.3" diff --git a/cmd/crates/soroban-test/tests/fixtures/test-wasms/custom_account/Cargo.toml b/cmd/crates/soroban-test/tests/fixtures/test-wasms/custom_account/Cargo.toml index d4405c512..792925edb 100644 --- a/cmd/crates/soroban-test/tests/fixtures/test-wasms/custom_account/Cargo.toml +++ b/cmd/crates/soroban-test/tests/fixtures/test-wasms/custom_account/Cargo.toml @@ -12,7 +12,7 @@ crate-type = ["cdylib"] doctest = false [dependencies] -soroban-sdk = { workspace = true } +soroban-sdk = { version = "=21.7.2" } [dev-dependencies] -soroban-sdk = { workspace = true, features = ["testutils"]} +soroban-sdk = { version = "=21.7.2", features = ["testutils"]} diff --git a/cmd/crates/soroban-test/tests/fixtures/test-wasms/custom_type/Cargo.toml b/cmd/crates/soroban-test/tests/fixtures/test-wasms/custom_type/Cargo.toml index 17e618805..398520104 100644 --- a/cmd/crates/soroban-test/tests/fixtures/test-wasms/custom_type/Cargo.toml +++ b/cmd/crates/soroban-test/tests/fixtures/test-wasms/custom_type/Cargo.toml @@ -12,7 +12,7 @@ crate-type = ["cdylib", "rlib"] doctest = false [dependencies] -soroban-sdk = { workspace = true } +soroban-sdk = { version = "=21.7.2" } [dev-dependencies] -soroban-sdk = { workspace = true, features = ["testutils"]} +soroban-sdk = { version = "=21.7.2", features = ["testutils"]} diff --git a/cmd/crates/soroban-test/tests/fixtures/test-wasms/hello_world/Cargo.toml b/cmd/crates/soroban-test/tests/fixtures/test-wasms/hello_world/Cargo.toml index 9ad83fd1c..5f8b1256f 100644 --- a/cmd/crates/soroban-test/tests/fixtures/test-wasms/hello_world/Cargo.toml +++ b/cmd/crates/soroban-test/tests/fixtures/test-wasms/hello_world/Cargo.toml @@ -12,7 +12,7 @@ crate-type = ["cdylib", "rlib"] doctest = false [dependencies] -soroban-sdk = { workspace = true } +soroban-sdk = { version = "=21.7.2" } [dev-dependencies] -soroban-sdk = { workspace = true, features = ["testutils"]} +soroban-sdk = { version = "=21.7.2", features = ["testutils"]} diff --git a/cmd/crates/soroban-test/tests/fixtures/test-wasms/swap/Cargo.toml b/cmd/crates/soroban-test/tests/fixtures/test-wasms/swap/Cargo.toml index f74201a31..509483408 100644 --- a/cmd/crates/soroban-test/tests/fixtures/test-wasms/swap/Cargo.toml +++ b/cmd/crates/soroban-test/tests/fixtures/test-wasms/swap/Cargo.toml @@ -12,7 +12,7 @@ crate-type = ["cdylib"] doctest = false [dependencies] -soroban-sdk = { workspace = true } +soroban-sdk = { version = "=21.7.2" } [dev-dependencies] -soroban-sdk = { workspace = true, features = ["testutils"] } +soroban-sdk = { version = "=21.7.2", features = ["testutils"] } diff --git a/cmd/crates/soroban-test/tests/fixtures/test-wasms/token/Cargo.toml b/cmd/crates/soroban-test/tests/fixtures/test-wasms/token/Cargo.toml index 880c39d52..8875b87e7 100644 --- a/cmd/crates/soroban-test/tests/fixtures/test-wasms/token/Cargo.toml +++ b/cmd/crates/soroban-test/tests/fixtures/test-wasms/token/Cargo.toml @@ -12,8 +12,8 @@ rust-version.workspace = true crate-type = ["cdylib"] [dependencies] -soroban-sdk = { workspace = true } +soroban-sdk = { version = "=21.7.2" } soroban-token-sdk = { workspace = true } [dev-dependencies] -soroban-sdk = { workspace = true, features = ["testutils"] } +soroban-sdk = { version = "=21.7.2", features = ["testutils"] } diff --git a/cmd/crates/soroban-test/tests/fixtures/test-wasms/udt/Cargo.toml b/cmd/crates/soroban-test/tests/fixtures/test-wasms/udt/Cargo.toml index 206284802..aea356447 100644 --- a/cmd/crates/soroban-test/tests/fixtures/test-wasms/udt/Cargo.toml +++ b/cmd/crates/soroban-test/tests/fixtures/test-wasms/udt/Cargo.toml @@ -12,7 +12,7 @@ crate-type = ["cdylib"] doctest = false [dependencies] -soroban-sdk = { workspace = true } +soroban-sdk = { version = "=21.7.2" } [dev-dependencies] -soroban-sdk = { workspace = true , features = ["testutils"]} +soroban-sdk = { version = "=21.7.2" , features = ["testutils"]} diff --git a/cmd/crates/soroban-test/tests/fixtures/workspace-with-default-members/contracts/add/Cargo.toml b/cmd/crates/soroban-test/tests/fixtures/workspace-with-default-members/contracts/add/Cargo.toml index 660b7eb11..ca38cca49 100644 --- a/cmd/crates/soroban-test/tests/fixtures/workspace-with-default-members/contracts/add/Cargo.toml +++ b/cmd/crates/soroban-test/tests/fixtures/workspace-with-default-members/contracts/add/Cargo.toml @@ -9,7 +9,7 @@ crate-type = ["cdylib"] doctest = false [dependencies] -soroban-sdk = { workspace = true } +soroban-sdk = { version = "=21.7.2" } [dev-dependencies] -soroban-sdk = { workspace = true, features = ["testutils"] } +soroban-sdk = { version = "=21.7.2", features = ["testutils"] } diff --git a/cmd/crates/soroban-test/tests/fixtures/workspace-with-default-members/contracts/call/Cargo.toml b/cmd/crates/soroban-test/tests/fixtures/workspace-with-default-members/contracts/call/Cargo.toml index 48e32b14d..a1ba4ed43 100644 --- a/cmd/crates/soroban-test/tests/fixtures/workspace-with-default-members/contracts/call/Cargo.toml +++ b/cmd/crates/soroban-test/tests/fixtures/workspace-with-default-members/contracts/call/Cargo.toml @@ -9,7 +9,7 @@ crate-type = ["cdylib"] doctest = false [dependencies] -soroban-sdk = { workspace = true } +soroban-sdk = { version = "=21.7.2" } [dev-dependencies] -soroban-sdk = { workspace = true, features = ["testutils"] } +soroban-sdk = { version = "=21.7.2", features = ["testutils"] } diff --git a/cmd/crates/soroban-test/tests/fixtures/workspace/contracts/add/Cargo.toml b/cmd/crates/soroban-test/tests/fixtures/workspace/contracts/add/Cargo.toml index 660b7eb11..ca38cca49 100644 --- a/cmd/crates/soroban-test/tests/fixtures/workspace/contracts/add/Cargo.toml +++ b/cmd/crates/soroban-test/tests/fixtures/workspace/contracts/add/Cargo.toml @@ -9,7 +9,7 @@ crate-type = ["cdylib"] doctest = false [dependencies] -soroban-sdk = { workspace = true } +soroban-sdk = { version = "=21.7.2" } [dev-dependencies] -soroban-sdk = { workspace = true, features = ["testutils"] } +soroban-sdk = { version = "=21.7.2", features = ["testutils"] } diff --git a/cmd/crates/soroban-test/tests/fixtures/workspace/contracts/add/add2/Cargo.toml b/cmd/crates/soroban-test/tests/fixtures/workspace/contracts/add/add2/Cargo.toml index bae834e02..b6b570327 100644 --- a/cmd/crates/soroban-test/tests/fixtures/workspace/contracts/add/add2/Cargo.toml +++ b/cmd/crates/soroban-test/tests/fixtures/workspace/contracts/add/add2/Cargo.toml @@ -9,7 +9,7 @@ crate-type = ["cdylib"] doctest = false [dependencies] -soroban-sdk = { workspace = true } +soroban-sdk = { version = "=21.7.2" } [dev-dependencies] -soroban-sdk = { workspace = true, features = ["testutils"] } +soroban-sdk = { version = "=21.7.2", features = ["testutils"] } diff --git a/cmd/crates/soroban-test/tests/fixtures/workspace/contracts/call/Cargo.toml b/cmd/crates/soroban-test/tests/fixtures/workspace/contracts/call/Cargo.toml index 48e32b14d..a1ba4ed43 100644 --- a/cmd/crates/soroban-test/tests/fixtures/workspace/contracts/call/Cargo.toml +++ b/cmd/crates/soroban-test/tests/fixtures/workspace/contracts/call/Cargo.toml @@ -9,7 +9,7 @@ crate-type = ["cdylib"] doctest = false [dependencies] -soroban-sdk = { workspace = true } +soroban-sdk = { version = "=21.7.2" } [dev-dependencies] -soroban-sdk = { workspace = true, features = ["testutils"] } +soroban-sdk = { version = "=21.7.2", features = ["testutils"] } From 7e19fa70723ef194e6759f0e5db729d0d8b6eb57 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 10 Oct 2024 00:43:07 +1000 Subject: [PATCH 15/15] fix --- .../tests/fixtures/test-wasms/custom_account/src/lib.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cmd/crates/soroban-test/tests/fixtures/test-wasms/custom_account/src/lib.rs b/cmd/crates/soroban-test/tests/fixtures/test-wasms/custom_account/src/lib.rs index 062c1d1cf..c71324110 100644 --- a/cmd/crates/soroban-test/tests/fixtures/test-wasms/custom_account/src/lib.rs +++ b/cmd/crates/soroban-test/tests/fixtures/test-wasms/custom_account/src/lib.rs @@ -115,9 +115,7 @@ impl CustomAccountInterface for Contract { return Err(Error::NotPermitted); } } - Context::CreateContractHostFn(_) | Context::CreateContractWithCtorHostFn(_) => { - return Err(Error::InvalidContext) - } + Context::CreateContractHostFn(_) => return Err(Error::InvalidContext), }; }