diff --git a/Cargo.lock b/Cargo.lock index 1ce602650..7be5ac285 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14,6 +14,12 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -44,10 +50,32 @@ 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", + "ark-ec 0.4.2", + "ark-ff 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", +] + +[[package]] +name = "ark-bn254" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a22f4561524cd949590d78d7d4c5df8f592430d221f7f3c9497bbafd8972120f" +dependencies = [ + "ark-ec 0.4.2", + "ark-ff 0.4.2", + "ark-std 0.4.0", +] + +[[package]] +name = "ark-bn254" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d69eab57e8d2663efa5c63135b2af4f396d66424f88954c21104125ab6b3e6bc" +dependencies = [ + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-std 0.5.0", ] [[package]] @@ -56,13 +84,34 @@ 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", + "ark-ff 0.4.2", + "ark-poly 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", "derivative", "hashbrown 0.13.2", - "itertools", + "itertools 0.10.5", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" +dependencies = [ + "ahash", + "ark-ff 0.5.0", + "ark-poly 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "educe", + "fnv", + "hashbrown 0.15.5", + "itertools 0.13.0", + "num-bigint", + "num-integer", "num-traits", "zeroize", ] @@ -73,13 +122,13 @@ 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", + "ark-ff-asm 0.4.2", + "ark-ff-macros 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", "derivative", "digest", - "itertools", + "itertools 0.10.5", "num-bigint", "num-traits", "paste", @@ -87,6 +136,26 @@ dependencies = [ "zeroize", ] +[[package]] +name = "ark-ff" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" +dependencies = [ + "ark-ff-asm 0.5.0", + "ark-ff-macros 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "arrayvec", + "digest", + "educe", + "itertools 0.13.0", + "num-bigint", + "num-traits", + "paste", + "zeroize", +] + [[package]] name = "ark-ff-asm" version = "0.4.2" @@ -97,6 +166,16 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ark-ff-asm" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" +dependencies = [ + "quote", + "syn 2.0.103", +] + [[package]] name = "ark-ff-macros" version = "0.4.2" @@ -110,27 +189,68 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ark-ff-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 2.0.103", +] + [[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", + "ark-ff 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", "derivative", "hashbrown 0.13.2", ] +[[package]] +name = "ark-poly" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" +dependencies = [ + "ahash", + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "educe", + "fnv", + "hashbrown 0.15.5", +] + [[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", + "ark-serialize-derive 0.4.2", + "ark-std 0.4.0", + "digest", + "num-bigint", +] + +[[package]] +name = "ark-serialize" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" +dependencies = [ + "ark-serialize-derive 0.5.0", + "ark-std 0.5.0", + "arrayvec", "digest", "num-bigint", ] @@ -146,6 +266,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ark-serialize-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", +] + [[package]] name = "ark-std" version = "0.4.0" @@ -156,6 +287,22 @@ dependencies = [ "rand", ] +[[package]] +name = "ark-std" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" +dependencies = [ + "num-traits", + "rand", +] + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + [[package]] name = "autocfg" version = "1.3.0" @@ -544,6 +691,18 @@ dependencies = [ "zeroize", ] +[[package]] +name = "educe" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 2.0.103", +] + [[package]] name = "either" version = "1.13.0" @@ -568,6 +727,26 @@ dependencies = [ "zeroize", ] +[[package]] +name = "enum-ordinalize" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea0dcfa4e54eeb516fe454635a95753ddd39acda650ce703031c6973e315dd5" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.103", +] + [[package]] name = "equivalent" version = "1.0.1" @@ -690,6 +869,15 @@ version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "allocator-api2", +] + [[package]] name = "heck" version = "0.5.0" @@ -786,6 +974,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.11" @@ -1308,11 +1505,10 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "soroban-builtin-sdk-macros" -version = "23.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9336adeabcd6f636a4e0889c8baf494658ef5a3c4e7e227569acd2ce9091e85" +version = "25.0.0" +source = "git+https://github.com/stellar/rs-soroban-env?rev=0a0c2df704edeb3cdafabfcc759eddccd6775337#0a0c2df704edeb3cdafabfcc759eddccd6775337" dependencies = [ - "itertools", + "itertools 0.10.5", "proc-macro2", "quote", "syn 2.0.103", @@ -1320,9 +1516,8 @@ dependencies = [ [[package]] name = "soroban-env-common" -version = "23.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00067f52e8bbf1abf0de03fe3e2fbb06910893cfbe9a7d9093d6425658833ff3" +version = "25.0.0" +source = "git+https://github.com/stellar/rs-soroban-env?rev=0a0c2df704edeb3cdafabfcc759eddccd6775337#0a0c2df704edeb3cdafabfcc759eddccd6775337" dependencies = [ "arbitrary", "crate-git-revision", @@ -1339,9 +1534,8 @@ dependencies = [ [[package]] name = "soroban-env-guest" -version = "23.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccd1e40963517b10963a8e404348d3fe6caf9c278ac47a6effd48771297374d6" +version = "25.0.0" +source = "git+https://github.com/stellar/rs-soroban-env?rev=0a0c2df704edeb3cdafabfcc759eddccd6775337#0a0c2df704edeb3cdafabfcc759eddccd6775337" dependencies = [ "soroban-env-common", "static_assertions", @@ -1349,14 +1543,14 @@ dependencies = [ [[package]] name = "soroban-env-host" -version = "23.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9766c5ad78e9d8ae10afbc076301f7d610c16407a1ebb230766dbe007a48725" +version = "25.0.0" +source = "git+https://github.com/stellar/rs-soroban-env?rev=0a0c2df704edeb3cdafabfcc759eddccd6775337#0a0c2df704edeb3cdafabfcc759eddccd6775337" dependencies = [ "ark-bls12-381", - "ark-ec", - "ark-ff", - "ark-serialize", + "ark-bn254 0.4.0", + "ark-ec 0.4.2", + "ark-ff 0.4.2", + "ark-serialize 0.4.2", "curve25519-dalek", "ecdsa", "ed25519-dalek", @@ -1385,11 +1579,10 @@ dependencies = [ [[package]] name = "soroban-env-macros" -version = "23.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0e6a1c5844257ce96f5f54ef976035d5bd0ee6edefaf9f5e0bcb8ea4b34228c" +version = "25.0.0" +source = "git+https://github.com/stellar/rs-soroban-env?rev=0a0c2df704edeb3cdafabfcc759eddccd6775337#0a0c2df704edeb3cdafabfcc759eddccd6775337" dependencies = [ - "itertools", + "itertools 0.10.5", "proc-macro2", "quote", "serde", @@ -1456,7 +1649,7 @@ version = "23.1.0" dependencies = [ "darling", "heck", - "itertools", + "itertools 0.10.5", "macro-string", "proc-macro2", "quote", @@ -1512,8 +1705,7 @@ dependencies = [ [[package]] name = "soroban-wasmi" version = "0.31.1-soroban.20.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "710403de32d0e0c35375518cb995d4fc056d0d48966f2e56ea471b8cb8fc9719" +source = "git+https://github.com/stellar/wasmi?rev=0ed3f3dee30dc41ebe21972399e0a73a41944aa0#0ed3f3dee30dc41ebe21972399e0a73a41944aa0" dependencies = [ "smallvec", "spin", @@ -1565,9 +1757,8 @@ dependencies = [ [[package]] name = "stellar-xdr" -version = "23.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d2848e1694b0c8db81fd812bfab5ea71ee28073e09ccc45620ef3cf7a75a9b" +version = "24.0.1" +source = "git+https://github.com/stellar/rs-stellar-xdr?rev=89cc1cbadf1b9a16843826954dede7fec514d8e7#89cc1cbadf1b9a16843826954dede7fec514d8e7" dependencies = [ "arbitrary", "base64", @@ -1685,6 +1876,18 @@ dependencies = [ "soroban-sdk", ] +[[package]] +name = "test_bn254" +version = "23.1.0" +dependencies = [ + "ark-bn254 0.5.0", + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "soroban-sdk", +] + [[package]] name = "test_constructor" version = "23.1.0" @@ -1974,15 +2177,13 @@ checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "wasmi_arena" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "104a7f73be44570cac297b3035d76b169d6599637631cf37a1703326a0727073" +version = "0.4.0" +source = "git+https://github.com/stellar/wasmi?rev=0ed3f3dee30dc41ebe21972399e0a73a41944aa0#0ed3f3dee30dc41ebe21972399e0a73a41944aa0" [[package]] name = "wasmi_core" version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf1a7db34bff95b85c261002720c00c3a6168256dcb93041d3fa2054d19856a" +source = "git+https://github.com/stellar/wasmi?rev=0ed3f3dee30dc41ebe21972399e0a73a41944aa0#0ed3f3dee30dc41ebe21972399e0a73a41944aa0" dependencies = [ "downcast-rs", "libm", diff --git a/Cargo.toml b/Cargo.toml index 449d0c7a1..44db8f0b3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,29 +30,29 @@ soroban-token-spec = { version = "23.1.0", path = "soroban-token-spec" } stellar-asset-spec = { version = "23.1.0", path = "stellar-asset-spec" } [workspace.dependencies.soroban-env-common] -version = "=23.0.1" -#git = "https://github.com/stellar/rs-soroban-env" -#rev = "bd0c80a1fe171e75f8d745f17975a73927d44ecd" +version = "=25.0.0" +git = "https://github.com/stellar/rs-soroban-env" +rev = "0a0c2df704edeb3cdafabfcc759eddccd6775337" [workspace.dependencies.soroban-env-guest] -version = "=23.0.1" -#git = "https://github.com/stellar/rs-soroban-env" -#rev = "bd0c80a1fe171e75f8d745f17975a73927d44ecd" +version = "=25.0.0" +git = "https://github.com/stellar/rs-soroban-env" +rev = "0a0c2df704edeb3cdafabfcc759eddccd6775337" [workspace.dependencies.soroban-env-host] -version = "=23.0.1" -#git = "https://github.com/stellar/rs-soroban-env" -#rev = "bd0c80a1fe171e75f8d745f17975a73927d44ecd" +version = "=25.0.0" +git = "https://github.com/stellar/rs-soroban-env" +rev = "0a0c2df704edeb3cdafabfcc759eddccd6775337" [workspace.dependencies.stellar-strkey] version = "=0.0.13" [workspace.dependencies.stellar-xdr] -version = "=23.0.0" +version = "=24.0.1" default-features = false features = ["curr"] -#git = "https://github.com/stellar/rs-stellar-xdr" -#rev = "67be5955a15f1d3a4df83fe86e6ae107f687141b" +git = "https://github.com/stellar/rs-stellar-xdr" +rev = "89cc1cbadf1b9a16843826954dede7fec514d8e7" #[patch.crates-io] #soroban-env-common = { path = "../rs-soroban-env/soroban-env-common" } diff --git a/soroban-ledger-snapshot/src/lib.rs b/soroban-ledger-snapshot/src/lib.rs index ca3a46c5a..64831ced9 100644 --- a/soroban-ledger-snapshot/src/lib.rs +++ b/soroban-ledger-snapshot/src/lib.rs @@ -166,7 +166,7 @@ impl LedgerSnapshot { impl Default for LedgerSnapshot { fn default() -> Self { Self { - protocol_version: 23, + protocol_version: 25, sequence_number: Default::default(), timestamp: Default::default(), network_id: Default::default(), diff --git a/soroban-sdk/src/crypto.rs b/soroban-sdk/src/crypto.rs index d27cf1f0d..306e510b6 100644 --- a/soroban-sdk/src/crypto.rs +++ b/soroban-sdk/src/crypto.rs @@ -7,6 +7,7 @@ use crate::{ }; pub mod bls12_381; +pub mod bn254; /// A `BytesN` generated by a cryptographic hash function. /// /// The `Hash` type contains a `BytesN` and can only be constructed in @@ -182,6 +183,12 @@ impl Crypto { pub fn bls12_381(&self) -> bls12_381::Bls12_381 { bls12_381::Bls12_381::new(self.env()) } + + /// Get a [Bn254][bn254::Bn254] for accessing the bn254 + /// functions. + pub fn bn254(&self) -> bn254::Bn254 { + bn254::Bn254::new(self.env()) + } } /// # ⚠️ Hazardous Materials diff --git a/soroban-sdk/src/crypto/bn254.rs b/soroban-sdk/src/crypto/bn254.rs new file mode 100644 index 000000000..12c2ace75 --- /dev/null +++ b/soroban-sdk/src/crypto/bn254.rs @@ -0,0 +1,307 @@ +#[cfg(not(target_family = "wasm"))] +use crate::xdr::ScVal; +use crate::{ + env::internal::{self, BytesObject, U256Val}, + impl_bytesn_repr, + unwrap::{UnwrapInfallible, UnwrapOptimized}, + Bytes, BytesN, ConversionError, Env, IntoVal, TryFromVal, Val, Vec, U256, +}; +use core::{ + cmp::Ordering, + fmt::Debug, + ops::{Add, Mul}, +}; + +const FP_SERIALIZED_SIZE: usize = 32; // Size in bytes of a serialized Fp element in BN254. The field modulus is 254 bits, requiring 32 bytes (256 bits). +pub const G1_SERIALIZED_SIZE: usize = FP_SERIALIZED_SIZE * 2; // Size in bytes of a serialized G1 element in BN254. Each coordinate (X, Y) is 32 bytes. +pub const G2_SERIALIZED_SIZE: usize = G1_SERIALIZED_SIZE * 2; // Size in bytes of a serialized G2 element in BN254. Each coordinate (X, Y) is 64 bytes (2 Fp elements per coordinate). + +/// Bn254 provides access to curve and pairing operations on the BN254 +/// (also known as alt_bn128) curve. +pub struct Bn254 { + env: Env, +} + +/// `G1Affine` is a point in the G1 group (subgroup defined over the base field +/// `Fq` with prime order `q = +/// 0x30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47`) of the +/// BN254 elliptic curve +/// +/// # Serialization: +/// - The 64 bytes represent the **uncompressed encoding** of a point in G1. The +/// bytes consist of `be_bytes(X) || be_bytes(Y)` (`||` is concatenation), +/// where 'X' and 'Y' are the two coordinates, each being a base field element +/// `Fp` (32 bytes each). +#[derive(Clone)] +#[repr(transparent)] +pub struct G1Affine(BytesN); + +/// `G2Affine` is a point in the G2 group (subgroup defined over the quadratic +/// extension field `Fq2`) of the BN254 elliptic curve +/// +/// # Serialization: +/// - The 128 bytes represent the **uncompressed encoding** of a point in G2. +/// The bytes consist of `be_bytes(X_im) || be_bytes(X_re) || be_bytes(Y_im) +/// || be_bytes(Y_re)` (`||` is concatenation), where 'X' and 'Y' are the two +/// coordinates, each being an extension field element `Fp2`. Each component +/// (real and imaginary parts) is an `Fp` element (32 bytes each). +#[derive(Clone)] +#[repr(transparent)] +pub struct G2Affine(BytesN); + +/// `Fr` represents an element in the BN254 scalar field, which is a prime field +/// of order `r = +/// 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001`. The +/// struct is internally represented with a `U256`, all arithmetic operations +/// follow modulo `r`. +#[derive(Clone)] +#[repr(transparent)] +pub struct Fr(U256); + +impl_bytesn_repr!(G1Affine, G1_SERIALIZED_SIZE); +impl_bytesn_repr!(G2Affine, G2_SERIALIZED_SIZE); + +impl G1Affine { + pub fn env(&self) -> &Env { + self.0.env() + } +} + +impl Add for G1Affine { + type Output = G1Affine; + + fn add(self, rhs: Self) -> Self::Output { + self.env().crypto().bn254().g1_add(&self, &rhs) + } +} + +impl Mul for G1Affine { + type Output = G1Affine; + + fn mul(self, rhs: Fr) -> Self::Output { + self.env().crypto().bn254().g1_mul(&self, &rhs) + } +} + +impl G2Affine { + pub fn env(&self) -> &Env { + self.0.env() + } +} + +impl Fr { + pub fn env(&self) -> &Env { + self.0.env() + } + + pub fn from_u256(value: U256) -> Self { + value.into() + } + + pub fn to_u256(&self) -> U256 { + self.0.clone() + } + + pub fn as_u256(&self) -> &U256 { + &self.0 + } + + pub fn from_bytes(bytes: BytesN<32>) -> Self { + U256::from_be_bytes(bytes.env(), bytes.as_ref()).into() + } + + pub fn to_bytes(&self) -> BytesN<32> { + self.as_u256().to_be_bytes().try_into().unwrap_optimized() + } + + pub fn as_val(&self) -> &Val { + self.0.as_val() + } + + pub fn to_val(&self) -> Val { + self.0.to_val() + } +} + +impl From for Fr { + fn from(value: U256) -> Self { + Self(value) + } +} + +impl From<&Fr> for U256Val { + fn from(value: &Fr) -> Self { + value.as_u256().into() + } +} + +impl TryFromVal for Fr { + type Error = ConversionError; + + fn try_from_val(env: &Env, val: &Val) -> Result { + let u = U256::try_from_val(env, val)?; + Ok(Fr(u)) + } +} + +impl TryFromVal for Val { + type Error = ConversionError; + + fn try_from_val(_env: &Env, fr: &Fr) -> Result { + Ok(fr.to_val()) + } +} + +impl TryFromVal for Val { + type Error = ConversionError; + + fn try_from_val(_env: &Env, fr: &&Fr) -> Result { + Ok(fr.to_val()) + } +} + +#[cfg(not(target_family = "wasm"))] +impl From<&Fr> for ScVal { + fn from(v: &Fr) -> Self { + Self::from(&v.0) + } +} + +#[cfg(not(target_family = "wasm"))] +impl From for ScVal { + fn from(v: Fr) -> Self { + (&v).into() + } +} + +impl Eq for Fr {} + +impl PartialEq for Fr { + fn eq(&self, other: &Self) -> bool { + self.as_u256().partial_cmp(other.as_u256()) == Some(core::cmp::Ordering::Equal) + } +} + +impl Debug for Fr { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "Fr({:?})", self.as_u256()) + } +} + +impl Bn254 { + pub(crate) fn new(env: &Env) -> Bn254 { + Bn254 { env: env.clone() } + } + + pub fn env(&self) -> &Env { + &self.env + } + + /// Adds two points `p0` and `p1` in G1. + pub fn g1_add(&self, p0: &G1Affine, p1: &G1Affine) -> G1Affine { + let env = self.env(); + let bin = + internal::Env::bn254_g1_add(env, p0.to_object(), p1.to_object()).unwrap_infallible(); + unsafe { G1Affine::from_bytes(BytesN::unchecked_new(env.clone(), bin)) } + } + + /// Multiplies a point `p0` in G1 by a scalar. + pub fn g1_mul(&self, p0: &G1Affine, scalar: &Fr) -> G1Affine { + let env = self.env(); + let bin = + internal::Env::bn254_g1_mul(env, p0.to_object(), scalar.into()).unwrap_infallible(); + unsafe { G1Affine::from_bytes(BytesN::unchecked_new(env.clone(), bin)) } + } + + // pairing + + /// Performs a multi-pairing check between vectors of points in G1 and G2. + /// + /// This function computes the pairing for each pair of points in the + /// provided vectors `vp1` (G1 points) and `vp2` (G2 points) and verifies if + /// the product of all pairings is equal to 1 in the target group Fq12. + /// + /// # Returns: + /// - `true` if the pairing check holds (i.e., the product of pairings equals 1), + /// otherwise `false`. + /// + /// # Panics: + /// - If the lengths of `vp1` and `vp2` are not equal or if they are empty. + pub fn pairing_check(&self, vp1: Vec, vp2: Vec) -> bool { + let env = self.env(); + internal::Env::bn254_multi_pairing_check(env, vp1.into(), vp2.into()) + .unwrap_infallible() + .into() + } +} + +#[cfg(test)] +mod test { + use super::*; + + #[test] + fn test_g1affine_to_val() { + let env = Env::default(); + + let g1 = G1Affine::from_bytes(BytesN::from_array(&env, &[1; 64])); + let val: Val = g1.clone().into_val(&env); + let rt: G1Affine = val.into_val(&env); + + assert_eq!(g1, rt); + } + + #[test] + fn test_ref_g1affine_to_val() { + let env = Env::default(); + + let g1 = G1Affine::from_bytes(BytesN::from_array(&env, &[1; 64])); + let val: Val = (&g1).into_val(&env); + let rt: G1Affine = val.into_val(&env); + + assert_eq!(g1, rt); + } + + #[test] + fn test_double_ref_g1affine_to_val() { + let env = Env::default(); + + let g1 = G1Affine::from_bytes(BytesN::from_array(&env, &[1; 64])); + let val: Val = (&&g1).into_val(&env); + let rt: G1Affine = val.into_val(&env); + + assert_eq!(g1, rt); + } + + #[test] + fn test_fr_to_val() { + let env = Env::default(); + + let fr = Fr::from_bytes(BytesN::from_array(&env, &[1; 32])); + let val: Val = fr.clone().into_val(&env); + let rt: Fr = val.into_val(&env); + + assert_eq!(fr, rt); + } + + #[test] + fn test_ref_fr_to_val() { + let env = Env::default(); + + let fr = Fr::from_bytes(BytesN::from_array(&env, &[1; 32])); + let val: Val = (&fr).into_val(&env); + let rt: Fr = val.into_val(&env); + + assert_eq!(fr, rt); + } + + #[test] + fn test_double_ref_fr_to_val() { + let env = Env::default(); + + let fr = Fr::from_bytes(BytesN::from_array(&env, &[1; 32])); + let val: Val = (&&fr).into_val(&env); + let rt: Fr = val.into_val(&env); + + assert_eq!(fr, rt); + } +} diff --git a/soroban-sdk/src/env.rs b/soroban-sdk/src/env.rs index ebd2574f2..ee6abcad8 100644 --- a/soroban-sdk/src/env.rs +++ b/soroban-sdk/src/env.rs @@ -514,7 +514,7 @@ impl Env { let rf = Rc::new(EmptySnapshotSource()); let info = internal::LedgerInfo { - protocol_version: 23, + protocol_version: 25, sequence_number: 0, timestamp: 0, network_id: [0; 32], diff --git a/soroban-sdk/src/tests/cost_estimate.rs b/soroban-sdk/src/tests/cost_estimate.rs index 570517780..86e883fad 100644 --- a/soroban-sdk/src/tests/cost_estimate.rs +++ b/soroban-sdk/src/tests/cost_estimate.rs @@ -235,11 +235,26 @@ fn test_cost_estimate_budget() { Bls12381FrMul 0 None 0 0 332 0 0 0 Bls12381FrPow 0 Some(0) 0 0 691 74558 0 128 Bls12381FrInv 0 None 0 0 35421 0 0 0 + Bn254EncodeFp 0 None 0 0 344 0 0 0 + Bn254DecodeFp 0 None 0 0 476 0 0 0 + Bn254G1CheckPointOnCurve 0 None 0 0 904 0 0 0 + Bn254G2CheckPointOnCurve 0 None 0 0 2811 0 0 0 + Bn254G2CheckPointInSubgroup 0 None 0 0 2937755 0 0 0 + Bn254G1ProjectiveToAffine 0 None 0 0 61 0 0 0 + Bn254G1Add 0 None 0 0 3623 0 0 0 + Bn254G1Mul 0 None 0 0 1150435 0 0 0 + Bn254Pairing 0 Some(0) 0 0 5263916 392472814 1821 6232546 + Bn254FrFromU256 0 None 0 0 2052 0 0 0 + Bn254FrToU256 0 None 0 0 1133 0 312 0 + Bn254FrAddSub 0 None 0 0 74 0 0 0 + Bn254FrMul 0 None 0 0 332 0 0 0 + Bn254FrPow 0 Some(0) 0 0 755 68930 0 0 + Bn254FrInv 0 None 0 0 33151 0 0 0 =============================================================================================================================================================================== Internal details (diagnostics info, does not affect fees) Total # times meter was called: 197 - Shadow cpu limit: 100000000; used: 31868 - Shadow mem limit: 41943040; used: 27092 + Shadow cpu limit: 100000000; used: 32431 + Shadow mem limit: 41943040; used: 27108 =============================================================================================================================================================================== diff --git a/soroban-sdk/src/testutils/arbitrary.rs b/soroban-sdk/src/testutils/arbitrary.rs index 09ad61d29..a303cc90a 100644 --- a/soroban-sdk/src/testutils/arbitrary.rs +++ b/soroban-sdk/src/testutils/arbitrary.rs @@ -318,6 +318,11 @@ mod objects { use crate::ConversionError; use crate::{Env, IntoVal, TryFromVal, TryIntoVal}; + use crate::crypto::bn254::{ + Fr as Bn254Fr, G1Affine as Bn254G1Affine, G2Affine as Bn254G2Affine, + G1_SERIALIZED_SIZE as BN254_G1_SERIALIZED_SIZE, + G2_SERIALIZED_SIZE as BN254_G2_SERIALIZED_SIZE, + }; use crate::xdr::{Int256Parts, ScVal, UInt256Parts}; use crate::{ crypto::bls12_381::{ @@ -808,6 +813,62 @@ mod objects { Ok(Fr::from_bytes(BytesN::from_array(env, &v.bytes))) } } + + // BN254 types + + // For BN254 G1Affine (64 bytes) + #[derive(Arbitrary, Debug, Clone, Eq, PartialEq, Ord, PartialOrd)] + pub struct ArbitraryBn254G1Affine { + bytes: [u8; BN254_G1_SERIALIZED_SIZE], + } + + impl SorobanArbitrary for Bn254G1Affine { + type Prototype = ArbitraryBn254G1Affine; + } + + impl TryFromVal for Bn254G1Affine { + type Error = ConversionError; + + fn try_from_val(env: &Env, v: &ArbitraryBn254G1Affine) -> Result { + Ok(Bn254G1Affine::from_array(env, &v.bytes)) + } + } + + // For BN254 G2Affine (128 bytes) + #[derive(Arbitrary, Debug, Clone, Eq, PartialEq, Ord, PartialOrd)] + pub struct ArbitraryBn254G2Affine { + bytes: [u8; BN254_G2_SERIALIZED_SIZE], + } + + impl SorobanArbitrary for Bn254G2Affine { + type Prototype = ArbitraryBn254G2Affine; + } + + impl TryFromVal for Bn254G2Affine { + type Error = ConversionError; + + fn try_from_val(env: &Env, v: &ArbitraryBn254G2Affine) -> Result { + Ok(Bn254G2Affine::from_array(env, &v.bytes)) + } + } + + // For BN254 Fr (32 bytes) + #[derive(Arbitrary, Debug, Clone, Eq, PartialEq, Ord, PartialOrd)] + pub struct ArbitraryBn254Fr { + bytes: [u8; 32], + } + + impl SorobanArbitrary for Bn254Fr { + type Prototype = ArbitraryBn254Fr; + } + + impl TryFromVal for Bn254Fr { + type Error = ConversionError; + + fn try_from_val(env: &Env, v: &ArbitraryBn254Fr) -> Result { + Ok(Bn254Fr::from_bytes(BytesN::from_array(env, &v.bytes))) + } + } } /// Implementations of `soroban_sdk::testutils::arbitrary::api` for tuples of Soroban types. diff --git a/soroban-sdk/test_snapshots/tests/address/test_get_existing_contract_address_executable_asset.1.json b/soroban-sdk/test_snapshots/tests/address/test_get_existing_contract_address_executable_asset.1.json index ed7445ad0..eced77ff3 100644 --- a/soroban-sdk/test_snapshots/tests/address/test_get_existing_contract_address_executable_asset.1.json +++ b/soroban-sdk/test_snapshots/tests/address/test_get_existing_contract_address_executable_asset.1.json @@ -26,7 +26,7 @@ ] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/address/test_get_existing_contract_address_executable_native.1.json b/soroban-sdk/test_snapshots/tests/address/test_get_existing_contract_address_executable_native.1.json index 426d84cb9..3df0b5df4 100644 --- a/soroban-sdk/test_snapshots/tests/address/test_get_existing_contract_address_executable_native.1.json +++ b/soroban-sdk/test_snapshots/tests/address/test_get_existing_contract_address_executable_native.1.json @@ -8,7 +8,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/address/test_get_existing_contract_address_executable_wasm.1.json b/soroban-sdk/test_snapshots/tests/address/test_get_existing_contract_address_executable_wasm.1.json index 94ac5f14a..2b58f6d20 100644 --- a/soroban-sdk/test_snapshots/tests/address/test_get_existing_contract_address_executable_wasm.1.json +++ b/soroban-sdk/test_snapshots/tests/address/test_get_existing_contract_address_executable_wasm.1.json @@ -6,7 +6,7 @@ }, "auth": [], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -68,7 +68,7 @@ "val": { "contract_instance": { "executable": { - "wasm": "14946e6baa1c4606f0bc4fbbde0640071e698393f220e0b7e437337dad0ed994" + "wasm": "bace965b8cb8356bcb9ec67b78828f9f39379aa8be62c7a9982ce93c7d13eea4" }, "storage": null } @@ -83,7 +83,7 @@ [ { "contract_code": { - "hash": "14946e6baa1c4606f0bc4fbbde0640071e698393f220e0b7e437337dad0ed994" + "hash": "bace965b8cb8356bcb9ec67b78828f9f39379aa8be62c7a9982ce93c7d13eea4" } }, [ @@ -109,8 +109,8 @@ } } }, - "hash": "14946e6baa1c4606f0bc4fbbde0640071e698393f220e0b7e437337dad0ed994", - "code": "0061736d0100000001320960017e017e60037e7e7e017e60047e7e7e7e017e60027e7e017e60027f7e0060027f7f0060027f7f017f60000060017f00022b070176013300000162016d0001016d01610002017601680001016901320000017601310003016901310000030a0904050604050703080705030100110621047f01418080c0000b7f0041cc80c0000b7f0041cc80c0000b7f0041d080c0000b072f05066d656d6f7279020003616464000d015f03010a5f5f646174615f656e6403020b5f5f686561705f6261736503030aa80e09d00604017f017e027f017e23808080800041c0006b220224808080800002400240024002400240200142ff018342cb00520d00200110808080800021032002410036021020022001370308200220034220883e0214200241186a200241086a1088808080000240200229031822014202510d002001a74101710d00024020022903202201a741ff0171220441ca00460d002004410e470d010b02400240024002402001419080c08000ad4220864204844284808080c000108180808000422088a70e0400010203060b200228021020022802141089808080000d05410021050c060b2002280210200228021410898080800041014b0d04200241186a200241086a108880808000200229031822014202510d042001a74101710d0420022903202101410021040240034020044118460d01200241186a20046a4202370300200441086a21040c000b0b200142ff018342cc00520d04200141b480c08000ad422086420484200241186aad4220864204844284808080301082808080001a200241306a2002290318108a8080800020022802300d0420022903382103200241306a2002290320108a8080800020022802300d042002290328220642ff018342cb00520d0420022903382101410121050c050b2002280210200228021410898080800041014b0d03200241186a200241086a108880808000200229031822014202510d032001a74101710d032002290320220142ff01834204520d03410a410f41092001422088a72204410f461b2004410a461b22044109460d03410221050c050b2002280210200228021410898080800041014b0d02200241186a200241086a108880808000200229031822014202510d022001a74101710d022002290320220142ff018342cb00520d02410021040240034020044110460d01200241306a20046a4202370300200441086a21040c000b0b2001200241306aad4220864204844284808080201083808080001a200241186a2002290330108a8080800020022802180d022002290338220142ff018342cb00520d0220022903202103410321050c030b200041043a00000c040b200041043a00000c030b200041043a00000c020b0b200020063703182000200137031020002003370308200020043a0001200020053a00000b200241c0006a2480808080000b4a02017e017f42022102024020012802082203200128020c4f0d00200020012903002003ad4220864204841085808080003703082001200341016a360208420021020b200020023703000b1900024020012000490d00200120006b0f0b108c80808000000b5d02017f017e024002402001a741ff0171220241c100460d00024020024107460d00420121034283908080800121010c020b20014208872101420021030c010b42002103200110848080800021010b20002003370300200020013703080b910102027f017e23808080800041106b22022480808080000240024020012802082203200128020c490d00200042023703000c010b200220012903002003ad422086420484108580808000108a808080000240200341016a2203450d00200229030021042000200229030837030820002004370300200120033602080c010b108c80808000000b200241106a2480808080000b0900108f80808000000be50404027f027e017f057e23808080800041c0006b2202248080808000200241086a2000108780808000024002400240024020022d000822034104460d00200229031821002002290310210420023100092105200241086a200110878080800020022d000822064104460d002002290318210720022903102108200231000921094200210a4200210b024002400240024020030e0406020100060b200010808080800021012002410036023020022000370328200220014220883e0234420021000340200241086a200241286a108b80808000200229030822014202510d032001a74101710d0520022903102201420053200020017c2201200053470d07200121000c000b0b2005210b0c040b2000420053200420007c220b20045373450d030c040b2000420053200420007c220b20045373450d020c030b000b200241386a108e80808000000b02400240024002400240024020060e0405020100050b200710808080800021002002410036023020022007370328200220004220883e0234420021000340200241086a200241286a108b80808000200229030822014202510d032001a74101710d0420022903102201420053200020017c2201200053470d06200121000c000b0b2009210a0c030b2007420053200820077c220a200853730d030c020b2000420053200820007c220a200853730d020c010b200241386a108e80808000000b200a420053200b200a7c2200200b53730d000240024020004280808080808080c0007c42ffffffffffffffff00560d00200042088642078421000c010b200010868080800021000b200241c0006a24808080800020000f0b108c80808000000b0900108f80808000000b0300000b0b550100418080c0000b4c556474415564744255647443556474440000100004000000040010000400000008001000040000000c001000040000006162630030001000010000003100100001000000320010000100000000cf030e636f6e747261637473706563763000000003000000000000000000000008556474456e756d32000000020000000000000001410000000000000a0000000000000001420000000000000f00000002000000000000000000000007556474456e756d0000000004000000000000000000000004556474410000000100000000000000045564744200000001000007d0000000095564745374727563740000000000000100000000000000045564744300000001000007d000000008556474456e756d320000000100000000000000045564744400000001000007d0000000085564745475706c65000000010000000000000000000000085564745475706c650000000200000000000000013000000000000007000000000000000131000000000003ea0000000700000001000000000000000000000009556474537472756374000000000000030000000000000001610000000000000700000000000000016200000000000007000000000000000163000000000003ea000000070000000000000000000000036164640000000002000000000000000161000000000007d000000007556474456e756d00000000000000000162000000000007d000000007556474456e756d000000000100000007001e11636f6e7472616374656e766d6574617630000000000000001700000000002b0e636f6e74726163746d65746176300000000000000005727376657200000000000006312e38342e300000" + "hash": "bace965b8cb8356bcb9ec67b78828f9f39379aa8be62c7a9982ce93c7d13eea4", + "code": "0061736d0100000001320960017e017e60037e7e7e017e60047e7e7e7e017e60027e7e017e60027f7e0060027f7f0060027f7f017f60000060017f00022b070176013300000162016d0001016d01610002017601680001016901320000017601310003016901310000030a0904050604050703080705030100110621047f01418080c0000b7f0041cc80c0000b7f0041cc80c0000b7f0041d080c0000b072f05066d656d6f7279020003616464000d015f03010a5f5f646174615f656e6403020b5f5f686561705f6261736503030aa80e09d00604017f017e027f017e23808080800041c0006b220224808080800002400240024002400240200142ff018342cb00520d00200110808080800021032002410036021020022001370308200220034220883e0214200241186a200241086a1088808080000240200229031822014202510d002001a74101710d00024020022903202201a741ff0171220441ca00460d002004410e470d010b02400240024002402001419080c08000ad4220864204844284808080c000108180808000422088a70e0400010203060b200228021020022802141089808080000d05410021050c060b2002280210200228021410898080800041014b0d04200241186a200241086a108880808000200229031822014202510d042001a74101710d0420022903202101410021040240034020044118460d01200241186a20046a4202370300200441086a21040c000b0b200142ff018342cc00520d04200141b480c08000ad422086420484200241186aad4220864204844284808080301082808080001a200241306a2002290318108a8080800020022802300d0420022903382103200241306a2002290320108a8080800020022802300d042002290328220642ff018342cb00520d0420022903382101410121050c050b2002280210200228021410898080800041014b0d03200241186a200241086a108880808000200229031822014202510d032001a74101710d032002290320220142ff01834204520d03410a410f41092001422088a72204410f461b2004410a461b22044109460d03410221050c050b2002280210200228021410898080800041014b0d02200241186a200241086a108880808000200229031822014202510d022001a74101710d022002290320220142ff018342cb00520d02410021040240034020044110460d01200241306a20046a4202370300200441086a21040c000b0b2001200241306aad4220864204844284808080201083808080001a200241186a2002290330108a8080800020022802180d022002290338220142ff018342cb00520d0220022903202103410321050c030b200041043a00000c040b200041043a00000c030b200041043a00000c020b0b200020063703182000200137031020002003370308200020043a0001200020053a00000b200241c0006a2480808080000b4a02017e017f42022102024020012802082203200128020c4f0d00200020012903002003ad4220864204841085808080003703082001200341016a360208420021020b200020023703000b1900024020012000490d00200120006b0f0b108c80808000000b5d02017f017e024002402001a741ff0171220241c100460d00024020024107460d00420121034283908080800121010c020b20014208872101420021030c010b42002103200110848080800021010b20002003370300200020013703080b910102027f017e23808080800041106b22022480808080000240024020012802082203200128020c490d00200042023703000c010b200220012903002003ad422086420484108580808000108a808080000240200341016a2203450d00200229030021042000200229030837030820002004370300200120033602080c010b108c80808000000b200241106a2480808080000b0900108f80808000000be50404027f027e017f057e23808080800041c0006b2202248080808000200241086a2000108780808000024002400240024020022d000822034104460d00200229031821002002290310210420023100092105200241086a200110878080800020022d000822064104460d002002290318210720022903102108200231000921094200210a4200210b024002400240024020030e0406020100060b200010808080800021012002410036023020022000370328200220014220883e0234420021000340200241086a200241286a108b80808000200229030822014202510d032001a74101710d0520022903102201420053200020017c2201200053470d07200121000c000b0b2005210b0c040b2000420053200420007c220b20045373450d030c040b2000420053200420007c220b20045373450d020c030b000b200241386a108e80808000000b02400240024002400240024020060e0405020100050b200710808080800021002002410036023020022007370328200220004220883e0234420021000340200241086a200241286a108b80808000200229030822014202510d032001a74101710d0420022903102201420053200020017c2201200053470d06200121000c000b0b2009210a0c030b2007420053200820077c220a200853730d030c020b2000420053200820007c220a200853730d020c010b200241386a108e80808000000b200a420053200b200a7c2200200b53730d000240024020004280808080808080c0007c42ffffffffffffffff00560d00200042088642078421000c010b200010868080800021000b200241c0006a24808080800020000f0b108c80808000000b0900108f80808000000b0300000b0b550100418080c0000b4c556474415564744255647443556474440000100004000000040010000400000008001000040000000c001000040000006162630030001000010000003100100001000000320010000100000000cf030e636f6e747261637473706563763000000003000000000000000000000008556474456e756d32000000020000000000000001410000000000000a0000000000000001420000000000000f00000002000000000000000000000007556474456e756d0000000004000000000000000000000004556474410000000100000000000000045564744200000001000007d0000000095564745374727563740000000000000100000000000000045564744300000001000007d000000008556474456e756d320000000100000000000000045564744400000001000007d0000000085564745475706c65000000010000000000000000000000085564745475706c650000000200000000000000013000000000000007000000000000000131000000000003ea0000000700000001000000000000000000000009556474537472756374000000000000030000000000000001610000000000000700000000000000016200000000000007000000000000000163000000000003ea000000070000000000000000000000036164640000000002000000000000000161000000000007d000000007556474456e756d00000000000000000162000000000007d000000007556474456e756d000000000100000007001e11636f6e7472616374656e766d6574617630000000000000001900000000002b0e636f6e74726163746d65746176300000000000000005727376657200000000000006312e38342e300000" } }, "ext": "v0" diff --git a/soroban-sdk/test_snapshots/tests/auth/auth_10_one/test.1.json b/soroban-sdk/test_snapshots/tests/auth/auth_10_one/test.1.json index 12d09ed5d..f9e08f0ff 100644 --- a/soroban-sdk/test_snapshots/tests/auth/auth_10_one/test.1.json +++ b/soroban-sdk/test_snapshots/tests/auth/auth_10_one/test.1.json @@ -60,7 +60,7 @@ ] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/auth/auth_15_one_repeat/test.1.json b/soroban-sdk/test_snapshots/tests/auth/auth_15_one_repeat/test.1.json index 94132112d..f25d07edd 100644 --- a/soroban-sdk/test_snapshots/tests/auth/auth_15_one_repeat/test.1.json +++ b/soroban-sdk/test_snapshots/tests/auth/auth_15_one_repeat/test.1.json @@ -58,7 +58,7 @@ ] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/auth/auth_17_no_consume_requirement/test.1.json b/soroban-sdk/test_snapshots/tests/auth/auth_17_no_consume_requirement/test.1.json index 489bc36ef..60a698356 100644 --- a/soroban-sdk/test_snapshots/tests/auth/auth_17_no_consume_requirement/test.1.json +++ b/soroban-sdk/test_snapshots/tests/auth/auth_17_no_consume_requirement/test.1.json @@ -35,7 +35,7 @@ ] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/auth/auth_20_deep_one_address/test.1.json b/soroban-sdk/test_snapshots/tests/auth/auth_20_deep_one_address/test.1.json index 755979bc7..00a75af19 100644 --- a/soroban-sdk/test_snapshots/tests/auth/auth_20_deep_one_address/test.1.json +++ b/soroban-sdk/test_snapshots/tests/auth/auth_20_deep_one_address/test.1.json @@ -29,7 +29,7 @@ ] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/auth/auth_20_deep_one_address/test_auth_tree.1.json b/soroban-sdk/test_snapshots/tests/auth/auth_20_deep_one_address/test_auth_tree.1.json index b263be6fb..3158788d1 100644 --- a/soroban-sdk/test_snapshots/tests/auth/auth_20_deep_one_address/test_auth_tree.1.json +++ b/soroban-sdk/test_snapshots/tests/auth/auth_20_deep_one_address/test_auth_tree.1.json @@ -11,7 +11,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/auth/auth_30_deep_one_address_repeat/test.1.json b/soroban-sdk/test_snapshots/tests/auth/auth_30_deep_one_address_repeat/test.1.json index ddd5fe144..e1c24b230 100644 --- a/soroban-sdk/test_snapshots/tests/auth/auth_30_deep_one_address_repeat/test.1.json +++ b/soroban-sdk/test_snapshots/tests/auth/auth_30_deep_one_address_repeat/test.1.json @@ -47,7 +47,7 @@ ] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/auth/auth_30_deep_one_address_repeat/test_auth_tree.1.json b/soroban-sdk/test_snapshots/tests/auth/auth_30_deep_one_address_repeat/test_auth_tree.1.json index b263be6fb..3158788d1 100644 --- a/soroban-sdk/test_snapshots/tests/auth/auth_30_deep_one_address_repeat/test_auth_tree.1.json +++ b/soroban-sdk/test_snapshots/tests/auth/auth_30_deep_one_address_repeat/test_auth_tree.1.json @@ -11,7 +11,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/auth/auth_35_deep_one_address_repeat_grouped/test.1.json b/soroban-sdk/test_snapshots/tests/auth/auth_35_deep_one_address_repeat_grouped/test.1.json index ddd5fe144..e1c24b230 100644 --- a/soroban-sdk/test_snapshots/tests/auth/auth_35_deep_one_address_repeat_grouped/test.1.json +++ b/soroban-sdk/test_snapshots/tests/auth/auth_35_deep_one_address_repeat_grouped/test.1.json @@ -47,7 +47,7 @@ ] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/auth/auth_35_deep_one_address_repeat_grouped/test_auth_tree.1.json b/soroban-sdk/test_snapshots/tests/auth/auth_35_deep_one_address_repeat_grouped/test_auth_tree.1.json index b263be6fb..3158788d1 100644 --- a/soroban-sdk/test_snapshots/tests/auth/auth_35_deep_one_address_repeat_grouped/test_auth_tree.1.json +++ b/soroban-sdk/test_snapshots/tests/auth/auth_35_deep_one_address_repeat_grouped/test_auth_tree.1.json @@ -11,7 +11,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/auth/auth_40_multi_one_address/test_auth_as_tree.1.json b/soroban-sdk/test_snapshots/tests/auth/auth_40_multi_one_address/test_auth_as_tree.1.json index 23942895d..952ec32a5 100644 --- a/soroban-sdk/test_snapshots/tests/auth/auth_40_multi_one_address/test_auth_as_tree.1.json +++ b/soroban-sdk/test_snapshots/tests/auth/auth_40_multi_one_address/test_auth_as_tree.1.json @@ -44,7 +44,7 @@ ] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/auth/auth_40_multi_one_address/test_auth_not_allowed_with_separated_tree.1.json b/soroban-sdk/test_snapshots/tests/auth/auth_40_multi_one_address/test_auth_not_allowed_with_separated_tree.1.json index 7b1032299..9470087f7 100644 --- a/soroban-sdk/test_snapshots/tests/auth/auth_40_multi_one_address/test_auth_not_allowed_with_separated_tree.1.json +++ b/soroban-sdk/test_snapshots/tests/auth/auth_40_multi_one_address/test_auth_not_allowed_with_separated_tree.1.json @@ -12,7 +12,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_add_i32/test_functional.1.json b/soroban-sdk/test_snapshots/tests/contract_add_i32/test_functional.1.json index 6a19fbf66..72bea1158 100644 --- a/soroban-sdk/test_snapshots/tests/contract_add_i32/test_functional.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_add_i32/test_functional.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_assert/test_invoke_expect_error.1.json b/soroban-sdk/test_snapshots/tests/contract_assert/test_invoke_expect_error.1.json index 6a19fbf66..72bea1158 100644 --- a/soroban-sdk/test_snapshots/tests/contract_assert/test_invoke_expect_error.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_assert/test_invoke_expect_error.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_assert/test_try_invoke.1.json b/soroban-sdk/test_snapshots/tests/contract_assert/test_try_invoke.1.json index 6a19fbf66..72bea1158 100644 --- a/soroban-sdk/test_snapshots/tests/contract_assert/test_try_invoke.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_assert/test_try_invoke.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_custom_account_impl/test_functional.1.json b/soroban-sdk/test_snapshots/tests/contract_custom_account_impl/test_functional.1.json index 6a19fbf66..72bea1158 100644 --- a/soroban-sdk/test_snapshots/tests/contract_custom_account_impl/test_functional.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_custom_account_impl/test_functional.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_docs/fn_/test_functional.1.json b/soroban-sdk/test_snapshots/tests/contract_docs/fn_/test_functional.1.json index 6a19fbf66..72bea1158 100644 --- a/soroban-sdk/test_snapshots/tests/contract_docs/fn_/test_functional.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_docs/fn_/test_functional.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_duration/test_functional.1.json b/soroban-sdk/test_snapshots/tests/contract_duration/test_functional.1.json index 6a19fbf66..72bea1158 100644 --- a/soroban-sdk/test_snapshots/tests/contract_duration/test_functional.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_duration/test_functional.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_event/test_data_map.1.json b/soroban-sdk/test_snapshots/tests/contract_event/test_data_map.1.json index 7e1a1367a..279d71410 100644 --- a/soroban-sdk/test_snapshots/tests/contract_event/test_data_map.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_event/test_data_map.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_event/test_data_map_no_data.1.json b/soroban-sdk/test_snapshots/tests/contract_event/test_data_map_no_data.1.json index 5dfa62747..dc9f6752d 100644 --- a/soroban-sdk/test_snapshots/tests/contract_event/test_data_map_no_data.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_event/test_data_map_no_data.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_event/test_data_single_value.1.json b/soroban-sdk/test_snapshots/tests/contract_event/test_data_single_value.1.json index a192dd0ee..e8efa4441 100644 --- a/soroban-sdk/test_snapshots/tests/contract_event/test_data_single_value.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_event/test_data_single_value.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_event/test_data_single_value_no_data.1.json b/soroban-sdk/test_snapshots/tests/contract_event/test_data_single_value_no_data.1.json index ffd4c1b4e..61bd3bb24 100644 --- a/soroban-sdk/test_snapshots/tests/contract_event/test_data_single_value_no_data.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_event/test_data_single_value_no_data.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_event/test_data_vec.1.json b/soroban-sdk/test_snapshots/tests/contract_event/test_data_vec.1.json index 33e6f746b..a9666f4c6 100644 --- a/soroban-sdk/test_snapshots/tests/contract_event/test_data_vec.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_event/test_data_vec.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_event/test_data_vec_no_data.1.json b/soroban-sdk/test_snapshots/tests/contract_event/test_data_vec_no_data.1.json index 86fca5032..eb31af59c 100644 --- a/soroban-sdk/test_snapshots/tests/contract_event/test_data_vec_no_data.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_event/test_data_vec_no_data.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_event/test_defaults.1.json b/soroban-sdk/test_snapshots/tests/contract_event/test_defaults.1.json index 566e8d6eb..4cde8a93e 100644 --- a/soroban-sdk/test_snapshots/tests/contract_event/test_defaults.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_event/test_defaults.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_event/test_no_prefix_topics.1.json b/soroban-sdk/test_snapshots/tests/contract_event/test_no_prefix_topics.1.json index fdf7cb6c1..1e8572c82 100644 --- a/soroban-sdk/test_snapshots/tests/contract_event/test_no_prefix_topics.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_event/test_no_prefix_topics.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_event/test_no_topics.1.json b/soroban-sdk/test_snapshots/tests/contract_event/test_no_topics.1.json index e0d0c876c..37ee0a49c 100644 --- a/soroban-sdk/test_snapshots/tests/contract_event/test_no_topics.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_event/test_no_topics.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_event/test_no_topics_no_data.1.json b/soroban-sdk/test_snapshots/tests/contract_event/test_no_topics_no_data.1.json index 7dc0e1ce4..4db9fe694 100644 --- a/soroban-sdk/test_snapshots/tests/contract_event/test_no_topics_no_data.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_event/test_no_topics_no_data.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_event/test_prefix_topics.1.json b/soroban-sdk/test_snapshots/tests/contract_event/test_prefix_topics.1.json index 5e56776d1..d67f9dd96 100644 --- a/soroban-sdk/test_snapshots/tests/contract_event/test_prefix_topics.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_event/test_prefix_topics.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_event/test_ref_fields.1.json b/soroban-sdk/test_snapshots/tests/contract_event/test_ref_fields.1.json index 7e1a1367a..279d71410 100644 --- a/soroban-sdk/test_snapshots/tests/contract_event/test_ref_fields.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_event/test_ref_fields.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_fn/test_functional.1.json b/soroban-sdk/test_snapshots/tests/contract_fn/test_functional.1.json index 721d018c4..b527a7198 100644 --- a/soroban-sdk/test_snapshots/tests/contract_fn/test_functional.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_fn/test_functional.1.json @@ -11,7 +11,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_invoke/test_invoke_expect_error.1.json b/soroban-sdk/test_snapshots/tests/contract_invoke/test_invoke_expect_error.1.json index 6a19fbf66..72bea1158 100644 --- a/soroban-sdk/test_snapshots/tests/contract_invoke/test_invoke_expect_error.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_invoke/test_invoke_expect_error.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_invoke/test_invoke_expect_string.1.json b/soroban-sdk/test_snapshots/tests/contract_invoke/test_invoke_expect_string.1.json index 6a19fbf66..72bea1158 100644 --- a/soroban-sdk/test_snapshots/tests/contract_invoke/test_invoke_expect_string.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_invoke/test_invoke_expect_string.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_invoke/test_try_invoke.1.json b/soroban-sdk/test_snapshots/tests/contract_invoke/test_try_invoke.1.json index 6a19fbf66..72bea1158 100644 --- a/soroban-sdk/test_snapshots/tests/contract_invoke/test_try_invoke.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_invoke/test_try_invoke.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_invoke_arg_count/test_correct_arg_count.1.json b/soroban-sdk/test_snapshots/tests/contract_invoke_arg_count/test_correct_arg_count.1.json index e35171bbe..f3e5c5600 100644 --- a/soroban-sdk/test_snapshots/tests/contract_invoke_arg_count/test_correct_arg_count.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_invoke_arg_count/test_correct_arg_count.1.json @@ -10,7 +10,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_invoke_arg_count/test_too_few_args.1.json b/soroban-sdk/test_snapshots/tests/contract_invoke_arg_count/test_too_few_args.1.json index e35171bbe..f3e5c5600 100644 --- a/soroban-sdk/test_snapshots/tests/contract_invoke_arg_count/test_too_few_args.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_invoke_arg_count/test_too_few_args.1.json @@ -10,7 +10,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_invoke_arg_count/test_too_many_args.1.json b/soroban-sdk/test_snapshots/tests/contract_invoke_arg_count/test_too_many_args.1.json index e35171bbe..f3e5c5600 100644 --- a/soroban-sdk/test_snapshots/tests/contract_invoke_arg_count/test_too_many_args.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_invoke_arg_count/test_too_many_args.1.json @@ -10,7 +10,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_overlapping_type_fn_names/test_functional.1.json b/soroban-sdk/test_snapshots/tests/contract_overlapping_type_fn_names/test_functional.1.json index 6a19fbf66..72bea1158 100644 --- a/soroban-sdk/test_snapshots/tests/contract_overlapping_type_fn_names/test_functional.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_overlapping_type_fn_names/test_functional.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_snapshot/test.1.json b/soroban-sdk/test_snapshots/tests/contract_snapshot/test.1.json index f8538afdb..3281069ee 100644 --- a/soroban-sdk/test_snapshots/tests/contract_snapshot/test.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_snapshot/test.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_snapshot/test.2.json b/soroban-sdk/test_snapshots/tests/contract_snapshot/test.2.json index 676cee650..2afea6cf4 100644 --- a/soroban-sdk/test_snapshots/tests/contract_snapshot/test.2.json +++ b/soroban-sdk/test_snapshots/tests/contract_snapshot/test.2.json @@ -10,7 +10,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_store/test_storage.1.json b/soroban-sdk/test_snapshots/tests/contract_store/test_storage.1.json index d09c071cb..6ae7c6cc0 100644 --- a/soroban-sdk/test_snapshots/tests/contract_store/test_storage.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_store/test_storage.1.json @@ -42,7 +42,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_store/test_temp_storage_extension_past_max_ttl_panics.1.json b/soroban-sdk/test_snapshots/tests/contract_store/test_temp_storage_extension_past_max_ttl_panics.1.json index 09d3a6af4..3c50ed95f 100644 --- a/soroban-sdk/test_snapshots/tests/contract_store/test_temp_storage_extension_past_max_ttl_panics.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_store/test_temp_storage_extension_past_max_ttl_panics.1.json @@ -10,7 +10,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_timepoint/test_functional.1.json b/soroban-sdk/test_snapshots/tests/contract_timepoint/test_functional.1.json index 6a19fbf66..72bea1158 100644 --- a/soroban-sdk/test_snapshots/tests/contract_timepoint/test_functional.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_timepoint/test_functional.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_udt_enum/test_functional.1.json b/soroban-sdk/test_snapshots/tests/contract_udt_enum/test_functional.1.json index 6a19fbf66..72bea1158 100644 --- a/soroban-sdk/test_snapshots/tests/contract_udt_enum/test_functional.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_udt_enum/test_functional.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_udt_enum_error/test_error.1.json b/soroban-sdk/test_snapshots/tests/contract_udt_enum_error/test_error.1.json index 6a19fbf66..72bea1158 100644 --- a/soroban-sdk/test_snapshots/tests/contract_udt_enum_error/test_error.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_udt_enum_error/test_error.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_udt_enum_error/test_success.1.json b/soroban-sdk/test_snapshots/tests/contract_udt_enum_error/test_success.1.json index 6a19fbf66..72bea1158 100644 --- a/soroban-sdk/test_snapshots/tests/contract_udt_enum_error/test_success.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_udt_enum_error/test_success.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_udt_option/test_functional.1.json b/soroban-sdk/test_snapshots/tests/contract_udt_option/test_functional.1.json index 6a19fbf66..72bea1158 100644 --- a/soroban-sdk/test_snapshots/tests/contract_udt_option/test_functional.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_udt_option/test_functional.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_udt_struct/test_functional.1.json b/soroban-sdk/test_snapshots/tests/contract_udt_struct/test_functional.1.json index 6a19fbf66..72bea1158 100644 --- a/soroban-sdk/test_snapshots/tests/contract_udt_struct/test_functional.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_udt_struct/test_functional.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_udt_struct/test_long_names_functional.1.json b/soroban-sdk/test_snapshots/tests/contract_udt_struct/test_long_names_functional.1.json index 6a19fbf66..72bea1158 100644 --- a/soroban-sdk/test_snapshots/tests/contract_udt_struct/test_long_names_functional.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_udt_struct/test_long_names_functional.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/contract_udt_struct_tuple/test_functional.1.json b/soroban-sdk/test_snapshots/tests/contract_udt_struct_tuple/test_functional.1.json index 6a19fbf66..72bea1158 100644 --- a/soroban-sdk/test_snapshots/tests/contract_udt_struct_tuple/test_functional.1.json +++ b/soroban-sdk/test_snapshots/tests/contract_udt_struct_tuple/test_functional.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/cost_estimate/test_cost_estimate_budget.1.json b/soroban-sdk/test_snapshots/tests/cost_estimate/test_cost_estimate_budget.1.json index ce0e85962..ab1d9676f 100644 --- a/soroban-sdk/test_snapshots/tests/cost_estimate/test_cost_estimate_budget.1.json +++ b/soroban-sdk/test_snapshots/tests/cost_estimate/test_cost_estimate_budget.1.json @@ -8,7 +8,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/cost_estimate/test_cost_estimate_with_storage.1.json b/soroban-sdk/test_snapshots/tests/cost_estimate/test_cost_estimate_with_storage.1.json index a84c9a43c..c995cab33 100644 --- a/soroban-sdk/test_snapshots/tests/cost_estimate/test_cost_estimate_with_storage.1.json +++ b/soroban-sdk/test_snapshots/tests/cost_estimate/test_cost_estimate_with_storage.1.json @@ -11,7 +11,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/crypto_bls12_381/test_invoke_contract.1.json b/soroban-sdk/test_snapshots/tests/crypto_bls12_381/test_invoke_contract.1.json index 79ce1aa3c..d5ceccc40 100644 --- a/soroban-sdk/test_snapshots/tests/crypto_bls12_381/test_invoke_contract.1.json +++ b/soroban-sdk/test_snapshots/tests/crypto_bls12_381/test_invoke_contract.1.json @@ -10,7 +10,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -104,7 +104,7 @@ "val": { "contract_instance": { "executable": { - "wasm": "a654fd691c9395f5480486e18ebc75f56d7021e109c242b10ad5aa4bbd9a040c" + "wasm": "cf2ec4405dbfcf217a8dc7f7f30939bbf83b8a2cdda3299493064a66d5392362" }, "storage": null } @@ -119,7 +119,7 @@ [ { "contract_code": { - "hash": "a654fd691c9395f5480486e18ebc75f56d7021e109c242b10ad5aa4bbd9a040c" + "hash": "cf2ec4405dbfcf217a8dc7f7f30939bbf83b8a2cdda3299493064a66d5392362" } }, [ @@ -145,8 +145,8 @@ } } }, - "hash": "a654fd691c9395f5480486e18ebc75f56d7021e109c242b10ad5aa4bbd9a040c", - "code": "0061736d01000000011e0560027e7e017e60047e7e7e7e017e60017e017e60027f7e0060017f017e023d0a016301360000016301630000016d016100010162013800020163013800020163013400020163016500020163016100020163016700000176016700000308070003000302030405030100110621047f01418080c0000b7f0041b480c0000b7f0041b480c0000b7f0041c080c0000b074a07066d656d6f727902000667315f6d756c000a0667325f6d756c000c0c64756d6d795f766572696679000e015f03010a5f5f646174615f656e6403020b5f5f686561705f6261736503030a9807076701027f23808080800041106b220224808080800020022000108b80808000024020022802004101460d002002290308210002402001a741ff01712203410c460d00200341c600470d010b200020011080808080002101200241106a24808080800020010f0b000b4d01017f23808080800041106b220224808080800020022001108f8080800042012101024020022802000d0020002002290308370308420021010b20002001370300200241106a2480808080000b6701027f23808080800041106b220224808080800020022000108d80808000024020022802004101460d002002290308210002402001a741ff01712203410c460d00200341c600470d010b200020011081808080002101200241106a24808080800020010f0b000b4201017e420121020240200142ff018342c800520d0020011083808080004280808080708342808080808018520d0020002001370308420021020b200020023703000bd90303027f047e017f23808080800041c0006b2201248080808000410021020240034020024128460d01200141086a20026a4202370300200241086a21020c000b0b0240200042ff018342cc00520d002000418c80c08000ad422086420484200141086aad4220864204844284808080d0001082808080001a2001290308220042ff018342c800520d0020001083808080004280808080708342808080808006520d00200141306a2001290310108f8080800020012802300d0020012903382103024020012903182204a741ff01712202410c460d00200241c600470d010b200141306a2001290320108b8080800020012802300d0020012903382105200141306a2001290328108d8080800020012802300d002001290338210620001084808080001085808080001a20031086808080001087808080001a200520041080808080002103200620041081808080002104420221004101210203402000210520024101712107410021022003210020070d000b20012005370308200141086a1090808080002105420221004101210203402000210320024101712107410021022004210020070d000b200120033703082005200141086a1090808080001088808080002100200141c0006a2480808080002000420151ad0f0b000b4201017e420121020240200142ff018342c800520d002001108380808000428080808070834280808080800c520d0020002001370308420021020b200020023703000b17002000ad4220864204844284808080101089808080000b0b3d0100418080c0000b346670667032667267316732000000100002000000020010000300000005001000020000000700100002000000090010000200000000e7020e636f6e74726163747370656376300000000100000000000000000000000a44756d6d7950726f6f66000000000005000000000000000266700000000003ee00000030000000000000000366703200000003ee000000600000000000000002667200000000000c000000000000000267310000000003ee00000060000000000000000267320000000003ee000000c000000000000000000000000667315f6d756c000000000002000000000000000170000000000003ee000000600000000000000001730000000000000c00000001000003ee0000006000000000000000000000000667325f6d756c000000000002000000000000000170000000000003ee000000c00000000000000001730000000000000c00000001000003ee000000c000000000000000000000000c64756d6d795f76657269667900000001000000000000000570726f6f66000000000007d00000000a44756d6d7950726f6f6600000000000100000001001e11636f6e7472616374656e766d6574617630000000000000001700000000002b0e636f6e74726163746d65746176300000000000000005727376657200000000000006312e38342e300000" + "hash": "cf2ec4405dbfcf217a8dc7f7f30939bbf83b8a2cdda3299493064a66d5392362", + "code": "0061736d01000000011e0560027e7e017e60047e7e7e7e017e60017e017e60027f7e0060017f017e023d0a016301360000016301630000016d016100010162013800020163013800020163013400020163016500020163016100020163016700000176016700000308070003000302030405030100110621047f01418080c0000b7f0041b480c0000b7f0041b480c0000b7f0041c080c0000b074a07066d656d6f727902000667315f6d756c000a0667325f6d756c000c0c64756d6d795f766572696679000e015f03010a5f5f646174615f656e6403020b5f5f686561705f6261736503030a9807076701027f23808080800041106b220224808080800020022000108b80808000024020022802004101460d002002290308210002402001a741ff01712203410c460d00200341c600470d010b200020011080808080002101200241106a24808080800020010f0b000b4d01017f23808080800041106b220224808080800020022001108f8080800042012101024020022802000d0020002002290308370308420021010b20002001370300200241106a2480808080000b6701027f23808080800041106b220224808080800020022000108d80808000024020022802004101460d002002290308210002402001a741ff01712203410c460d00200341c600470d010b200020011081808080002101200241106a24808080800020010f0b000b4201017e420121020240200142ff018342c800520d0020011083808080004280808080708342808080808018520d0020002001370308420021020b200020023703000bd90303027f047e017f23808080800041c0006b2201248080808000410021020240034020024128460d01200141086a20026a4202370300200241086a21020c000b0b0240200042ff018342cc00520d002000418c80c08000ad422086420484200141086aad4220864204844284808080d0001082808080001a2001290308220042ff018342c800520d0020001083808080004280808080708342808080808006520d00200141306a2001290310108f8080800020012802300d0020012903382103024020012903182204a741ff01712202410c460d00200241c600470d010b200141306a2001290320108b8080800020012802300d0020012903382105200141306a2001290328108d8080800020012802300d002001290338210620001084808080001085808080001a20031086808080001087808080001a200520041080808080002103200620041081808080002104420221004101210203402000210520024101712107410021022003210020070d000b20012005370308200141086a1090808080002105420221004101210203402000210320024101712107410021022004210020070d000b200120033703082005200141086a1090808080001088808080002100200141c0006a2480808080002000420151ad0f0b000b4201017e420121020240200142ff018342c800520d002001108380808000428080808070834280808080800c520d0020002001370308420021020b200020023703000b17002000ad4220864204844284808080101089808080000b0b3d0100418080c0000b346670667032667267316732000000100002000000020010000300000005001000020000000700100002000000090010000200000000e7020e636f6e74726163747370656376300000000100000000000000000000000a44756d6d7950726f6f66000000000005000000000000000266700000000003ee00000030000000000000000366703200000003ee000000600000000000000002667200000000000c000000000000000267310000000003ee00000060000000000000000267320000000003ee000000c000000000000000000000000667315f6d756c000000000002000000000000000170000000000003ee000000600000000000000001730000000000000c00000001000003ee0000006000000000000000000000000667325f6d756c000000000002000000000000000170000000000003ee000000c00000000000000001730000000000000c00000001000003ee000000c000000000000000000000000c64756d6d795f76657269667900000001000000000000000570726f6f66000000000007d00000000a44756d6d7950726f6f6600000000000100000001001e11636f6e7472616374656e766d6574617630000000000000001900000000002b0e636f6e74726163746d65746176300000000000000005727376657200000000000006312e38342e300000" } }, "ext": "v0" diff --git a/soroban-sdk/test_snapshots/tests/env/default_and_from_snapshot_same_settings.1.json b/soroban-sdk/test_snapshots/tests/env/default_and_from_snapshot_same_settings.1.json index 69dc08908..23a434545 100644 --- a/soroban-sdk/test_snapshots/tests/env/default_and_from_snapshot_same_settings.1.json +++ b/soroban-sdk/test_snapshots/tests/env/default_and_from_snapshot_same_settings.1.json @@ -10,7 +10,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/env/default_and_from_snapshot_same_settings.2.json b/soroban-sdk/test_snapshots/tests/env/default_and_from_snapshot_same_settings.2.json index 69dc08908..23a434545 100644 --- a/soroban-sdk/test_snapshots/tests/env/default_and_from_snapshot_same_settings.2.json +++ b/soroban-sdk/test_snapshots/tests/env/default_and_from_snapshot_same_settings.2.json @@ -10,7 +10,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/env/register_contract_deploys_predictable_contract_ids.1.json b/soroban-sdk/test_snapshots/tests/env/register_contract_deploys_predictable_contract_ids.1.json index 2cee3792d..414d39042 100644 --- a/soroban-sdk/test_snapshots/tests/env/register_contract_deploys_predictable_contract_ids.1.json +++ b/soroban-sdk/test_snapshots/tests/env/register_contract_deploys_predictable_contract_ids.1.json @@ -8,7 +8,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/env/register_contract_deploys_predictable_contract_ids.2.json b/soroban-sdk/test_snapshots/tests/env/register_contract_deploys_predictable_contract_ids.2.json index 460aa2745..1694b5cb0 100644 --- a/soroban-sdk/test_snapshots/tests/env/register_contract_deploys_predictable_contract_ids.2.json +++ b/soroban-sdk/test_snapshots/tests/env/register_contract_deploys_predictable_contract_ids.2.json @@ -10,7 +10,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/env/register_contract_deploys_predictable_contract_ids.3.json b/soroban-sdk/test_snapshots/tests/env/register_contract_deploys_predictable_contract_ids.3.json index 460aa2745..1694b5cb0 100644 --- a/soroban-sdk/test_snapshots/tests/env/register_contract_deploys_predictable_contract_ids.3.json +++ b/soroban-sdk/test_snapshots/tests/env/register_contract_deploys_predictable_contract_ids.3.json @@ -10,7 +10,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/max_ttl/max.1.json b/soroban-sdk/test_snapshots/tests/max_ttl/max.1.json index 0073dd2ea..acf828c3d 100644 --- a/soroban-sdk/test_snapshots/tests/max_ttl/max.1.json +++ b/soroban-sdk/test_snapshots/tests/max_ttl/max.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 1, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/muxed_address/test_accept_muxed_address_argument_in_contract.1.json b/soroban-sdk/test_snapshots/tests/muxed_address/test_accept_muxed_address_argument_in_contract.1.json index 745f8fb7e..cab7b1033 100644 --- a/soroban-sdk/test_snapshots/tests/muxed_address/test_accept_muxed_address_argument_in_contract.1.json +++ b/soroban-sdk/test_snapshots/tests/muxed_address/test_accept_muxed_address_argument_in_contract.1.json @@ -14,7 +14,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_array.1.json b/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_array.1.json index 6a19fbf66..72bea1158 100644 --- a/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_array.1.json +++ b/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_array.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_bytes.1.json b/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_bytes.1.json index 6a19fbf66..72bea1158 100644 --- a/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_bytes.1.json +++ b/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_bytes.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_bytesn.1.json b/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_bytesn.1.json index 6a19fbf66..72bea1158 100644 --- a/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_bytesn.1.json +++ b/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_bytesn.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_slice.1.json b/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_slice.1.json index 6a19fbf66..72bea1158 100644 --- a/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_slice.1.json +++ b/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_slice.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_u64.1.json b/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_u64.1.json index 6a19fbf66..72bea1158 100644 --- a/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_u64.1.json +++ b/soroban-sdk/test_snapshots/tests/prng/test_prng_fill_u64.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_array.1.json b/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_array.1.json index 6a19fbf66..72bea1158 100644 --- a/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_array.1.json +++ b/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_array.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_bytesn.1.json b/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_bytesn.1.json index 6a19fbf66..72bea1158 100644 --- a/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_bytesn.1.json +++ b/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_bytesn.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_len_bytes.1.json b/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_len_bytes.1.json index 6a19fbf66..72bea1158 100644 --- a/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_len_bytes.1.json +++ b/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_len_bytes.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_range_u64.1.json b/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_range_u64.1.json index 6a19fbf66..72bea1158 100644 --- a/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_range_u64.1.json +++ b/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_range_u64.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_range_u64_panic_on_invalid_range.1.json b/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_range_u64_panic_on_invalid_range.1.json index 426d84cb9..3df0b5df4 100644 --- a/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_range_u64_panic_on_invalid_range.1.json +++ b/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_range_u64_panic_on_invalid_range.1.json @@ -8,7 +8,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_u64.1.json b/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_u64.1.json index 6a19fbf66..72bea1158 100644 --- a/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_u64.1.json +++ b/soroban-sdk/test_snapshots/tests/prng/test_prng_gen_u64.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/prng/test_prng_seed.1.json b/soroban-sdk/test_snapshots/tests/prng/test_prng_seed.1.json index 6a19fbf66..72bea1158 100644 --- a/soroban-sdk/test_snapshots/tests/prng/test_prng_seed.1.json +++ b/soroban-sdk/test_snapshots/tests/prng/test_prng_seed.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/prng/test_prng_seed.2.json b/soroban-sdk/test_snapshots/tests/prng/test_prng_seed.2.json index 6a19fbf66..72bea1158 100644 --- a/soroban-sdk/test_snapshots/tests/prng/test_prng_seed.2.json +++ b/soroban-sdk/test_snapshots/tests/prng/test_prng_seed.2.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/prng/test_prng_shuffle.1.json b/soroban-sdk/test_snapshots/tests/prng/test_prng_shuffle.1.json index 3d940b4d1..61f0e84d2 100644 --- a/soroban-sdk/test_snapshots/tests/prng/test_prng_shuffle.1.json +++ b/soroban-sdk/test_snapshots/tests/prng/test_prng_shuffle.1.json @@ -10,7 +10,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/prng/test_vec_shuffle.1.json b/soroban-sdk/test_snapshots/tests/prng/test_vec_shuffle.1.json index 3d940b4d1..61f0e84d2 100644 --- a/soroban-sdk/test_snapshots/tests/prng/test_vec_shuffle.1.json +++ b/soroban-sdk/test_snapshots/tests/prng/test_vec_shuffle.1.json @@ -10,7 +10,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/storage_testutils/all.1.json b/soroban-sdk/test_snapshots/tests/storage_testutils/all.1.json index fc3beaa40..cc42587dc 100644 --- a/soroban-sdk/test_snapshots/tests/storage_testutils/all.1.json +++ b/soroban-sdk/test_snapshots/tests/storage_testutils/all.1.json @@ -10,7 +10,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/storage_testutils/temp_entry_expiration.1.json b/soroban-sdk/test_snapshots/tests/storage_testutils/temp_entry_expiration.1.json index b6b98da92..57e7ed6c7 100644 --- a/soroban-sdk/test_snapshots/tests/storage_testutils/temp_entry_expiration.1.json +++ b/soroban-sdk/test_snapshots/tests/storage_testutils/temp_entry_expiration.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 1099, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/storage_testutils/test_persistent_entry_automatically_restored.1.json b/soroban-sdk/test_snapshots/tests/storage_testutils/test_persistent_entry_automatically_restored.1.json index 6c7d5f2ae..9983327b6 100644 --- a/soroban-sdk/test_snapshots/tests/storage_testutils/test_persistent_entry_automatically_restored.1.json +++ b/soroban-sdk/test_snapshots/tests/storage_testutils/test_persistent_entry_automatically_restored.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 10000, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/storage_testutils/ttl_getters.1.json b/soroban-sdk/test_snapshots/tests/storage_testutils/ttl_getters.1.json index fa3aabc7e..da24df7c7 100644 --- a/soroban-sdk/test_snapshots/tests/storage_testutils/ttl_getters.1.json +++ b/soroban-sdk/test_snapshots/tests/storage_testutils/ttl_getters.1.json @@ -18,7 +18,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 1000, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/token_client/test_issuer_flags.1.json b/soroban-sdk/test_snapshots/tests/token_client/test_issuer_flags.1.json index 8b4697dd5..a36c07294 100644 --- a/soroban-sdk/test_snapshots/tests/token_client/test_issuer_flags.1.json +++ b/soroban-sdk/test_snapshots/tests/token_client/test_issuer_flags.1.json @@ -26,7 +26,7 @@ ] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/token_client/test_mock_all_auth.1.json b/soroban-sdk/test_snapshots/tests/token_client/test_mock_all_auth.1.json index ce8790a18..898ec8690 100644 --- a/soroban-sdk/test_snapshots/tests/token_client/test_mock_all_auth.1.json +++ b/soroban-sdk/test_snapshots/tests/token_client/test_mock_all_auth.1.json @@ -60,7 +60,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-sdk/test_snapshots/tests/token_client/test_mock_auth.1.json b/soroban-sdk/test_snapshots/tests/token_client/test_mock_auth.1.json index 901cac378..01d57a747 100644 --- a/soroban-sdk/test_snapshots/tests/token_client/test_mock_auth.1.json +++ b/soroban-sdk/test_snapshots/tests/token_client/test_mock_auth.1.json @@ -60,7 +60,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-token-sdk/test_snapshots/tests/events/test_approve.1.json b/soroban-token-sdk/test_snapshots/tests/events/test_approve.1.json index 4b55a9da9..a9911dea5 100644 --- a/soroban-token-sdk/test_snapshots/tests/events/test_approve.1.json +++ b/soroban-token-sdk/test_snapshots/tests/events/test_approve.1.json @@ -57,7 +57,7 @@ ] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-token-sdk/test_snapshots/tests/events/test_burn.1.json b/soroban-token-sdk/test_snapshots/tests/events/test_burn.1.json index 59ab152d5..362e72dc2 100644 --- a/soroban-token-sdk/test_snapshots/tests/events/test_burn.1.json +++ b/soroban-token-sdk/test_snapshots/tests/events/test_burn.1.json @@ -73,7 +73,7 @@ ] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-token-sdk/test_snapshots/tests/events/test_clawback.1.json b/soroban-token-sdk/test_snapshots/tests/events/test_clawback.1.json index b65c19e2e..8898e4670 100644 --- a/soroban-token-sdk/test_snapshots/tests/events/test_clawback.1.json +++ b/soroban-token-sdk/test_snapshots/tests/events/test_clawback.1.json @@ -73,7 +73,7 @@ ] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-token-sdk/test_snapshots/tests/events/test_mint_with_amount_only.1.json b/soroban-token-sdk/test_snapshots/tests/events/test_mint_with_amount_only.1.json index fe76b6a80..45711687d 100644 --- a/soroban-token-sdk/test_snapshots/tests/events/test_mint_with_amount_only.1.json +++ b/soroban-token-sdk/test_snapshots/tests/events/test_mint_with_amount_only.1.json @@ -51,7 +51,7 @@ ] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-token-sdk/test_snapshots/tests/events/test_mint_with_id.1.json b/soroban-token-sdk/test_snapshots/tests/events/test_mint_with_id.1.json index 75a9d4c2b..e63beeb4d 100644 --- a/soroban-token-sdk/test_snapshots/tests/events/test_mint_with_id.1.json +++ b/soroban-token-sdk/test_snapshots/tests/events/test_mint_with_id.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-token-sdk/test_snapshots/tests/events/test_mint_without_id.1.json b/soroban-token-sdk/test_snapshots/tests/events/test_mint_without_id.1.json index f05bbebef..374a30e75 100644 --- a/soroban-token-sdk/test_snapshots/tests/events/test_mint_without_id.1.json +++ b/soroban-token-sdk/test_snapshots/tests/events/test_mint_without_id.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-token-sdk/test_snapshots/tests/events/test_transfer_with_amount_only.1.json b/soroban-token-sdk/test_snapshots/tests/events/test_transfer_with_amount_only.1.json index f2e72efde..72047c98a 100644 --- a/soroban-token-sdk/test_snapshots/tests/events/test_transfer_with_amount_only.1.json +++ b/soroban-token-sdk/test_snapshots/tests/events/test_transfer_with_amount_only.1.json @@ -76,7 +76,7 @@ ] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-token-sdk/test_snapshots/tests/events/test_transfer_with_id.1.json b/soroban-token-sdk/test_snapshots/tests/events/test_transfer_with_id.1.json index ab3875448..c85e6b5db 100644 --- a/soroban-token-sdk/test_snapshots/tests/events/test_transfer_with_id.1.json +++ b/soroban-token-sdk/test_snapshots/tests/events/test_transfer_with_id.1.json @@ -76,7 +76,7 @@ ] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/soroban-token-sdk/test_snapshots/tests/events/test_transfer_without_id.1.json b/soroban-token-sdk/test_snapshots/tests/events/test_transfer_without_id.1.json index 24a7964bd..d9e98085d 100644 --- a/soroban-token-sdk/test_snapshots/tests/events/test_transfer_without_id.1.json +++ b/soroban-token-sdk/test_snapshots/tests/events/test_transfer_without_id.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/stellar-asset-spec/test_snapshots/tests/events/test_set_admin.1.json b/stellar-asset-spec/test_snapshots/tests/events/test_set_admin.1.json index ba65543d4..2d61d8a43 100644 --- a/stellar-asset-spec/test_snapshots/tests/events/test_set_admin.1.json +++ b/stellar-asset-spec/test_snapshots/tests/events/test_set_admin.1.json @@ -48,7 +48,7 @@ ] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/stellar-asset-spec/test_snapshots/tests/events/test_set_authorized.1.json b/stellar-asset-spec/test_snapshots/tests/events/test_set_authorized.1.json index 551fbfb7b..2cbcc7728 100644 --- a/stellar-asset-spec/test_snapshots/tests/events/test_set_authorized.1.json +++ b/stellar-asset-spec/test_snapshots/tests/events/test_set_authorized.1.json @@ -51,7 +51,7 @@ ] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests-expanded/test_alloc_tests.rs b/tests-expanded/test_alloc_tests.rs index 685c0b23d..b20a71412 100644 --- a/tests-expanded/test_alloc_tests.rs +++ b/tests-expanded/test_alloc_tests.rs @@ -328,7 +328,7 @@ mod test { use crate::{Contract, ContractClient}; use soroban_sdk::{vec, Env}; mod imported { - pub const WASM: &[u8] = b"\0asm\x01\0\0\0\x01.\t`\0\x01~`\x02~~\x01~`\x02\x7f\x7f\0`\0\0`\x01\x7f\x01\x7f`\x03\x7f\x7f\x7f\0`\x01\x7f\0`\x01~\x01~`\x03\x7f\x7f\x7f\x01\x7f\x02\r\x02\x01v\x01_\0\0\x01v\x016\0\x01\x03\x10\x0f\x02\x03\x04\x03\x05\x06\x02\x07\x06\x06\x03\x06\x03\x03\x08\x05\x03\x01\0\x11\x06!\x04\x7f\x01A\x80\x80\xc0\0\x0b\x7f\0A\x80\x80\xc0\0\x0b\x7f\0A\x8c\x80\xc0\0\x0b\x7f\0A\x90\x80\xc0\0\x0b\x074\x05\x06memory\x02\0\x08num_list\0\t\x01_\x03\x01\n__data_end\x03\x02\x0b__heap_base\x03\x03\n\xd8\x0e\x0f\x85\x01\x01\x02\x7f\x02@\x02@ \x01\r\0A\x04!\x02\x0c\x01\x0bA\0-\0\x80\x80\xc0\x80\0\x1a\x10\x83\x80\x80\x80\0\x02@A\0(\x02\x84\x80\xc0\x80\0\"\x02A\x03j\"\x03 \x02I\r\0\x02@ \x03A|q\"\x02 \x01j\"\x03A\0(\x02\x88\x80\xc0\x80\0M\r\0 \x01\x10\x84\x80\x80\x80\0!\x02\x0c\x02\x0bA\0 \x036\x02\x84\x80\xc0\x80\0\x0c\x01\x0b\x10\x85\x80\x80\x80\0\0\x0b \0 \x016\x02\x04 \0 \x026\x02\0\x0bC\x01\x01\x7f\x02@\x02@A\0(\x02\x88\x80\xc0\x80\0\r\0?\0\"\0A\xff\xff\x03K\r\x01A\0 \0A\x10t\"\06\x02\x88\x80\xc0\x80\0A\0 \06\x02\x84\x80\xc0\x80\0\x0b\x0f\x0b\x10\x85\x80\x80\x80\0\0\x0b\x91\x01\x01\x04\x7f \0A\xff\xff\x03j\"\x01A\x80\x80|q!\x02 \x01A\x10v!\x03\x02@\x02@\x03@ \x03@\0A\x7fF\r\x01A\0A\0(\x02\x88\x80\xc0\x80\0 \x02j6\x02\x88\x80\xc0\x80\0\x10\x83\x80\x80\x80\0A\0(\x02\x84\x80\xc0\x80\0\"\x01A\x03j\"\x04 \x01I\r\x02 \x04A|q\"\x01 \0j\"\x04A\0(\x02\x88\x80\xc0\x80\0K\r\0\x0bA\0 \x046\x02\x84\x80\xc0\x80\0 \x01\x0f\x0b\x10\x8f\x80\x80\x80\0\0\x0b\x10\x85\x80\x80\x80\0\0\x0b\t\0\x10\x8e\x80\x80\x80\0\0\x0b\x94\x02\x01\x04\x7f#\x80\x80\x80\x80\0A\x10k\"\x03$\x80\x80\x80\x80\0\x02@\x02@\x02@ \x02(\x02\x04E\r\0\x02@ \x02(\x02\x08\"\x04\r\0 \x03A\x08j \x01\x10\x82\x80\x80\x80\0 \x03(\x02\x0c!\x04 \x03(\x02\x08!\x02\x0c\x02\x0b \x02(\x02\0!\x05\x10\x83\x80\x80\x80\0A\0(\x02\x84\x80\xc0\x80\0\"\x02A\x03j\"\x06 \x02I\r\x02\x02@\x02@ \x06A|q\"\x02 \x01j\"\x06A\0(\x02\x88\x80\xc0\x80\0M\r\0 \x01\x10\x84\x80\x80\x80\0!\x02\x0c\x01\x0bA\0 \x066\x02\x84\x80\xc0\x80\0\x0b\x02@\x02@ \x02\r\0A\0!\x02\x0c\x01\x0b \x02 \x05 \x04\x10\x90\x80\x80\x80\0\x1a\x0b \x01!\x04\x0c\x01\x0b \x03 \x01\x10\x82\x80\x80\x80\0 \x03(\x02\x04!\x04 \x03(\x02\0!\x02\x0b \0 \x02A\x04 \x02\x1b6\x02\x04 \0 \x02E6\x02\0 \0 \x04 \x01 \x02\x1b6\x02\x08 \x03A\x10j$\x80\x80\x80\x80\0\x0f\x0b\x10\x85\x80\x80\x80\0\0\x0b\xec\x01\x01\x06\x7f#\x80\x80\x80\x80\0A k\"\x01$\x80\x80\x80\x80\0A\0!\x02\x02@\x02@\x02@\x02@ \0(\x02\0\"\x03A\x7fF\r\0 \x03A\x01t \x03A\x01j \x03A\0J\x1b\"\x04A\xff\xff\xff\xff\x03M\r\x01\x0b\x0c\x01\x0b \x04A\x04 \x04A\x04K\x1b\"\x05A\x02t\"\x04A\xfc\xff\xff\xff\x07K\r\0\x02@\x02@ \x03\r\0A\0!\x03\x0c\x01\x0b \x01 \x03A\x02t6\x02\x1c \x01 \0(\x02\x046\x02\x14A\x04!\x03\x0b \x01 \x036\x02\x18 \x01A\x08j \x04 \x01A\x14j\x10\x86\x80\x80\x80\0 \x01(\x02\x08A\x01G\r\x01 \x01(\x02\x10!\x06 \x01(\x02\x0c!\x02\x0b \x02 \x06\x10\x88\x80\x80\x80\0\0\x0b \x01(\x02\x0c!\x03 \0 \x056\x02\0 \0 \x036\x02\x04 \x01A j$\x80\x80\x80\x80\0\x0b\x19\0\x02@ \0\r\0\x10\x8c\x80\x80\x80\0\0\x0b \x01\x10\x8d\x80\x80\x80\0\0\x0b\xee\x01\x01\x06\x7f#\x80\x80\x80\x80\0A\x10k\"\x01$\x80\x80\x80\x80\0\x02@\x02@ \0B\xff\x01\x83B\x04R\r\0 \0B \x88\xa7!\x02A\0!\x03 \x01A\06\x02\x0c \x01B\x80\x80\x80\x80\xc0\07\x02\x04A\x01!\x04A\x04!\x05A\0!\x06\x02@\x03@ \x06 \x02O\r\x01\x02@ \x04A\x7fj \x01(\x02\x04G\r\0 \x01A\x04j\x10\x87\x80\x80\x80\0 \x01(\x02\x08!\x05\x0b \x05 \x03j \x066\x02\0 \x03A\x04j!\x03 \x01 \x046\x02\x0c \x04A\x01j!\x04 \x06 \x06 \x02Ij!\x06\x0c\0\x0b\x0b\x10\x80\x80\x80\x80\0!\0\x03@ \x03E\r\x02 \x03A|j!\x03 \0 \x055\x02\0B \x86B\x04\x84\x10\x81\x80\x80\x80\0!\0 \x05A\x04j!\x05\x0c\0\x0b\x0b\0\x0b \x01A\x10j$\x80\x80\x80\x80\0 \0\x0b\x0b\0 \0\x10\x8b\x80\x80\x80\0\0\x0b\t\0\x10\x8e\x80\x80\x80\0\0\x0b\t\0\x10\x8e\x80\x80\x80\0\0\x0b\x0b\0 \0\x10\x8a\x80\x80\x80\0\0\x0b\x03\0\0\x0b\t\0\x10\x85\x80\x80\x80\0\0\x0b\xa5\x05\x01\x08\x7f\x02@\x02@ \x02A\x10O\r\0 \0!\x03\x0c\x01\x0b\x02@ \0A\0 \0kA\x03q\"\x04j\"\x05 \0M\r\0 \x04A\x7fj!\x06 \0!\x03 \x01!\x07\x02@ \x04E\r\0 \x04!\x08 \0!\x03 \x01!\x07\x03@ \x03 \x07-\0\0:\0\0 \x07A\x01j!\x07 \x03A\x01j!\x03 \x08A\x7fj\"\x08\r\0\x0b\x0b \x06A\x07I\r\0\x03@ \x03 \x07-\0\0:\0\0 \x03A\x01j \x07A\x01j-\0\0:\0\0 \x03A\x02j \x07A\x02j-\0\0:\0\0 \x03A\x03j \x07A\x03j-\0\0:\0\0 \x03A\x04j \x07A\x04j-\0\0:\0\0 \x03A\x05j \x07A\x05j-\0\0:\0\0 \x03A\x06j \x07A\x06j-\0\0:\0\0 \x03A\x07j \x07A\x07j-\0\0:\0\0 \x07A\x08j!\x07 \x03A\x08j\"\x03 \x05G\r\0\x0b\x0b \x05 \x02 \x04k\"\x08A|q\"\x06j!\x03\x02@\x02@ \x01 \x04j\"\x07A\x03q\r\0 \x05 \x03O\r\x01 \x07!\x01\x03@ \x05 \x01(\x02\06\x02\0 \x01A\x04j!\x01 \x05A\x04j\"\x05 \x03I\r\0\x0c\x02\x0b\x0b \x05 \x03O\r\0 \x07A\x03t\"\x02A\x18q!\x04 \x07A|q\"\tA\x04j!\x01A\0 \x02kA\x18q!\n \t(\x02\0!\x02\x03@ \x05 \x02 \x04v \x01(\x02\0\"\x02 \ntr6\x02\0 \x01A\x04j!\x01 \x05A\x04j\"\x05 \x03I\r\0\x0b\x0b \x08A\x03q!\x02 \x07 \x06j!\x01\x0b\x02@ \x03 \x03 \x02j\"\x05O\r\0 \x02A\x7fj!\x08\x02@ \x02A\x07q\"\x07E\r\0\x03@ \x03 \x01-\0\0:\0\0 \x01A\x01j!\x01 \x03A\x01j!\x03 \x07A\x7fj\"\x07\r\0\x0b\x0b \x08A\x07I\r\0\x03@ \x03 \x01-\0\0:\0\0 \x03A\x01j \x01A\x01j-\0\0:\0\0 \x03A\x02j \x01A\x02j-\0\0:\0\0 \x03A\x03j \x01A\x03j-\0\0:\0\0 \x03A\x04j \x01A\x04j-\0\0:\0\0 \x03A\x05j \x01A\x05j-\0\0:\0\0 \x03A\x06j \x01A\x06j-\0\0:\0\0 \x03A\x07j \x01A\x07j-\0\0:\0\0 \x01A\x08j!\x01 \x03A\x08j\"\x03 \x05G\r\0\x0b\x0b \0\x0b\x0b\t\x01\0A\x80\x80\xc0\0\x0b\0\0G\x0econtractspecv0\0\0\0\0\0\0\0\0\0\0\0\x08num_list\0\0\0\x01\0\0\0\0\0\0\0\x05count\0\0\0\0\0\0\x04\0\0\0\x01\0\0\x03\xea\0\0\0\x04\0\x1e\x11contractenvmetav0\0\0\0\0\0\0\0\x17\0\0\0\0\0+\x0econtractmetav0\0\0\0\0\0\0\0\x05rsver\0\0\0\0\0\0\x061.84.0\0\0"; + pub const WASM: &[u8] = b"\0asm\x01\0\0\0\x01.\t`\0\x01~`\x02~~\x01~`\x02\x7f\x7f\0`\0\0`\x01\x7f\x01\x7f`\x03\x7f\x7f\x7f\0`\x01\x7f\0`\x01~\x01~`\x03\x7f\x7f\x7f\x01\x7f\x02\r\x02\x01v\x01_\0\0\x01v\x016\0\x01\x03\x10\x0f\x02\x03\x04\x03\x05\x06\x02\x07\x06\x06\x03\x06\x03\x03\x08\x05\x03\x01\0\x11\x06!\x04\x7f\x01A\x80\x80\xc0\0\x0b\x7f\0A\x80\x80\xc0\0\x0b\x7f\0A\x8c\x80\xc0\0\x0b\x7f\0A\x90\x80\xc0\0\x0b\x074\x05\x06memory\x02\0\x08num_list\0\t\x01_\x03\x01\n__data_end\x03\x02\x0b__heap_base\x03\x03\n\xd8\x0e\x0f\x85\x01\x01\x02\x7f\x02@\x02@ \x01\r\0A\x04!\x02\x0c\x01\x0bA\0-\0\x80\x80\xc0\x80\0\x1a\x10\x83\x80\x80\x80\0\x02@A\0(\x02\x84\x80\xc0\x80\0\"\x02A\x03j\"\x03 \x02I\r\0\x02@ \x03A|q\"\x02 \x01j\"\x03A\0(\x02\x88\x80\xc0\x80\0M\r\0 \x01\x10\x84\x80\x80\x80\0!\x02\x0c\x02\x0bA\0 \x036\x02\x84\x80\xc0\x80\0\x0c\x01\x0b\x10\x85\x80\x80\x80\0\0\x0b \0 \x016\x02\x04 \0 \x026\x02\0\x0bC\x01\x01\x7f\x02@\x02@A\0(\x02\x88\x80\xc0\x80\0\r\0?\0\"\0A\xff\xff\x03K\r\x01A\0 \0A\x10t\"\06\x02\x88\x80\xc0\x80\0A\0 \06\x02\x84\x80\xc0\x80\0\x0b\x0f\x0b\x10\x85\x80\x80\x80\0\0\x0b\x91\x01\x01\x04\x7f \0A\xff\xff\x03j\"\x01A\x80\x80|q!\x02 \x01A\x10v!\x03\x02@\x02@\x03@ \x03@\0A\x7fF\r\x01A\0A\0(\x02\x88\x80\xc0\x80\0 \x02j6\x02\x88\x80\xc0\x80\0\x10\x83\x80\x80\x80\0A\0(\x02\x84\x80\xc0\x80\0\"\x01A\x03j\"\x04 \x01I\r\x02 \x04A|q\"\x01 \0j\"\x04A\0(\x02\x88\x80\xc0\x80\0K\r\0\x0bA\0 \x046\x02\x84\x80\xc0\x80\0 \x01\x0f\x0b\x10\x8f\x80\x80\x80\0\0\x0b\x10\x85\x80\x80\x80\0\0\x0b\t\0\x10\x8e\x80\x80\x80\0\0\x0b\x94\x02\x01\x04\x7f#\x80\x80\x80\x80\0A\x10k\"\x03$\x80\x80\x80\x80\0\x02@\x02@\x02@ \x02(\x02\x04E\r\0\x02@ \x02(\x02\x08\"\x04\r\0 \x03A\x08j \x01\x10\x82\x80\x80\x80\0 \x03(\x02\x0c!\x04 \x03(\x02\x08!\x02\x0c\x02\x0b \x02(\x02\0!\x05\x10\x83\x80\x80\x80\0A\0(\x02\x84\x80\xc0\x80\0\"\x02A\x03j\"\x06 \x02I\r\x02\x02@\x02@ \x06A|q\"\x02 \x01j\"\x06A\0(\x02\x88\x80\xc0\x80\0M\r\0 \x01\x10\x84\x80\x80\x80\0!\x02\x0c\x01\x0bA\0 \x066\x02\x84\x80\xc0\x80\0\x0b\x02@\x02@ \x02\r\0A\0!\x02\x0c\x01\x0b \x02 \x05 \x04\x10\x90\x80\x80\x80\0\x1a\x0b \x01!\x04\x0c\x01\x0b \x03 \x01\x10\x82\x80\x80\x80\0 \x03(\x02\x04!\x04 \x03(\x02\0!\x02\x0b \0 \x02A\x04 \x02\x1b6\x02\x04 \0 \x02E6\x02\0 \0 \x04 \x01 \x02\x1b6\x02\x08 \x03A\x10j$\x80\x80\x80\x80\0\x0f\x0b\x10\x85\x80\x80\x80\0\0\x0b\xec\x01\x01\x06\x7f#\x80\x80\x80\x80\0A k\"\x01$\x80\x80\x80\x80\0A\0!\x02\x02@\x02@\x02@\x02@ \0(\x02\0\"\x03A\x7fF\r\0 \x03A\x01t \x03A\x01j \x03A\0J\x1b\"\x04A\xff\xff\xff\xff\x03M\r\x01\x0b\x0c\x01\x0b \x04A\x04 \x04A\x04K\x1b\"\x05A\x02t\"\x04A\xfc\xff\xff\xff\x07K\r\0\x02@\x02@ \x03\r\0A\0!\x03\x0c\x01\x0b \x01 \x03A\x02t6\x02\x1c \x01 \0(\x02\x046\x02\x14A\x04!\x03\x0b \x01 \x036\x02\x18 \x01A\x08j \x04 \x01A\x14j\x10\x86\x80\x80\x80\0 \x01(\x02\x08A\x01G\r\x01 \x01(\x02\x10!\x06 \x01(\x02\x0c!\x02\x0b \x02 \x06\x10\x88\x80\x80\x80\0\0\x0b \x01(\x02\x0c!\x03 \0 \x056\x02\0 \0 \x036\x02\x04 \x01A j$\x80\x80\x80\x80\0\x0b\x19\0\x02@ \0\r\0\x10\x8c\x80\x80\x80\0\0\x0b \x01\x10\x8d\x80\x80\x80\0\0\x0b\xee\x01\x01\x06\x7f#\x80\x80\x80\x80\0A\x10k\"\x01$\x80\x80\x80\x80\0\x02@\x02@ \0B\xff\x01\x83B\x04R\r\0 \0B \x88\xa7!\x02A\0!\x03 \x01A\06\x02\x0c \x01B\x80\x80\x80\x80\xc0\07\x02\x04A\x01!\x04A\x04!\x05A\0!\x06\x02@\x03@ \x06 \x02O\r\x01\x02@ \x04A\x7fj \x01(\x02\x04G\r\0 \x01A\x04j\x10\x87\x80\x80\x80\0 \x01(\x02\x08!\x05\x0b \x05 \x03j \x066\x02\0 \x03A\x04j!\x03 \x01 \x046\x02\x0c \x04A\x01j!\x04 \x06 \x06 \x02Ij!\x06\x0c\0\x0b\x0b\x10\x80\x80\x80\x80\0!\0\x03@ \x03E\r\x02 \x03A|j!\x03 \0 \x055\x02\0B \x86B\x04\x84\x10\x81\x80\x80\x80\0!\0 \x05A\x04j!\x05\x0c\0\x0b\x0b\0\x0b \x01A\x10j$\x80\x80\x80\x80\0 \0\x0b\x0b\0 \0\x10\x8b\x80\x80\x80\0\0\x0b\t\0\x10\x8e\x80\x80\x80\0\0\x0b\t\0\x10\x8e\x80\x80\x80\0\0\x0b\x0b\0 \0\x10\x8a\x80\x80\x80\0\0\x0b\x03\0\0\x0b\t\0\x10\x85\x80\x80\x80\0\0\x0b\xa5\x05\x01\x08\x7f\x02@\x02@ \x02A\x10O\r\0 \0!\x03\x0c\x01\x0b\x02@ \0A\0 \0kA\x03q\"\x04j\"\x05 \0M\r\0 \x04A\x7fj!\x06 \0!\x03 \x01!\x07\x02@ \x04E\r\0 \x04!\x08 \0!\x03 \x01!\x07\x03@ \x03 \x07-\0\0:\0\0 \x07A\x01j!\x07 \x03A\x01j!\x03 \x08A\x7fj\"\x08\r\0\x0b\x0b \x06A\x07I\r\0\x03@ \x03 \x07-\0\0:\0\0 \x03A\x01j \x07A\x01j-\0\0:\0\0 \x03A\x02j \x07A\x02j-\0\0:\0\0 \x03A\x03j \x07A\x03j-\0\0:\0\0 \x03A\x04j \x07A\x04j-\0\0:\0\0 \x03A\x05j \x07A\x05j-\0\0:\0\0 \x03A\x06j \x07A\x06j-\0\0:\0\0 \x03A\x07j \x07A\x07j-\0\0:\0\0 \x07A\x08j!\x07 \x03A\x08j\"\x03 \x05G\r\0\x0b\x0b \x05 \x02 \x04k\"\x08A|q\"\x06j!\x03\x02@\x02@ \x01 \x04j\"\x07A\x03q\r\0 \x05 \x03O\r\x01 \x07!\x01\x03@ \x05 \x01(\x02\06\x02\0 \x01A\x04j!\x01 \x05A\x04j\"\x05 \x03I\r\0\x0c\x02\x0b\x0b \x05 \x03O\r\0 \x07A\x03t\"\x02A\x18q!\x04 \x07A|q\"\tA\x04j!\x01A\0 \x02kA\x18q!\n \t(\x02\0!\x02\x03@ \x05 \x02 \x04v \x01(\x02\0\"\x02 \ntr6\x02\0 \x01A\x04j!\x01 \x05A\x04j\"\x05 \x03I\r\0\x0b\x0b \x08A\x03q!\x02 \x07 \x06j!\x01\x0b\x02@ \x03 \x03 \x02j\"\x05O\r\0 \x02A\x7fj!\x08\x02@ \x02A\x07q\"\x07E\r\0\x03@ \x03 \x01-\0\0:\0\0 \x01A\x01j!\x01 \x03A\x01j!\x03 \x07A\x7fj\"\x07\r\0\x0b\x0b \x08A\x07I\r\0\x03@ \x03 \x01-\0\0:\0\0 \x03A\x01j \x01A\x01j-\0\0:\0\0 \x03A\x02j \x01A\x02j-\0\0:\0\0 \x03A\x03j \x01A\x03j-\0\0:\0\0 \x03A\x04j \x01A\x04j-\0\0:\0\0 \x03A\x05j \x01A\x05j-\0\0:\0\0 \x03A\x06j \x01A\x06j-\0\0:\0\0 \x03A\x07j \x01A\x07j-\0\0:\0\0 \x01A\x08j!\x01 \x03A\x08j\"\x03 \x05G\r\0\x0b\x0b \0\x0b\x0b\t\x01\0A\x80\x80\xc0\0\x0b\0\0G\x0econtractspecv0\0\0\0\0\0\0\0\0\0\0\0\x08num_list\0\0\0\x01\0\0\0\0\0\0\0\x05count\0\0\0\0\0\0\x04\0\0\0\x01\0\0\x03\xea\0\0\0\x04\0\x1e\x11contractenvmetav0\0\0\0\0\0\0\0\x19\0\0\0\0\0+\x0econtractmetav0\0\0\0\0\0\0\0\x05rsver\0\0\0\0\0\0\x061.84.0\0\0"; pub trait Contract { fn num_list(env: soroban_sdk::Env, count: u32) -> soroban_sdk::Vec; } diff --git a/tests-expanded/test_bn254_tests.rs b/tests-expanded/test_bn254_tests.rs new file mode 100644 index 000000000..58fd09d52 --- /dev/null +++ b/tests-expanded/test_bn254_tests.rs @@ -0,0 +1,1162 @@ +#![feature(prelude_import)] +#![no_std] +#[macro_use] +extern crate core; +#[prelude_import] +use core::prelude::rust_2021::*; +use soroban_sdk::{ + contract, contractimpl, contracttype, + crypto::bn254::{Fr, G1Affine, G2Affine}, + Env, Vec, +}; +pub struct MockProof { + pub g1: Vec, + pub g2: Vec, +} +pub static __SPEC_XDR_TYPE_MOCKPROOF: [u8; 80usize] = MockProof::spec_xdr(); +impl MockProof { + pub const fn spec_xdr() -> [u8; 80usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\tMockProof\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x02g1\0\0\0\0\x03\xea\0\0\x03\xee\0\0\0`\0\0\0\0\0\0\0\x02g2\0\0\0\0\x03\xea\0\0\x03\xee\0\0\0\xc0" + } +} +impl soroban_sdk::TryFromVal for MockProof { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["g1", "g2"]; + let mut vals: [Val; 2usize] = [Val::VOID.to_val(); 2usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + g1: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + g2: vals[1] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &MockProof, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["g1", "g2"]; + let vals: [Val; 2usize] = [ + (&val.g1).try_into_val(env).map_err(|_| ConversionError)?, + (&val.g2).try_into_val(env).map_err(|_| ConversionError)?, + ]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&MockProof, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} +impl soroban_sdk::TryFromVal for MockProof { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScMap, + ) -> Result { + use soroban_sdk::xdr::Validate; + use soroban_sdk::TryIntoVal; + let map = val; + if map.len() != 2usize { + return Err(soroban_sdk::xdr::Error::Invalid); + } + map.validate()?; + Ok(Self { + g1: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "g1".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + g2: { + let key: soroban_sdk::xdr::ScVal = soroban_sdk::xdr::ScSymbol( + "g2".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(); + let idx = map + .binary_search_by_key(&key, |entry| entry.key.clone()) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + let rv: soroban_sdk::Val = (&map[idx].val.clone()) + .try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?; + rv.try_into_val(env) + .map_err(|_| soroban_sdk::xdr::Error::Invalid)? + }, + }) + } +} +impl soroban_sdk::TryFromVal for MockProof { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::xdr::ScVal, + ) -> Result { + if let soroban_sdk::xdr::ScVal::Map(Some(map)) = val { + <_ as soroban_sdk::TryFromVal<_, _>>::try_from_val(env, map) + } else { + Err(soroban_sdk::xdr::Error::Invalid) + } + } +} +impl TryFrom<&MockProof> for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &MockProof) -> Result { + extern crate alloc; + use soroban_sdk::TryFromVal; + soroban_sdk::xdr::ScMap::sorted_from(<[_]>::into_vec(::alloc::boxed::box_new([ + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "g1".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.g1) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + soroban_sdk::xdr::ScMapEntry { + key: soroban_sdk::xdr::ScSymbol( + "g2".try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + ) + .into(), + val: (&val.g2) + .try_into() + .map_err(|_| soroban_sdk::xdr::Error::Invalid)?, + }, + ]))) + } +} +impl TryFrom for soroban_sdk::xdr::ScMap { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: MockProof) -> Result { + (&val).try_into() + } +} +impl TryFrom<&MockProof> for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: &MockProof) -> Result { + Ok(soroban_sdk::xdr::ScVal::Map(Some(val.try_into()?))) + } +} +impl TryFrom for soroban_sdk::xdr::ScVal { + type Error = soroban_sdk::xdr::Error; + #[inline(always)] + fn try_from(val: MockProof) -> Result { + (&val).try_into() + } +} +const _: () = { + use soroban_sdk::testutils::arbitrary::arbitrary; + use soroban_sdk::testutils::arbitrary::std; + pub struct ArbitraryMockProof { + g1: as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + g2: as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + } + #[automatically_derived] + impl ::core::fmt::Debug for ArbitraryMockProof { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { + ::core::fmt::Formatter::debug_struct_field2_finish( + f, + "ArbitraryMockProof", + "g1", + &self.g1, + "g2", + &&self.g2, + ) + } + } + #[automatically_derived] + impl ::core::clone::Clone for ArbitraryMockProof { + #[inline] + fn clone(&self) -> ArbitraryMockProof { + ArbitraryMockProof { + g1: ::core::clone::Clone::clone(&self.g1), + g2: ::core::clone::Clone::clone(&self.g2), + } + } + } + #[automatically_derived] + impl ::core::cmp::Eq for ArbitraryMockProof { + #[inline] + #[doc(hidden)] + #[coverage(off)] + fn assert_receiver_is_total_eq(&self) -> () { + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + let _: ::core::cmp::AssertParamIsEq< + as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype, + >; + } + } + #[automatically_derived] + impl ::core::marker::StructuralPartialEq for ArbitraryMockProof {} + #[automatically_derived] + impl ::core::cmp::PartialEq for ArbitraryMockProof { + #[inline] + fn eq(&self, other: &ArbitraryMockProof) -> bool { + self.g1 == other.g1 && self.g2 == other.g2 + } + } + #[automatically_derived] + impl ::core::cmp::Ord for ArbitraryMockProof { + #[inline] + fn cmp(&self, other: &ArbitraryMockProof) -> ::core::cmp::Ordering { + match ::core::cmp::Ord::cmp(&self.g1, &other.g1) { + ::core::cmp::Ordering::Equal => ::core::cmp::Ord::cmp(&self.g2, &other.g2), + cmp => cmp, + } + } + } + #[automatically_derived] + impl ::core::cmp::PartialOrd for ArbitraryMockProof { + #[inline] + fn partial_cmp( + &self, + other: &ArbitraryMockProof, + ) -> ::core::option::Option<::core::cmp::Ordering> { + match ::core::cmp::PartialOrd::partial_cmp(&self.g1, &other.g1) { + ::core::option::Option::Some(::core::cmp::Ordering::Equal) => { + ::core::cmp::PartialOrd::partial_cmp(&self.g2, &other.g2) + } + cmp => cmp, + } + } + } + const _: () = { + #[allow(non_upper_case_globals)] + const RECURSIVE_COUNT_ArbitraryMockProof: ::std::thread::LocalKey> = { + #[inline] + fn __init() -> std::cell::Cell { + std::cell::Cell::new(0) + } + unsafe { + ::std::thread::LocalKey::new( + const { + if ::std::mem::needs_drop::>() { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + (), + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } else { + |init| { + #[thread_local] + static VAL: ::std::thread::local_impl::LazyStorage< + std::cell::Cell, + !, + > = ::std::thread::local_impl::LazyStorage::new(); + VAL.get_or_init(init, __init) + } + } + }, + ) + } + }; + #[automatically_derived] + impl<'arbitrary> arbitrary::Arbitrary<'arbitrary> for ArbitraryMockProof { + fn arbitrary(u: &mut arbitrary::Unstructured<'arbitrary>) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryMockProof.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryMockProof { + g1: arbitrary::Arbitrary::arbitrary(u)?, + g2: arbitrary::Arbitrary::arbitrary(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryMockProof.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + fn arbitrary_take_rest( + mut u: arbitrary::Unstructured<'arbitrary>, + ) -> arbitrary::Result { + let guard_against_recursion = u.is_empty(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryMockProof.with(|count| { + if count.get() > 0 { + return Err(arbitrary::Error::NotEnoughData); + } + count.set(count.get() + 1); + Ok(()) + })?; + } + let result = (|| { + Ok(ArbitraryMockProof { + g1: arbitrary::Arbitrary::arbitrary(&mut u)?, + g2: arbitrary::Arbitrary::arbitrary_take_rest(u)?, + }) + })(); + if guard_against_recursion { + RECURSIVE_COUNT_ArbitraryMockProof.with(|count| { + count.set(count.get() - 1); + }); + } + result + } + #[inline] + fn size_hint(depth: usize) -> (usize, Option) { + arbitrary::size_hint::recursion_guard(depth, |depth| { + arbitrary::size_hint::and_all( + &[ + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + < as soroban_sdk::testutils::arbitrary::SorobanArbitrary>::Prototype as arbitrary::Arbitrary>::size_hint( + depth, + ), + ], + ) + }) + } + } + }; + impl soroban_sdk::testutils::arbitrary::SorobanArbitrary for MockProof { + type Prototype = ArbitraryMockProof; + } + impl soroban_sdk::TryFromVal for MockProof { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + v: &ArbitraryMockProof, + ) -> std::result::Result { + Ok(MockProof { + g1: soroban_sdk::IntoVal::into_val(&v.g1, env), + g2: soroban_sdk::IntoVal::into_val(&v.g2, env), + }) + } + } +}; +#[automatically_derived] +impl ::core::clone::Clone for MockProof { + #[inline] + fn clone(&self) -> MockProof { + MockProof { + g1: ::core::clone::Clone::clone(&self.g1), + g2: ::core::clone::Clone::clone(&self.g2), + } + } +} +pub struct Contract; +///ContractArgs is a type for building arg lists for functions defined in "Contract". +pub struct ContractArgs; +///ContractClient is a client for calling the contract defined in "Contract". +pub struct ContractClient<'a> { + pub env: soroban_sdk::Env, + pub address: soroban_sdk::Address, + #[doc(hidden)] + set_auths: Option<&'a [soroban_sdk::xdr::SorobanAuthorizationEntry]>, + #[doc(hidden)] + mock_auths: Option<&'a [soroban_sdk::testutils::MockAuth<'a>]>, + #[doc(hidden)] + mock_all_auths: bool, + #[doc(hidden)] + allow_non_root_auth: bool, +} +impl<'a> ContractClient<'a> { + pub fn new(env: &soroban_sdk::Env, address: &soroban_sdk::Address) -> Self { + Self { + env: env.clone(), + address: address.clone(), + set_auths: None, + mock_auths: None, + mock_all_auths: false, + allow_non_root_auth: false, + } + } + /// Set authorizations in the environment which will be consumed by + /// contracts when they invoke `Address::require_auth` or + /// `Address::require_auth_for_args` functions. + /// + /// Requires valid signatures for the authorization to be successful. + /// To mock auth without requiring valid signatures, use `mock_auths`. + /// + /// See `soroban_sdk::Env::set_auths` for more details and examples. + pub fn set_auths(&self, auths: &'a [soroban_sdk::xdr::SorobanAuthorizationEntry]) -> Self { + Self { + env: self.env.clone(), + address: self.address.clone(), + set_auths: Some(auths), + mock_auths: self.mock_auths.clone(), + mock_all_auths: false, + allow_non_root_auth: false, + } + } + /// Mock authorizations in the environment which will cause matching invokes + /// of `Address::require_auth` and `Address::require_auth_for_args` to + /// pass. + /// + /// See `soroban_sdk::Env::set_auths` for more details and examples. + pub fn mock_auths(&self, mock_auths: &'a [soroban_sdk::testutils::MockAuth<'a>]) -> Self { + Self { + env: self.env.clone(), + address: self.address.clone(), + set_auths: self.set_auths.clone(), + mock_auths: Some(mock_auths), + mock_all_auths: false, + allow_non_root_auth: false, + } + } + /// Mock all calls to the `Address::require_auth` and + /// `Address::require_auth_for_args` functions in invoked contracts, + /// having them succeed as if authorization was provided. + /// + /// See `soroban_sdk::Env::mock_all_auths` for more details and + /// examples. + pub fn mock_all_auths(&self) -> Self { + Self { + env: self.env.clone(), + address: self.address.clone(), + set_auths: None, + mock_auths: None, + mock_all_auths: true, + allow_non_root_auth: false, + } + } + /// A version of `mock_all_auths` that allows authorizations that + /// are not present in the root invocation. + /// + /// Refer to `mock_all_auths` documentation for details and + /// prefer using `mock_all_auths` unless non-root authorization is + /// required. + /// + /// See `soroban_sdk::Env::mock_all_auths_allowing_non_root_auth` + /// for more details and examples. + pub fn mock_all_auths_allowing_non_root_auth(&self) -> Self { + Self { + env: self.env.clone(), + address: self.address.clone(), + set_auths: None, + mock_auths: None, + mock_all_auths: true, + allow_non_root_auth: true, + } + } +} +mod __contract_fn_set_registry { + use super::*; + extern crate std; + use std::collections::BTreeMap; + use std::sync::Mutex; + pub type F = soroban_sdk::testutils::ContractFunctionF; + static FUNCS: Mutex> = Mutex::new(BTreeMap::new()); + pub fn register(name: &'static str, func: &'static F) { + FUNCS.lock().unwrap().insert(name, func); + } + pub fn call( + name: &str, + env: soroban_sdk::Env, + args: &[soroban_sdk::Val], + ) -> Option { + let fopt: Option<&'static F> = FUNCS.lock().unwrap().get(name).map(|f| f.clone()); + fopt.map(|f| f(env, args)) + } +} +impl soroban_sdk::testutils::ContractFunctionRegister for Contract { + fn register(name: &'static str, func: &'static __contract_fn_set_registry::F) { + __contract_fn_set_registry::register(name, func); + } +} +#[doc(hidden)] +impl soroban_sdk::testutils::ContractFunctionSet for Contract { + fn call( + &self, + func: &str, + env: soroban_sdk::Env, + args: &[soroban_sdk::Val], + ) -> Option { + __contract_fn_set_registry::call(func, env, args) + } +} +impl Contract { + pub fn verify_pairing(env: Env, proof: MockProof) -> bool { + env.crypto().bn254().pairing_check(proof.g1, proof.g2) + } + pub fn g1_add(a: G1Affine, b: G1Affine) -> G1Affine { + a + b + } + pub fn g1_mul(p: G1Affine, s: Fr) -> G1Affine { + p * s + } +} +#[doc(hidden)] +#[allow(non_snake_case)] +pub mod __Contract__verify_pairing__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + pub static __SPEC_XDR_FN_VERIFY_PAIRING: [u8; 76usize] = + super::Contract::spec_xdr_verify_pairing(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr_verify_pairing() -> [u8; 76usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\x0everify_pairing\0\0\0\0\0\x01\0\0\0\0\0\0\0\x05proof\0\0\0\0\0\x07\xd0\0\0\0\tMockProof\0\0\0\0\0\0\x01\0\0\0\x01" + } +} +#[doc(hidden)] +#[allow(non_snake_case)] +pub mod __Contract__g1_add__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + pub static __SPEC_XDR_FN_G1_ADD: [u8; 76usize] = super::Contract::spec_xdr_g1_add(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr_g1_add() -> [u8; 76usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\x06g1_add\0\0\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\x03\xee\0\0\0`\0\0\0\0\0\0\0\x01b\0\0\0\0\0\x03\xee\0\0\0`\0\0\0\x01\0\0\x03\xee\0\0\0`" + } +} +#[doc(hidden)] +#[allow(non_snake_case)] +pub mod __Contract__g1_mul__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + pub static __SPEC_XDR_FN_G1_MUL: [u8; 72usize] = super::Contract::spec_xdr_g1_mul(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr_g1_mul() -> [u8; 72usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\x06g1_mul\0\0\0\0\0\x02\0\0\0\0\0\0\0\x01p\0\0\0\0\0\x03\xee\0\0\0`\0\0\0\0\0\0\0\x01s\0\0\0\0\0\0\x0c\0\0\0\x01\0\0\x03\xee\0\0\0`" + } +} +impl<'a> ContractClient<'a> { + pub fn verify_pairing(&self, proof: &MockProof) -> bool { + use core::ops::Not; + let old_auth_manager = self + .env + .in_contract() + .not() + .then(|| self.env.host().snapshot_auth_manager().unwrap()); + { + if let Some(set_auths) = self.set_auths { + self.env.set_auths(set_auths); + } + if let Some(mock_auths) = self.mock_auths { + self.env.mock_auths(mock_auths); + } + if self.mock_all_auths { + if self.allow_non_root_auth { + self.env.mock_all_auths_allowing_non_root_auth(); + } else { + self.env.mock_all_auths(); + } + } + } + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "verify_pairing") }, + ::soroban_sdk::Vec::from_array(&self.env, [proof.into_val(&self.env)]), + ); + if let Some(old_auth_manager) = old_auth_manager { + self.env.host().set_auth_manager(old_auth_manager).unwrap(); + } + res + } + pub fn try_verify_pairing( + &self, + proof: &MockProof, + ) -> Result< + Result>::Error>, + Result, + > { + use core::ops::Not; + let old_auth_manager = self + .env + .in_contract() + .not() + .then(|| self.env.host().snapshot_auth_manager().unwrap()); + { + if let Some(set_auths) = self.set_auths { + self.env.set_auths(set_auths); + } + if let Some(mock_auths) = self.mock_auths { + self.env.mock_auths(mock_auths); + } + if self.mock_all_auths { + self.env.mock_all_auths(); + } + } + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.try_invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "verify_pairing") }, + ::soroban_sdk::Vec::from_array(&self.env, [proof.into_val(&self.env)]), + ); + if let Some(old_auth_manager) = old_auth_manager { + self.env.host().set_auth_manager(old_auth_manager).unwrap(); + } + res + } + pub fn g1_add(&self, a: &G1Affine, b: &G1Affine) -> G1Affine { + use core::ops::Not; + let old_auth_manager = self + .env + .in_contract() + .not() + .then(|| self.env.host().snapshot_auth_manager().unwrap()); + { + if let Some(set_auths) = self.set_auths { + self.env.set_auths(set_auths); + } + if let Some(mock_auths) = self.mock_auths { + self.env.mock_auths(mock_auths); + } + if self.mock_all_auths { + if self.allow_non_root_auth { + self.env.mock_all_auths_allowing_non_root_auth(); + } else { + self.env.mock_all_auths(); + } + } + } + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.invoke_contract( + &self.address, + &{ + #[allow(deprecated)] + const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("g1_add"); + SYMBOL + }, + ::soroban_sdk::Vec::from_array( + &self.env, + [a.into_val(&self.env), b.into_val(&self.env)], + ), + ); + if let Some(old_auth_manager) = old_auth_manager { + self.env.host().set_auth_manager(old_auth_manager).unwrap(); + } + res + } + pub fn try_g1_add( + &self, + a: &G1Affine, + b: &G1Affine, + ) -> Result< + Result< + G1Affine, + >::Error, + >, + Result, + > { + use core::ops::Not; + let old_auth_manager = self + .env + .in_contract() + .not() + .then(|| self.env.host().snapshot_auth_manager().unwrap()); + { + if let Some(set_auths) = self.set_auths { + self.env.set_auths(set_auths); + } + if let Some(mock_auths) = self.mock_auths { + self.env.mock_auths(mock_auths); + } + if self.mock_all_auths { + self.env.mock_all_auths(); + } + } + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.try_invoke_contract( + &self.address, + &{ + #[allow(deprecated)] + const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("g1_add"); + SYMBOL + }, + ::soroban_sdk::Vec::from_array( + &self.env, + [a.into_val(&self.env), b.into_val(&self.env)], + ), + ); + if let Some(old_auth_manager) = old_auth_manager { + self.env.host().set_auth_manager(old_auth_manager).unwrap(); + } + res + } + pub fn g1_mul(&self, p: &G1Affine, s: &Fr) -> G1Affine { + use core::ops::Not; + let old_auth_manager = self + .env + .in_contract() + .not() + .then(|| self.env.host().snapshot_auth_manager().unwrap()); + { + if let Some(set_auths) = self.set_auths { + self.env.set_auths(set_auths); + } + if let Some(mock_auths) = self.mock_auths { + self.env.mock_auths(mock_auths); + } + if self.mock_all_auths { + if self.allow_non_root_auth { + self.env.mock_all_auths_allowing_non_root_auth(); + } else { + self.env.mock_all_auths(); + } + } + } + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.invoke_contract( + &self.address, + &{ + #[allow(deprecated)] + const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("g1_mul"); + SYMBOL + }, + ::soroban_sdk::Vec::from_array( + &self.env, + [p.into_val(&self.env), s.into_val(&self.env)], + ), + ); + if let Some(old_auth_manager) = old_auth_manager { + self.env.host().set_auth_manager(old_auth_manager).unwrap(); + } + res + } + pub fn try_g1_mul( + &self, + p: &G1Affine, + s: &Fr, + ) -> Result< + Result< + G1Affine, + >::Error, + >, + Result, + > { + use core::ops::Not; + let old_auth_manager = self + .env + .in_contract() + .not() + .then(|| self.env.host().snapshot_auth_manager().unwrap()); + { + if let Some(set_auths) = self.set_auths { + self.env.set_auths(set_auths); + } + if let Some(mock_auths) = self.mock_auths { + self.env.mock_auths(mock_auths); + } + if self.mock_all_auths { + self.env.mock_all_auths(); + } + } + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.try_invoke_contract( + &self.address, + &{ + #[allow(deprecated)] + const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("g1_mul"); + SYMBOL + }, + ::soroban_sdk::Vec::from_array( + &self.env, + [p.into_val(&self.env), s.into_val(&self.env)], + ), + ); + if let Some(old_auth_manager) = old_auth_manager { + self.env.host().set_auth_manager(old_auth_manager).unwrap(); + } + res + } +} +impl ContractArgs { + #[inline(always)] + #[allow(clippy::unused_unit)] + pub fn verify_pairing<'i>(proof: &'i MockProof) -> (&'i MockProof,) { + (proof,) + } + #[inline(always)] + #[allow(clippy::unused_unit)] + pub fn g1_add<'i>(a: &'i G1Affine, b: &'i G1Affine) -> (&'i G1Affine, &'i G1Affine) { + (a, b) + } + #[inline(always)] + #[allow(clippy::unused_unit)] + pub fn g1_mul<'i>(p: &'i G1Affine, s: &'i Fr) -> (&'i G1Affine, &'i Fr) { + (p, s) + } +} +#[doc(hidden)] +#[allow(non_snake_case)] +pub mod __Contract__verify_pairing { + use super::*; + #[deprecated(note = "use `ContractClient::new(&env, &contract_id).verify_pairing` instead")] + pub fn invoke_raw(env: soroban_sdk::Env, arg_0: soroban_sdk::Val) -> soroban_sdk::Val { + <_ as soroban_sdk::IntoVal>::into_val( + #[allow(deprecated)] + &::verify_pairing( + env.clone(), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_0), + ), + ), + &env, + ) + } + #[deprecated(note = "use `ContractClient::new(&env, &contract_id).verify_pairing` instead")] + pub fn invoke_raw_slice(env: soroban_sdk::Env, args: &[soroban_sdk::Val]) -> soroban_sdk::Val { + if args.len() != 1usize { + { + ::core::panicking::panic_fmt(format_args!( + "invalid number of input arguments: {0} expected, got {1}", + 1usize, + args.len(), + )); + }; + } + #[allow(deprecated)] + invoke_raw(env, args[0usize]) + } + #[deprecated(note = "use `ContractClient::new(&env, &contract_id).verify_pairing` instead")] + pub extern "C" fn invoke_raw_extern(arg_0: soroban_sdk::Val) -> soroban_sdk::Val { + #[allow(deprecated)] + invoke_raw(soroban_sdk::Env::default(), arg_0) + } + use super::*; +} +#[doc(hidden)] +#[allow(non_snake_case)] +pub mod __Contract__g1_add { + use super::*; + #[deprecated(note = "use `ContractClient::new(&env, &contract_id).g1_add` instead")] + pub fn invoke_raw( + env: soroban_sdk::Env, + arg_0: soroban_sdk::Val, + arg_1: soroban_sdk::Val, + ) -> soroban_sdk::Val { + <_ as soroban_sdk::IntoVal>::into_val( + #[allow(deprecated)] + &::g1_add( + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_0), + ), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_1), + ), + ), + &env, + ) + } + #[deprecated(note = "use `ContractClient::new(&env, &contract_id).g1_add` instead")] + pub fn invoke_raw_slice(env: soroban_sdk::Env, args: &[soroban_sdk::Val]) -> soroban_sdk::Val { + if args.len() != 2usize { + { + ::core::panicking::panic_fmt(format_args!( + "invalid number of input arguments: {0} expected, got {1}", + 2usize, + args.len(), + )); + }; + } + #[allow(deprecated)] + invoke_raw(env, args[0usize], args[1usize]) + } + #[deprecated(note = "use `ContractClient::new(&env, &contract_id).g1_add` instead")] + pub extern "C" fn invoke_raw_extern( + arg_0: soroban_sdk::Val, + arg_1: soroban_sdk::Val, + ) -> soroban_sdk::Val { + #[allow(deprecated)] + invoke_raw(soroban_sdk::Env::default(), arg_0, arg_1) + } + use super::*; +} +#[doc(hidden)] +#[allow(non_snake_case)] +pub mod __Contract__g1_mul { + use super::*; + #[deprecated(note = "use `ContractClient::new(&env, &contract_id).g1_mul` instead")] + pub fn invoke_raw( + env: soroban_sdk::Env, + arg_0: soroban_sdk::Val, + arg_1: soroban_sdk::Val, + ) -> soroban_sdk::Val { + <_ as soroban_sdk::IntoVal>::into_val( + #[allow(deprecated)] + &::g1_mul( + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_0), + ), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_1), + ), + ), + &env, + ) + } + #[deprecated(note = "use `ContractClient::new(&env, &contract_id).g1_mul` instead")] + pub fn invoke_raw_slice(env: soroban_sdk::Env, args: &[soroban_sdk::Val]) -> soroban_sdk::Val { + if args.len() != 2usize { + { + ::core::panicking::panic_fmt(format_args!( + "invalid number of input arguments: {0} expected, got {1}", + 2usize, + args.len(), + )); + }; + } + #[allow(deprecated)] + invoke_raw(env, args[0usize], args[1usize]) + } + #[deprecated(note = "use `ContractClient::new(&env, &contract_id).g1_mul` instead")] + pub extern "C" fn invoke_raw_extern( + arg_0: soroban_sdk::Val, + arg_1: soroban_sdk::Val, + ) -> soroban_sdk::Val { + #[allow(deprecated)] + invoke_raw(soroban_sdk::Env::default(), arg_0, arg_1) + } + use super::*; +} +#[doc(hidden)] +#[allow(non_snake_case)] +#[allow(unused)] +fn __Contract__0bbda83869b96862f040597ce6f7f1153fcf92be3a6565cd371a4485bb1a9c8d_ctor() { + #[allow(unsafe_code)] + { + #[link_section = ".init_array"] + #[used] + #[allow(non_upper_case_globals, non_snake_case)] + #[doc(hidden)] + static f: extern "C" fn() -> ::ctor::__support::CtorRetType = { + #[link_section = ".text.startup"] + #[allow(non_snake_case)] + extern "C" fn f() -> ::ctor::__support::CtorRetType { + unsafe { + __Contract__0bbda83869b96862f040597ce6f7f1153fcf92be3a6565cd371a4485bb1a9c8d_ctor(); + }; + core::default::Default::default() + } + f + }; + } + { + ::register( + "verify_pairing", + #[allow(deprecated)] + &__Contract__verify_pairing::invoke_raw_slice, + ); + ::register( + "g1_add", + #[allow(deprecated)] + &__Contract__g1_add::invoke_raw_slice, + ); + ::register( + "g1_mul", + #[allow(deprecated)] + &__Contract__g1_mul::invoke_raw_slice, + ); + } +} +mod test { + use super::*; + use soroban_sdk::{crypto::bn254, vec, Env, U256}; + extern crate std; + use crate::{Contract, ContractClient}; + use ark_bn254::{G1Affine, G2Affine}; + use ark_ec::CurveGroup; + use ark_ff::UniformRand; + use ark_serialize::CanonicalSerialize; + use std::ops::Add; + extern crate test; + #[rustc_test_marker = "test::test_add_and_mul"] + #[doc(hidden)] + pub const test_add_and_mul: test::TestDescAndFn = test::TestDescAndFn { + desc: test::TestDesc { + name: test::StaticTestName("test::test_add_and_mul"), + ignore: false, + ignore_message: ::core::option::Option::None, + source_file: "tests/bn254/src/lib.rs", + start_line: 49usize, + start_col: 8usize, + end_line: 49usize, + end_col: 24usize, + compile_fail: false, + no_run: false, + should_panic: test::ShouldPanic::No, + test_type: test::TestType::UnitTest, + }, + testfn: test::StaticTestFn( + #[coverage(off)] + || test::assert_test_result(test_add_and_mul()), + ), + }; + fn test_add_and_mul() { + let env = Env::default(); + let contract_id = env.register(Contract, ()); + let client = ContractClient::new(&env, &contract_id); + let mut rng = ark_std::test_rng(); + let mut a_bytes = [0u8; 64]; + G1Affine::rand(&mut rng) + .serialize_uncompressed(&mut a_bytes[..]) + .unwrap(); + let a_bn254 = bn254::G1Affine::from_array(&env, &a_bytes); + let scalar: bn254::Fr = U256::from_u32(&env, 2).into(); + match ( + &client.g1_add(&a_bn254, &a_bn254), + &client.g1_mul(&a_bn254, &scalar), + ) { + (left_val, right_val) => { + if !(*left_val == *right_val) { + let kind = ::core::panicking::AssertKind::Eq; + ::core::panicking::assert_failed( + kind, + &*left_val, + &*right_val, + ::core::option::Option::None, + ); + } + } + }; + } + extern crate test; + #[rustc_test_marker = "test::test_pairing"] + #[doc(hidden)] + pub const test_pairing: test::TestDescAndFn = test::TestDescAndFn { + desc: test::TestDesc { + name: test::StaticTestName("test::test_pairing"), + ignore: false, + ignore_message: ::core::option::Option::None, + source_file: "tests/bn254/src/lib.rs", + start_line: 75usize, + start_col: 8usize, + end_line: 75usize, + end_col: 20usize, + compile_fail: false, + no_run: false, + should_panic: test::ShouldPanic::No, + test_type: test::TestType::UnitTest, + }, + testfn: test::StaticTestFn( + #[coverage(off)] + || test::assert_test_result(test_pairing()), + ), + }; + fn test_pairing() { + let env = Env::default(); + let contract_id = env.register(Contract, ()); + let client = ContractClient::new(&env, &contract_id); + let mut rng = ark_std::test_rng(); + let p = G1Affine::rand(&mut rng); + let neg_p = -p; + let q = G2Affine::rand(&mut rng); + let r = G2Affine::rand(&mut rng); + let q_plus_r = &q.add(&r).into_affine(); + let mut p_bytes = [0u8; 64]; + let mut neg_p_bytes = [0u8; 64]; + let mut q_bytes = [0u8; 128]; + let mut r_bytes = [0u8; 128]; + let mut q_plus_r_bytes = [0u8; 128]; + p.serialize_uncompressed(&mut p_bytes[..]).unwrap(); + neg_p.serialize_uncompressed(&mut neg_p_bytes[..]).unwrap(); + q.serialize_uncompressed(&mut q_bytes[..]).unwrap(); + r.serialize_uncompressed(&mut r_bytes[..]).unwrap(); + q_plus_r + .serialize_uncompressed(&mut q_plus_r_bytes[..]) + .unwrap(); + let proof = MockProof { + g1: ::soroban_sdk::Vec::from_array( + &env, + [ + bn254::G1Affine::from_array(&env, &neg_p_bytes), + bn254::G1Affine::from_array(&env, &p_bytes), + bn254::G1Affine::from_array(&env, &p_bytes), + ], + ), + g2: ::soroban_sdk::Vec::from_array( + &env, + [ + bn254::G2Affine::from_array(&env, &q_plus_r_bytes), + bn254::G2Affine::from_array(&env, &q_bytes), + bn254::G2Affine::from_array(&env, &r_bytes), + ], + ), + }; + if !client.verify_pairing(&proof) { + ::core::panicking::panic("assertion failed: client.verify_pairing(&proof)") + } + } +} +#[rustc_main] +#[coverage(off)] +#[doc(hidden)] +pub fn main() -> () { + extern crate test; + test::test_main_static(&[&test_add_and_mul, &test_pairing]) +} diff --git a/tests-expanded/test_bn254_wasm32v1-none.rs b/tests-expanded/test_bn254_wasm32v1-none.rs new file mode 100644 index 000000000..69b811121 --- /dev/null +++ b/tests-expanded/test_bn254_wasm32v1-none.rs @@ -0,0 +1,396 @@ +#![feature(prelude_import)] +#![no_std] +#[macro_use] +extern crate core; +#[prelude_import] +use core::prelude::rust_2021::*; +use soroban_sdk::{ + contract, contractimpl, contracttype, + crypto::bn254::{Fr, G1Affine, G2Affine}, + Env, Vec, +}; +pub struct MockProof { + pub g1: Vec, + pub g2: Vec, +} +#[link_section = "contractspecv0"] +pub static __SPEC_XDR_TYPE_MOCKPROOF: [u8; 80usize] = MockProof::spec_xdr(); +impl MockProof { + pub const fn spec_xdr() -> [u8; 80usize] { + *b"\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\tMockProof\0\0\0\0\0\0\x02\0\0\0\0\0\0\0\x02g1\0\0\0\0\x03\xea\0\0\x03\xee\0\0\0`\0\0\0\0\0\0\0\x02g2\0\0\0\0\x03\xea\0\0\x03\xee\0\0\0\xc0" + } +} +impl soroban_sdk::TryFromVal for MockProof { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &soroban_sdk::Val, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, MapObject, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["g1", "g2"]; + let mut vals: [Val; 2usize] = [Val::VOID.to_val(); 2usize]; + let map: MapObject = val.try_into().map_err(|_| ConversionError)?; + env.map_unpack_to_slice(map, &KEYS, &mut vals) + .map_err(|_| ConversionError)?; + Ok(Self { + g1: vals[0] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + g2: vals[1] + .try_into_val(env) + .map_err(|_| soroban_sdk::ConversionError)?, + }) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + fn try_from_val( + env: &soroban_sdk::Env, + val: &MockProof, + ) -> Result { + use soroban_sdk::{ConversionError, EnvBase, TryIntoVal, Val}; + const KEYS: [&'static str; 2usize] = ["g1", "g2"]; + let vals: [Val; 2usize] = [ + (&val.g1).try_into_val(env).map_err(|_| ConversionError)?, + (&val.g2).try_into_val(env).map_err(|_| ConversionError)?, + ]; + Ok(env + .map_new_from_slices(&KEYS, &vals) + .map_err(|_| ConversionError)? + .into()) + } +} +impl soroban_sdk::TryFromVal for soroban_sdk::Val { + type Error = soroban_sdk::ConversionError; + #[inline(always)] + fn try_from_val( + env: &soroban_sdk::Env, + val: &&MockProof, + ) -> Result { + <_ as soroban_sdk::TryFromVal>::try_from_val(env, *val) + } +} +#[automatically_derived] +impl ::core::clone::Clone for MockProof { + #[inline] + fn clone(&self) -> MockProof { + MockProof { + g1: ::core::clone::Clone::clone(&self.g1), + g2: ::core::clone::Clone::clone(&self.g2), + } + } +} +pub struct Contract; +///ContractArgs is a type for building arg lists for functions defined in "Contract". +pub struct ContractArgs; +///ContractClient is a client for calling the contract defined in "Contract". +pub struct ContractClient<'a> { + pub env: soroban_sdk::Env, + pub address: soroban_sdk::Address, + #[doc(hidden)] + _phantom: core::marker::PhantomData<&'a ()>, +} +impl<'a> ContractClient<'a> { + pub fn new(env: &soroban_sdk::Env, address: &soroban_sdk::Address) -> Self { + Self { + env: env.clone(), + address: address.clone(), + _phantom: core::marker::PhantomData, + } + } +} +impl Contract { + pub fn verify_pairing(env: Env, proof: MockProof) -> bool { + env.crypto().bn254().pairing_check(proof.g1, proof.g2) + } + pub fn g1_add(a: G1Affine, b: G1Affine) -> G1Affine { + a + b + } + pub fn g1_mul(p: G1Affine, s: Fr) -> G1Affine { + p * s + } +} +#[doc(hidden)] +#[allow(non_snake_case)] +pub mod __Contract__verify_pairing__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + #[link_section = "contractspecv0"] + pub static __SPEC_XDR_FN_VERIFY_PAIRING: [u8; 76usize] = + super::Contract::spec_xdr_verify_pairing(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr_verify_pairing() -> [u8; 76usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\x0everify_pairing\0\0\0\0\0\x01\0\0\0\0\0\0\0\x05proof\0\0\0\0\0\x07\xd0\0\0\0\tMockProof\0\0\0\0\0\0\x01\0\0\0\x01" + } +} +#[doc(hidden)] +#[allow(non_snake_case)] +pub mod __Contract__g1_add__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + #[link_section = "contractspecv0"] + pub static __SPEC_XDR_FN_G1_ADD: [u8; 76usize] = super::Contract::spec_xdr_g1_add(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr_g1_add() -> [u8; 76usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\x06g1_add\0\0\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\x03\xee\0\0\0`\0\0\0\0\0\0\0\x01b\0\0\0\0\0\x03\xee\0\0\0`\0\0\0\x01\0\0\x03\xee\0\0\0`" + } +} +#[doc(hidden)] +#[allow(non_snake_case)] +pub mod __Contract__g1_mul__spec { + #[doc(hidden)] + #[allow(non_snake_case)] + #[allow(non_upper_case_globals)] + #[link_section = "contractspecv0"] + pub static __SPEC_XDR_FN_G1_MUL: [u8; 72usize] = super::Contract::spec_xdr_g1_mul(); +} +impl Contract { + #[allow(non_snake_case)] + pub const fn spec_xdr_g1_mul() -> [u8; 72usize] { + *b"\0\0\0\0\0\0\0\0\0\0\0\x06g1_mul\0\0\0\0\0\x02\0\0\0\0\0\0\0\x01p\0\0\0\0\0\x03\xee\0\0\0`\0\0\0\0\0\0\0\x01s\0\0\0\0\0\0\x0c\0\0\0\x01\0\0\x03\xee\0\0\0`" + } +} +impl<'a> ContractClient<'a> { + pub fn verify_pairing(&self, proof: &MockProof) -> bool { + use core::ops::Not; + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "verify_pairing") }, + ::soroban_sdk::Vec::from_array(&self.env, [proof.into_val(&self.env)]), + ); + res + } + pub fn try_verify_pairing( + &self, + proof: &MockProof, + ) -> Result< + Result>::Error>, + Result, + > { + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.try_invoke_contract( + &self.address, + &{ soroban_sdk::Symbol::new(&self.env, "verify_pairing") }, + ::soroban_sdk::Vec::from_array(&self.env, [proof.into_val(&self.env)]), + ); + res + } + pub fn g1_add(&self, a: &G1Affine, b: &G1Affine) -> G1Affine { + use core::ops::Not; + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.invoke_contract( + &self.address, + &{ + #[allow(deprecated)] + const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("g1_add"); + SYMBOL + }, + ::soroban_sdk::Vec::from_array( + &self.env, + [a.into_val(&self.env), b.into_val(&self.env)], + ), + ); + res + } + pub fn try_g1_add( + &self, + a: &G1Affine, + b: &G1Affine, + ) -> Result< + Result< + G1Affine, + >::Error, + >, + Result, + > { + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.try_invoke_contract( + &self.address, + &{ + #[allow(deprecated)] + const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("g1_add"); + SYMBOL + }, + ::soroban_sdk::Vec::from_array( + &self.env, + [a.into_val(&self.env), b.into_val(&self.env)], + ), + ); + res + } + pub fn g1_mul(&self, p: &G1Affine, s: &Fr) -> G1Affine { + use core::ops::Not; + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.invoke_contract( + &self.address, + &{ + #[allow(deprecated)] + const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("g1_mul"); + SYMBOL + }, + ::soroban_sdk::Vec::from_array( + &self.env, + [p.into_val(&self.env), s.into_val(&self.env)], + ), + ); + res + } + pub fn try_g1_mul( + &self, + p: &G1Affine, + s: &Fr, + ) -> Result< + Result< + G1Affine, + >::Error, + >, + Result, + > { + use soroban_sdk::{FromVal, IntoVal}; + let res = self.env.try_invoke_contract( + &self.address, + &{ + #[allow(deprecated)] + const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("g1_mul"); + SYMBOL + }, + ::soroban_sdk::Vec::from_array( + &self.env, + [p.into_val(&self.env), s.into_val(&self.env)], + ), + ); + res + } +} +impl ContractArgs { + #[inline(always)] + #[allow(clippy::unused_unit)] + pub fn verify_pairing<'i>(proof: &'i MockProof) -> (&'i MockProof,) { + (proof,) + } + #[inline(always)] + #[allow(clippy::unused_unit)] + pub fn g1_add<'i>(a: &'i G1Affine, b: &'i G1Affine) -> (&'i G1Affine, &'i G1Affine) { + (a, b) + } + #[inline(always)] + #[allow(clippy::unused_unit)] + pub fn g1_mul<'i>(p: &'i G1Affine, s: &'i Fr) -> (&'i G1Affine, &'i Fr) { + (p, s) + } +} +#[doc(hidden)] +#[allow(non_snake_case)] +pub mod __Contract__verify_pairing { + use super::*; + #[deprecated(note = "use `ContractClient::new(&env, &contract_id).verify_pairing` instead")] + pub fn invoke_raw(env: soroban_sdk::Env, arg_0: soroban_sdk::Val) -> soroban_sdk::Val { + <_ as soroban_sdk::IntoVal>::into_val( + #[allow(deprecated)] + &::verify_pairing( + env.clone(), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_0), + ), + ), + &env, + ) + } + #[deprecated(note = "use `ContractClient::new(&env, &contract_id).verify_pairing` instead")] + #[export_name = "verify_pairing"] + pub extern "C" fn invoke_raw_extern(arg_0: soroban_sdk::Val) -> soroban_sdk::Val { + #[allow(deprecated)] + invoke_raw(soroban_sdk::Env::default(), arg_0) + } + use super::*; +} +#[doc(hidden)] +#[allow(non_snake_case)] +pub mod __Contract__g1_add { + use super::*; + #[deprecated(note = "use `ContractClient::new(&env, &contract_id).g1_add` instead")] + pub fn invoke_raw( + env: soroban_sdk::Env, + arg_0: soroban_sdk::Val, + arg_1: soroban_sdk::Val, + ) -> soroban_sdk::Val { + <_ as soroban_sdk::IntoVal>::into_val( + #[allow(deprecated)] + &::g1_add( + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_0), + ), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_1), + ), + ), + &env, + ) + } + #[deprecated(note = "use `ContractClient::new(&env, &contract_id).g1_add` instead")] + #[export_name = "g1_add"] + pub extern "C" fn invoke_raw_extern( + arg_0: soroban_sdk::Val, + arg_1: soroban_sdk::Val, + ) -> soroban_sdk::Val { + #[allow(deprecated)] + invoke_raw(soroban_sdk::Env::default(), arg_0, arg_1) + } + use super::*; +} +#[doc(hidden)] +#[allow(non_snake_case)] +pub mod __Contract__g1_mul { + use super::*; + #[deprecated(note = "use `ContractClient::new(&env, &contract_id).g1_mul` instead")] + pub fn invoke_raw( + env: soroban_sdk::Env, + arg_0: soroban_sdk::Val, + arg_1: soroban_sdk::Val, + ) -> soroban_sdk::Val { + <_ as soroban_sdk::IntoVal>::into_val( + #[allow(deprecated)] + &::g1_mul( + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_0), + ), + <_ as soroban_sdk::unwrap::UnwrapOptimized>::unwrap_optimized( + <_ as soroban_sdk::TryFromValForContractFn< + soroban_sdk::Env, + soroban_sdk::Val, + >>::try_from_val_for_contract_fn(&env, &arg_1), + ), + ), + &env, + ) + } + #[deprecated(note = "use `ContractClient::new(&env, &contract_id).g1_mul` instead")] + #[export_name = "g1_mul"] + pub extern "C" fn invoke_raw_extern( + arg_0: soroban_sdk::Val, + arg_1: soroban_sdk::Val, + ) -> soroban_sdk::Val { + #[allow(deprecated)] + invoke_raw(soroban_sdk::Env::default(), arg_0, arg_1) + } + use super::*; +} diff --git a/tests-expanded/test_import_contract_tests.rs b/tests-expanded/test_import_contract_tests.rs index e05315ea5..aec7be8f4 100644 --- a/tests-expanded/test_import_contract_tests.rs +++ b/tests-expanded/test_import_contract_tests.rs @@ -6,7 +6,7 @@ extern crate core; use core::prelude::rust_2021::*; use soroban_sdk::{contract, contractimpl, Address, Env}; mod addcontract { - pub const WASM: &[u8] = b"\0asm\x01\0\0\0\x01\x14\x04`\x01~\x01~`\x02\x7f~\0`\x02~~\x01~`\0\0\x02\r\x02\x01i\x010\0\0\x01i\x01_\0\0\x03\x05\x04\x01\x02\x03\x03\x05\x03\x01\0\x10\x06!\x04\x7f\x01A\x80\x80\xc0\0\x0b\x7f\0A\x80\x80\xc0\0\x0b\x7f\0A\x80\x80\xc0\0\x0b\x7f\0A\x80\x80\xc0\0\x0b\x07/\x05\x06memory\x02\0\x03add\0\x03\x01_\x03\x01\n__data_end\x03\x02\x0b__heap_base\x03\x03\n\x89\x02\x04]\x02\x01\x7f\x01~\x02@\x02@ \x01\xa7A\xff\x01q\"\x02A\xc0\0F\r\0\x02@ \x02A\x06F\r\0B\x01!\x03B\x83\x90\x80\x80\x80\x01!\x01\x0c\x02\x0b \x01B\x08\x88!\x01B\0!\x03\x0c\x01\x0bB\0!\x03 \x01\x10\x80\x80\x80\x80\0!\x01\x0b \0 \x037\x03\0 \0 \x017\x03\x08\x0b\x9a\x01\x01\x01\x7f#\x80\x80\x80\x80\0A\x10k\"\x02$\x80\x80\x80\x80\0 \x02 \0\x10\x82\x80\x80\x80\0\x02@\x02@ \x02(\x02\0A\x01F\r\0 \x02)\x03\x08!\0 \x02 \x01\x10\x82\x80\x80\x80\0 \x02(\x02\0A\x01F\r\0 \0 \x02)\x03\x08|\"\x01 \0T\r\x01\x02@\x02@ \x01B\xff\xff\xff\xff\xff\xff\xff\xff\0V\r\0 \x01B\x08\x86B\x06\x84!\0\x0c\x01\x0b \x01\x10\x81\x80\x80\x80\0!\0\x0b \x02A\x10j$\x80\x80\x80\x80\0 \0\x0f\x0b\0\x0b\x10\x84\x80\x80\x80\0\0\x0b\t\0\x10\x85\x80\x80\x80\0\0\x0b\x03\0\0\x0b\x0b\t\x01\0A\x80\x80\xc0\0\x0b\0\0K\x0econtractspecv0\0\0\0\0\0\0\0\0\0\0\0\x03add\0\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\0\x06\0\0\0\0\0\0\0\x01b\0\0\0\0\0\0\x06\0\0\0\x01\0\0\0\x06\0\x1e\x11contractenvmetav0\0\0\0\0\0\0\0\x17\0\0\0\0\0+\x0econtractmetav0\0\0\0\0\0\0\0\x05rsver\0\0\0\0\0\0\x061.84.0\0\0"; + pub const WASM: &[u8] = b"\0asm\x01\0\0\0\x01\x14\x04`\x01~\x01~`\x02\x7f~\0`\x02~~\x01~`\0\0\x02\r\x02\x01i\x010\0\0\x01i\x01_\0\0\x03\x05\x04\x01\x02\x03\x03\x05\x03\x01\0\x10\x06!\x04\x7f\x01A\x80\x80\xc0\0\x0b\x7f\0A\x80\x80\xc0\0\x0b\x7f\0A\x80\x80\xc0\0\x0b\x7f\0A\x80\x80\xc0\0\x0b\x07/\x05\x06memory\x02\0\x03add\0\x03\x01_\x03\x01\n__data_end\x03\x02\x0b__heap_base\x03\x03\n\x89\x02\x04]\x02\x01\x7f\x01~\x02@\x02@ \x01\xa7A\xff\x01q\"\x02A\xc0\0F\r\0\x02@ \x02A\x06F\r\0B\x01!\x03B\x83\x90\x80\x80\x80\x01!\x01\x0c\x02\x0b \x01B\x08\x88!\x01B\0!\x03\x0c\x01\x0bB\0!\x03 \x01\x10\x80\x80\x80\x80\0!\x01\x0b \0 \x037\x03\0 \0 \x017\x03\x08\x0b\x9a\x01\x01\x01\x7f#\x80\x80\x80\x80\0A\x10k\"\x02$\x80\x80\x80\x80\0 \x02 \0\x10\x82\x80\x80\x80\0\x02@\x02@ \x02(\x02\0A\x01F\r\0 \x02)\x03\x08!\0 \x02 \x01\x10\x82\x80\x80\x80\0 \x02(\x02\0A\x01F\r\0 \0 \x02)\x03\x08|\"\x01 \0T\r\x01\x02@\x02@ \x01B\xff\xff\xff\xff\xff\xff\xff\xff\0V\r\0 \x01B\x08\x86B\x06\x84!\0\x0c\x01\x0b \x01\x10\x81\x80\x80\x80\0!\0\x0b \x02A\x10j$\x80\x80\x80\x80\0 \0\x0f\x0b\0\x0b\x10\x84\x80\x80\x80\0\0\x0b\t\0\x10\x85\x80\x80\x80\0\0\x0b\x03\0\0\x0b\x0b\t\x01\0A\x80\x80\xc0\0\x0b\0\0K\x0econtractspecv0\0\0\0\0\0\0\0\0\0\0\0\x03add\0\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\0\x06\0\0\0\0\0\0\0\x01b\0\0\0\0\0\0\x06\0\0\0\x01\0\0\0\x06\0\x1e\x11contractenvmetav0\0\0\0\0\0\0\0\x19\0\0\0\0\0+\x0econtractmetav0\0\0\0\0\0\0\0\x05rsver\0\0\0\0\0\0\x061.84.0\0\0"; pub trait Contract { fn add(env: soroban_sdk::Env, a: u64, b: u64) -> u64; } diff --git a/tests-expanded/test_import_contract_wasm32v1-none.rs b/tests-expanded/test_import_contract_wasm32v1-none.rs index 44b65c8d7..03740baa8 100644 --- a/tests-expanded/test_import_contract_wasm32v1-none.rs +++ b/tests-expanded/test_import_contract_wasm32v1-none.rs @@ -6,7 +6,7 @@ extern crate core; use core::prelude::rust_2021::*; use soroban_sdk::{contract, contractimpl, Address, Env}; mod addcontract { - pub const WASM: &[u8] = b"\0asm\x01\0\0\0\x01\x14\x04`\x01~\x01~`\x02\x7f~\0`\x02~~\x01~`\0\0\x02\r\x02\x01i\x010\0\0\x01i\x01_\0\0\x03\x05\x04\x01\x02\x03\x03\x05\x03\x01\0\x10\x06!\x04\x7f\x01A\x80\x80\xc0\0\x0b\x7f\0A\x80\x80\xc0\0\x0b\x7f\0A\x80\x80\xc0\0\x0b\x7f\0A\x80\x80\xc0\0\x0b\x07/\x05\x06memory\x02\0\x03add\0\x03\x01_\x03\x01\n__data_end\x03\x02\x0b__heap_base\x03\x03\n\x89\x02\x04]\x02\x01\x7f\x01~\x02@\x02@ \x01\xa7A\xff\x01q\"\x02A\xc0\0F\r\0\x02@ \x02A\x06F\r\0B\x01!\x03B\x83\x90\x80\x80\x80\x01!\x01\x0c\x02\x0b \x01B\x08\x88!\x01B\0!\x03\x0c\x01\x0bB\0!\x03 \x01\x10\x80\x80\x80\x80\0!\x01\x0b \0 \x037\x03\0 \0 \x017\x03\x08\x0b\x9a\x01\x01\x01\x7f#\x80\x80\x80\x80\0A\x10k\"\x02$\x80\x80\x80\x80\0 \x02 \0\x10\x82\x80\x80\x80\0\x02@\x02@ \x02(\x02\0A\x01F\r\0 \x02)\x03\x08!\0 \x02 \x01\x10\x82\x80\x80\x80\0 \x02(\x02\0A\x01F\r\0 \0 \x02)\x03\x08|\"\x01 \0T\r\x01\x02@\x02@ \x01B\xff\xff\xff\xff\xff\xff\xff\xff\0V\r\0 \x01B\x08\x86B\x06\x84!\0\x0c\x01\x0b \x01\x10\x81\x80\x80\x80\0!\0\x0b \x02A\x10j$\x80\x80\x80\x80\0 \0\x0f\x0b\0\x0b\x10\x84\x80\x80\x80\0\0\x0b\t\0\x10\x85\x80\x80\x80\0\0\x0b\x03\0\0\x0b\x0b\t\x01\0A\x80\x80\xc0\0\x0b\0\0K\x0econtractspecv0\0\0\0\0\0\0\0\0\0\0\0\x03add\0\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\0\x06\0\0\0\0\0\0\0\x01b\0\0\0\0\0\0\x06\0\0\0\x01\0\0\0\x06\0\x1e\x11contractenvmetav0\0\0\0\0\0\0\0\x17\0\0\0\0\0+\x0econtractmetav0\0\0\0\0\0\0\0\x05rsver\0\0\0\0\0\0\x061.84.0\0\0"; + pub const WASM: &[u8] = b"\0asm\x01\0\0\0\x01\x14\x04`\x01~\x01~`\x02\x7f~\0`\x02~~\x01~`\0\0\x02\r\x02\x01i\x010\0\0\x01i\x01_\0\0\x03\x05\x04\x01\x02\x03\x03\x05\x03\x01\0\x10\x06!\x04\x7f\x01A\x80\x80\xc0\0\x0b\x7f\0A\x80\x80\xc0\0\x0b\x7f\0A\x80\x80\xc0\0\x0b\x7f\0A\x80\x80\xc0\0\x0b\x07/\x05\x06memory\x02\0\x03add\0\x03\x01_\x03\x01\n__data_end\x03\x02\x0b__heap_base\x03\x03\n\x89\x02\x04]\x02\x01\x7f\x01~\x02@\x02@ \x01\xa7A\xff\x01q\"\x02A\xc0\0F\r\0\x02@ \x02A\x06F\r\0B\x01!\x03B\x83\x90\x80\x80\x80\x01!\x01\x0c\x02\x0b \x01B\x08\x88!\x01B\0!\x03\x0c\x01\x0bB\0!\x03 \x01\x10\x80\x80\x80\x80\0!\x01\x0b \0 \x037\x03\0 \0 \x017\x03\x08\x0b\x9a\x01\x01\x01\x7f#\x80\x80\x80\x80\0A\x10k\"\x02$\x80\x80\x80\x80\0 \x02 \0\x10\x82\x80\x80\x80\0\x02@\x02@ \x02(\x02\0A\x01F\r\0 \x02)\x03\x08!\0 \x02 \x01\x10\x82\x80\x80\x80\0 \x02(\x02\0A\x01F\r\0 \0 \x02)\x03\x08|\"\x01 \0T\r\x01\x02@\x02@ \x01B\xff\xff\xff\xff\xff\xff\xff\xff\0V\r\0 \x01B\x08\x86B\x06\x84!\0\x0c\x01\x0b \x01\x10\x81\x80\x80\x80\0!\0\x0b \x02A\x10j$\x80\x80\x80\x80\0 \0\x0f\x0b\0\x0b\x10\x84\x80\x80\x80\0\0\x0b\t\0\x10\x85\x80\x80\x80\0\0\x0b\x03\0\0\x0b\x0b\t\x01\0A\x80\x80\xc0\0\x0b\0\0K\x0econtractspecv0\0\0\0\0\0\0\0\0\0\0\0\x03add\0\0\0\0\x02\0\0\0\0\0\0\0\x01a\0\0\0\0\0\0\x06\0\0\0\0\0\0\0\x01b\0\0\0\0\0\0\x06\0\0\0\x01\0\0\0\x06\0\x1e\x11contractenvmetav0\0\0\0\0\0\0\0\x19\0\0\0\0\0+\x0econtractmetav0\0\0\0\0\0\0\0\x05rsver\0\0\0\0\0\0\x061.84.0\0\0"; pub trait Contract { fn add(env: soroban_sdk::Env, a: u64, b: u64) -> u64; } diff --git a/tests/account/test_snapshots/test/test.1.json b/tests/account/test_snapshots/test/test.1.json index 2ebb8b346..789d3b3be 100644 --- a/tests/account/test_snapshots/test/test.1.json +++ b/tests/account/test_snapshots/test/test.1.json @@ -24,7 +24,7 @@ ] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/add_i128/test_snapshots/test/test_add.1.json b/tests/add_i128/test_snapshots/test/test_add.1.json index 6a19fbf66..72bea1158 100644 --- a/tests/add_i128/test_snapshots/test/test_add.1.json +++ b/tests/add_i128/test_snapshots/test/test_add.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/add_u128/test_snapshots/test/test_add.1.json b/tests/add_u128/test_snapshots/test/test_add.1.json index 6a19fbf66..72bea1158 100644 --- a/tests/add_u128/test_snapshots/test/test_add.1.json +++ b/tests/add_u128/test_snapshots/test/test_add.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/add_u64/test_snapshots/test/test_add.1.json b/tests/add_u64/test_snapshots/test/test_add.1.json index 6a19fbf66..72bea1158 100644 --- a/tests/add_u64/test_snapshots/test/test_add.1.json +++ b/tests/add_u64/test_snapshots/test/test_add.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/alloc/test_snapshots/test/native/test.1.json b/tests/alloc/test_snapshots/test/native/test.1.json index 6a19fbf66..72bea1158 100644 --- a/tests/alloc/test_snapshots/test/native/test.1.json +++ b/tests/alloc/test_snapshots/test/native/test.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/alloc/test_snapshots/test/wasm/test.1.json b/tests/alloc/test_snapshots/test/wasm/test.1.json index 119486814..804953f28 100644 --- a/tests/alloc/test_snapshots/test/wasm/test.1.json +++ b/tests/alloc/test_snapshots/test/wasm/test.1.json @@ -8,7 +8,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", @@ -70,7 +70,7 @@ "val": { "contract_instance": { "executable": { - "wasm": "fa62607adbe4d9123fca96fcea8cd6203653f5020029d201f1d747cb468c40db" + "wasm": "96c0a94f8958212d9077730444e5351f82ba10d12b6fab95aee4c6048da0490c" }, "storage": null } @@ -85,7 +85,7 @@ [ { "contract_code": { - "hash": "fa62607adbe4d9123fca96fcea8cd6203653f5020029d201f1d747cb468c40db" + "hash": "96c0a94f8958212d9077730444e5351f82ba10d12b6fab95aee4c6048da0490c" } }, [ @@ -111,8 +111,8 @@ } } }, - "hash": "fa62607adbe4d9123fca96fcea8cd6203653f5020029d201f1d747cb468c40db", - "code": "0061736d01000000012e096000017e60027e7e017e60027f7f0060000060017f017f60037f7f7f0060017f0060017e017e60037f7f7f017f020d020176015f000001760136000103100f02030403050602070606030603030805030100110621047f01418080c0000b7f00418080c0000b7f00418c80c0000b7f00419080c0000b073405066d656d6f72790200086e756d5f6c6973740009015f03010a5f5f646174615f656e6403020b5f5f686561705f6261736503030ad80e0f850101027f0240024020010d00410421020c010b41002d008080c080001a1083808080000240410028028480c08000220241036a22032002490d0002402003417c71220220016a2203410028028880c080004d0d00200110848080800021020c020b4100200336028480c080000c010b108580808000000b20002001360204200020023602000b4301017f02400240410028028880c080000d003f00220041ffff034b0d0141002000411074220036028880c080004100200036028480c080000b0f0b108580808000000b910101047f200041ffff036a22014180807c7121022001411076210302400240034020034000417f460d014100410028028880c0800020026a36028880c08000108380808000410028028480c08000220141036a22042001490d022004417c71220120006a2204410028028880c080004b0d000b4100200436028480c0800020010f0b108f80808000000b108580808000000b0900108e80808000000b940201047f23808080800041106b22032480808080000240024002402002280204450d000240200228020822040d00200341086a2001108280808000200328020c2104200328020821020c020b20022802002105108380808000410028028480c08000220241036a22062002490d02024002402006417c71220220016a2206410028028880c080004d0d00200110848080800021020c010b4100200636028480c080000b0240024020020d00410021020c010b2002200520041090808080001a0b200121040c010b2003200110828080800020032802042104200328020021020b20002002410420021b360204200020024536020020002004200120021b360208200341106a2480808080000f0b108580808000000bec0101067f23808080800041206b220124808080800041002102024002400240024020002802002203417f460d002003410174200341016a200341004a1b220441ffffffff034d0d010b0c010b20044104200441044b1b2205410274220441fcffffff074b0d000240024020030d00410021030c010b2001200341027436021c20012000280204360214410421030b20012003360218200141086a2004200141146a10868080800020012802084101470d0120012802102106200128020c21020b20022006108880808000000b200128020c21032000200536020020002003360204200141206a2480808080000b1900024020000d00108c80808000000b2001108d80808000000bee0101067f23808080800041106b220124808080800002400240200042ff01834204520d002000422088a72102410021032001410036020c20014280808080c00037020441012104410421054100210602400340200620024f0d0102402004417f6a2001280204470d00200141046a108780808000200128020821050b200520036a2006360200200341046a21032001200436020c200441016a2104200620062002496a21060c000b0b108080808000210003402003450d022003417c6a2103200020053502004220864204841081808080002100200541046a21050c000b0b000b200141106a24808080800020000b0b002000108b80808000000b0900108e80808000000b0900108e80808000000b0b002000108a80808000000b0300000b0900108580808000000ba50501087f02400240200241104f0d00200021030c010b02402000410020006b41037122046a220520004d0d002004417f6a2106200021032001210702402004450d002004210820002103200121070340200320072d00003a0000200741016a2107200341016a21032008417f6a22080d000b0b20064107490d000340200320072d00003a0000200341016a200741016a2d00003a0000200341026a200741026a2d00003a0000200341036a200741036a2d00003a0000200341046a200741046a2d00003a0000200341056a200741056a2d00003a0000200341066a200741066a2d00003a0000200341076a200741076a2d00003a0000200741086a2107200341086a22032005470d000b0b2005200220046b2208417c7122066a210302400240200120046a22074103710d00200520034f0d0120072101034020052001280200360200200141046a2101200541046a22052003490d000c020b0b200520034f0d002007410374220241187121042007417c71220941046a2101410020026b411871210a2009280200210203402005200220047620012802002202200a7472360200200141046a2101200541046a22052003490d000b0b20084103712102200720066a21010b02402003200320026a22054f0d002002417f6a2108024020024107712207450d000340200320012d00003a0000200141016a2101200341016a21032007417f6a22070d000b0b20084107490d000340200320012d00003a0000200341016a200141016a2d00003a0000200341026a200141026a2d00003a0000200341036a200141036a2d00003a0000200341046a200141046a2d00003a0000200341056a200141056a2d00003a0000200341066a200141066a2d00003a0000200341076a200141076a2d00003a0000200141086a2101200341086a22032005470d000b0b20000b0b090100418080c0000b0000470e636f6e74726163747370656376300000000000000000000000086e756d5f6c697374000000010000000000000005636f756e740000000000000400000001000003ea00000004001e11636f6e7472616374656e766d6574617630000000000000001700000000002b0e636f6e74726163746d65746176300000000000000005727376657200000000000006312e38342e300000" + "hash": "96c0a94f8958212d9077730444e5351f82ba10d12b6fab95aee4c6048da0490c", + "code": "0061736d01000000012e096000017e60027e7e017e60027f7f0060000060017f017f60037f7f7f0060017f0060017e017e60037f7f7f017f020d020176015f000001760136000103100f02030403050602070606030603030805030100110621047f01418080c0000b7f00418080c0000b7f00418c80c0000b7f00419080c0000b073405066d656d6f72790200086e756d5f6c6973740009015f03010a5f5f646174615f656e6403020b5f5f686561705f6261736503030ad80e0f850101027f0240024020010d00410421020c010b41002d008080c080001a1083808080000240410028028480c08000220241036a22032002490d0002402003417c71220220016a2203410028028880c080004d0d00200110848080800021020c020b4100200336028480c080000c010b108580808000000b20002001360204200020023602000b4301017f02400240410028028880c080000d003f00220041ffff034b0d0141002000411074220036028880c080004100200036028480c080000b0f0b108580808000000b910101047f200041ffff036a22014180807c7121022001411076210302400240034020034000417f460d014100410028028880c0800020026a36028880c08000108380808000410028028480c08000220141036a22042001490d022004417c71220120006a2204410028028880c080004b0d000b4100200436028480c0800020010f0b108f80808000000b108580808000000b0900108e80808000000b940201047f23808080800041106b22032480808080000240024002402002280204450d000240200228020822040d00200341086a2001108280808000200328020c2104200328020821020c020b20022802002105108380808000410028028480c08000220241036a22062002490d02024002402006417c71220220016a2206410028028880c080004d0d00200110848080800021020c010b4100200636028480c080000b0240024020020d00410021020c010b2002200520041090808080001a0b200121040c010b2003200110828080800020032802042104200328020021020b20002002410420021b360204200020024536020020002004200120021b360208200341106a2480808080000f0b108580808000000bec0101067f23808080800041206b220124808080800041002102024002400240024020002802002203417f460d002003410174200341016a200341004a1b220441ffffffff034d0d010b0c010b20044104200441044b1b2205410274220441fcffffff074b0d000240024020030d00410021030c010b2001200341027436021c20012000280204360214410421030b20012003360218200141086a2004200141146a10868080800020012802084101470d0120012802102106200128020c21020b20022006108880808000000b200128020c21032000200536020020002003360204200141206a2480808080000b1900024020000d00108c80808000000b2001108d80808000000bee0101067f23808080800041106b220124808080800002400240200042ff01834204520d002000422088a72102410021032001410036020c20014280808080c00037020441012104410421054100210602400340200620024f0d0102402004417f6a2001280204470d00200141046a108780808000200128020821050b200520036a2006360200200341046a21032001200436020c200441016a2104200620062002496a21060c000b0b108080808000210003402003450d022003417c6a2103200020053502004220864204841081808080002100200541046a21050c000b0b000b200141106a24808080800020000b0b002000108b80808000000b0900108e80808000000b0900108e80808000000b0b002000108a80808000000b0300000b0900108580808000000ba50501087f02400240200241104f0d00200021030c010b02402000410020006b41037122046a220520004d0d002004417f6a2106200021032001210702402004450d002004210820002103200121070340200320072d00003a0000200741016a2107200341016a21032008417f6a22080d000b0b20064107490d000340200320072d00003a0000200341016a200741016a2d00003a0000200341026a200741026a2d00003a0000200341036a200741036a2d00003a0000200341046a200741046a2d00003a0000200341056a200741056a2d00003a0000200341066a200741066a2d00003a0000200341076a200741076a2d00003a0000200741086a2107200341086a22032005470d000b0b2005200220046b2208417c7122066a210302400240200120046a22074103710d00200520034f0d0120072101034020052001280200360200200141046a2101200541046a22052003490d000c020b0b200520034f0d002007410374220241187121042007417c71220941046a2101410020026b411871210a2009280200210203402005200220047620012802002202200a7472360200200141046a2101200541046a22052003490d000b0b20084103712102200720066a21010b02402003200320026a22054f0d002002417f6a2108024020024107712207450d000340200320012d00003a0000200141016a2101200341016a21032007417f6a22070d000b0b20084107490d000340200320012d00003a0000200341016a200141016a2d00003a0000200341026a200141026a2d00003a0000200341036a200141036a2d00003a0000200341046a200141046a2d00003a0000200341056a200141056a2d00003a0000200341066a200141066a2d00003a0000200341076a200141076a2d00003a0000200141086a2101200341086a22032005470d000b0b20000b0b090100418080c0000b0000470e636f6e74726163747370656376300000000000000000000000086e756d5f6c697374000000010000000000000005636f756e740000000000000400000001000003ea00000004001e11636f6e7472616374656e766d6574617630000000000000001900000000002b0e636f6e74726163746d65746176300000000000000005727376657200000000000006312e38342e300000" } }, "ext": "v0" diff --git a/tests/associated_type/test_snapshots/test/test_exec.1.json b/tests/associated_type/test_snapshots/test/test_exec.1.json index 6a19fbf66..72bea1158 100644 --- a/tests/associated_type/test_snapshots/test/test_exec.1.json +++ b/tests/associated_type/test_snapshots/test/test_exec.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/auth/test_snapshots/test_a/test_with_mock_all_auth.1.json b/tests/auth/test_snapshots/test_a/test_with_mock_all_auth.1.json index 07e5e12c4..03e31d287 100644 --- a/tests/auth/test_snapshots/test_a/test_with_mock_all_auth.1.json +++ b/tests/auth/test_snapshots/test_a/test_with_mock_all_auth.1.json @@ -27,7 +27,7 @@ ] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/auth/test_snapshots/test_a/test_with_mock_auth.1.json b/tests/auth/test_snapshots/test_a/test_with_mock_auth.1.json index 22d6ac62c..6ae3d4d04 100644 --- a/tests/auth/test_snapshots/test_a/test_with_mock_auth.1.json +++ b/tests/auth/test_snapshots/test_a/test_with_mock_auth.1.json @@ -28,7 +28,7 @@ ] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/auth/test_snapshots/test_a/test_with_real_contract_auth_approve.1.json b/tests/auth/test_snapshots/test_a/test_with_real_contract_auth_approve.1.json index d5282e15d..40dcc4e09 100644 --- a/tests/auth/test_snapshots/test_a/test_with_real_contract_auth_approve.1.json +++ b/tests/auth/test_snapshots/test_a/test_with_real_contract_auth_approve.1.json @@ -28,7 +28,7 @@ ] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/auth/test_snapshots/test_a/test_with_real_contract_auth_decline.1.json b/tests/auth/test_snapshots/test_a/test_with_real_contract_auth_decline.1.json index e35171bbe..f3e5c5600 100644 --- a/tests/auth/test_snapshots/test_a/test_with_real_contract_auth_decline.1.json +++ b/tests/auth/test_snapshots/test_a/test_with_real_contract_auth_decline.1.json @@ -10,7 +10,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/auth/test_snapshots/test_b/test_with_mock_all_auth.1.json b/tests/auth/test_snapshots/test_b/test_with_mock_all_auth.1.json index f9ef6433a..63956ca39 100644 --- a/tests/auth/test_snapshots/test_b/test_with_mock_all_auth.1.json +++ b/tests/auth/test_snapshots/test_b/test_with_mock_all_auth.1.json @@ -46,7 +46,7 @@ ] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/auth/test_snapshots/test_b/test_with_mock_auth.1.json b/tests/auth/test_snapshots/test_b/test_with_mock_auth.1.json index 5fe7c8237..96d747bcb 100644 --- a/tests/auth/test_snapshots/test_b/test_with_mock_auth.1.json +++ b/tests/auth/test_snapshots/test_b/test_with_mock_auth.1.json @@ -47,7 +47,7 @@ ] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/auth/test_snapshots/test_b/test_with_real_contract_auth_approve.1.json b/tests/auth/test_snapshots/test_b/test_with_real_contract_auth_approve.1.json index 8231be24a..3cd406c93 100644 --- a/tests/auth/test_snapshots/test_b/test_with_real_contract_auth_approve.1.json +++ b/tests/auth/test_snapshots/test_b/test_with_real_contract_auth_approve.1.json @@ -47,7 +47,7 @@ ] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/auth/test_snapshots/test_b/test_with_real_contract_auth_decline.1.json b/tests/auth/test_snapshots/test_b/test_with_real_contract_auth_decline.1.json index f3d224739..53b72c084 100644 --- a/tests/auth/test_snapshots/test_b/test_with_real_contract_auth_decline.1.json +++ b/tests/auth/test_snapshots/test_b/test_with_real_contract_auth_decline.1.json @@ -11,7 +11,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/bls/test_snapshots/test/test_dummy_verify.1.json b/tests/bls/test_snapshots/test/test_dummy_verify.1.json index 6a19fbf66..72bea1158 100644 --- a/tests/bls/test_snapshots/test/test_dummy_verify.1.json +++ b/tests/bls/test_snapshots/test/test_dummy_verify.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/bls/test_snapshots/test/test_g1_mul.1.json b/tests/bls/test_snapshots/test/test_g1_mul.1.json index 6a19fbf66..72bea1158 100644 --- a/tests/bls/test_snapshots/test/test_g1_mul.1.json +++ b/tests/bls/test_snapshots/test/test_g1_mul.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/bls/test_snapshots/test/test_g2_mul.1.json b/tests/bls/test_snapshots/test/test_g2_mul.1.json index 6a19fbf66..72bea1158 100644 --- a/tests/bls/test_snapshots/test/test_g2_mul.1.json +++ b/tests/bls/test_snapshots/test/test_g2_mul.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/bn254/Cargo.toml b/tests/bn254/Cargo.toml new file mode 100644 index 000000000..90f6ade20 --- /dev/null +++ b/tests/bn254/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "test_bn254" +version.workspace = true +authors = ["Stellar Development Foundation "] +license = "Apache-2.0" +edition = "2021" +publish = false +rust-version = "1.84.0" + +[lib] +crate-type = ["cdylib"] +doctest = false + +[dependencies] +soroban-sdk = {path = "../../soroban-sdk"} + +[dev-dependencies] +soroban-sdk = {path = "../../soroban-sdk", features = ["testutils"]} +ark-bn254 = "0.5.0" +ark-serialize = "0.5.0" +ark-ec = "0.5.0" +ark-ff = "0.5.0" +ark-std = "0.5.0" diff --git a/tests/bn254/src/lib.rs b/tests/bn254/src/lib.rs new file mode 100644 index 000000000..74d7afee7 --- /dev/null +++ b/tests/bn254/src/lib.rs @@ -0,0 +1,120 @@ +#![no_std] +use soroban_sdk::{ + contract, contractimpl, contracttype, + crypto::bn254::{Fr, G1Affine, G2Affine}, + Env, Vec, +}; + +#[derive(Clone)] +#[contracttype] +pub struct MockProof { + pub g1: Vec, + pub g2: Vec, +} + +#[contract] +pub struct Contract; + +#[contractimpl] +impl Contract { + pub fn verify_pairing(env: Env, proof: MockProof) -> bool { + env.crypto().bn254().pairing_check(proof.g1, proof.g2) + } + + pub fn g1_add(a: G1Affine, b: G1Affine) -> G1Affine { + a + b + } + + pub fn g1_mul(p: G1Affine, s: Fr) -> G1Affine { + p * s + } +} + +#[cfg(test)] +mod test { + use super::*; + use soroban_sdk::{crypto::bn254, vec, Env, U256}; + extern crate std; + + use std::ops::Add; + + use crate::{Contract, ContractClient}; + + use ark_bn254::{G1Affine, G2Affine}; + use ark_ec::CurveGroup; + use ark_ff::UniformRand; + use ark_serialize::CanonicalSerialize; + + #[test] + fn test_add_and_mul() { + let env = Env::default(); + let contract_id = env.register(Contract, ()); + let client = ContractClient::new(&env, &contract_id); + + // Generate random points + let mut rng = ark_std::test_rng(); + + let mut a_bytes = [0u8; 64]; + G1Affine::rand(&mut rng) + .serialize_uncompressed(&mut a_bytes[..]) + .unwrap(); + + let a_bn254 = bn254::G1Affine::from_array(&env, &a_bytes); + + let scalar: bn254::Fr = U256::from_u32(&env, 2).into(); + + // G + G = 2G + assert_eq!( + client.g1_add(&a_bn254, &a_bn254), + client.g1_mul(&a_bn254, &scalar) + ); + } + + // Test e(P, Q+R) = e(P, Q)*e(P, R) + #[test] + fn test_pairing() { + let env = Env::default(); + let contract_id = env.register(Contract, ()); + let client = ContractClient::new(&env, &contract_id); + + // Generate random points + let mut rng = ark_std::test_rng(); + let p = G1Affine::rand(&mut rng); + let neg_p = -p; + let q = G2Affine::rand(&mut rng); + let r = G2Affine::rand(&mut rng); + let q_plus_r = &q.add(&r).into_affine(); + // Serialize points + let mut p_bytes = [0u8; 64]; + let mut neg_p_bytes = [0u8; 64]; + + let mut q_bytes = [0u8; 128]; + let mut r_bytes = [0u8; 128]; + let mut q_plus_r_bytes = [0u8; 128]; + p.serialize_uncompressed(&mut p_bytes[..]).unwrap(); + neg_p.serialize_uncompressed(&mut neg_p_bytes[..]).unwrap(); + q.serialize_uncompressed(&mut q_bytes[..]).unwrap(); + r.serialize_uncompressed(&mut r_bytes[..]).unwrap(); + q_plus_r + .serialize_uncompressed(&mut q_plus_r_bytes[..]) + .unwrap(); + + // Create proof + let proof = MockProof { + g1: vec![ + &env, + bn254::G1Affine::from_array(&env, &neg_p_bytes), + bn254::G1Affine::from_array(&env, &p_bytes), + bn254::G1Affine::from_array(&env, &p_bytes), + ], + g2: vec![ + &env, + bn254::G2Affine::from_array(&env, &q_plus_r_bytes), + bn254::G2Affine::from_array(&env, &q_bytes), + bn254::G2Affine::from_array(&env, &r_bytes), + ], + }; + + assert!(client.verify_pairing(&proof)); + } +} diff --git a/tests/bn254/test_snapshots/test/test_add_and_mul.1.json b/tests/bn254/test_snapshots/test/test_add_and_mul.1.json new file mode 100644 index 000000000..61f0e84d2 --- /dev/null +++ b/tests/bn254/test_snapshots/test/test_add_and_mul.1.json @@ -0,0 +1,78 @@ +{ + "generators": { + "address": 1, + "nonce": 0, + "mux_id": 0 + }, + "auth": [ + [], + [], + [] + ], + "ledger": { + "protocol_version": 25, + "sequence_number": 0, + "timestamp": 0, + "network_id": "0000000000000000000000000000000000000000000000000000000000000000", + "base_reserve": 0, + "min_persistent_entry_ttl": 4096, + "min_temp_entry_ttl": 16, + "max_entry_ttl": 6312000, + "ledger_entries": [ + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": "ledger_key_contract_instance", + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": "ledger_key_contract_instance", + "durability": "persistent", + "val": { + "contract_instance": { + "executable": { + "wasm": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "storage": null + } + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_code": { + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_code": { + "ext": "v0", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "code": "" + } + }, + "ext": "v0" + }, + 4095 + ] + ] + ] + }, + "events": [] +} \ No newline at end of file diff --git a/tests/bn254/test_snapshots/test/test_pairing.1.json b/tests/bn254/test_snapshots/test/test_pairing.1.json new file mode 100644 index 000000000..72bea1158 --- /dev/null +++ b/tests/bn254/test_snapshots/test/test_pairing.1.json @@ -0,0 +1,77 @@ +{ + "generators": { + "address": 1, + "nonce": 0, + "mux_id": 0 + }, + "auth": [ + [], + [] + ], + "ledger": { + "protocol_version": 25, + "sequence_number": 0, + "timestamp": 0, + "network_id": "0000000000000000000000000000000000000000000000000000000000000000", + "base_reserve": 0, + "min_persistent_entry_ttl": 4096, + "min_temp_entry_ttl": 16, + "max_entry_ttl": 6312000, + "ledger_entries": [ + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": "ledger_key_contract_instance", + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": "ledger_key_contract_instance", + "durability": "persistent", + "val": { + "contract_instance": { + "executable": { + "wasm": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "storage": null + } + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_code": { + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_code": { + "ext": "v0", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "code": "" + } + }, + "ext": "v0" + }, + 4095 + ] + ] + ] + }, + "events": [] +} \ No newline at end of file diff --git a/tests/bn254/test_snapshots/test/test_pairing_running_contract_as_wasm.1.json b/tests/bn254/test_snapshots/test/test_pairing_running_contract_as_wasm.1.json new file mode 100644 index 000000000..b9f0f74c6 --- /dev/null +++ b/tests/bn254/test_snapshots/test/test_pairing_running_contract_as_wasm.1.json @@ -0,0 +1,77 @@ +{ + "generators": { + "address": 1, + "nonce": 0, + "mux_id": 0 + }, + "auth": [ + [], + [] + ], + "ledger": { + "protocol_version": 24, + "sequence_number": 0, + "timestamp": 0, + "network_id": "0000000000000000000000000000000000000000000000000000000000000000", + "base_reserve": 0, + "min_persistent_entry_ttl": 4096, + "min_temp_entry_ttl": 16, + "max_entry_ttl": 6312000, + "ledger_entries": [ + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": "ledger_key_contract_instance", + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": "ledger_key_contract_instance", + "durability": "persistent", + "val": { + "contract_instance": { + "executable": { + "wasm": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "storage": null + } + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_code": { + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_code": { + "ext": "v0", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "code": "" + } + }, + "ext": "v0" + }, + 4095 + ] + ] + ] + }, + "events": [] +} \ No newline at end of file diff --git a/tests/constructor/test_snapshots/test_constructor.1.json b/tests/constructor/test_snapshots/test_constructor.1.json index 40264cbd2..f43c95fdd 100644 --- a/tests/constructor/test_snapshots/test_constructor.1.json +++ b/tests/constructor/test_snapshots/test_constructor.1.json @@ -14,7 +14,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/constructor/test_snapshots/test_missing_constructor_arguments_causes_panic.1.json b/tests/constructor/test_snapshots/test_missing_constructor_arguments_causes_panic.1.json index 426d84cb9..3df0b5df4 100644 --- a/tests/constructor/test_snapshots/test_missing_constructor_arguments_causes_panic.1.json +++ b/tests/constructor/test_snapshots/test_missing_constructor_arguments_causes_panic.1.json @@ -8,7 +8,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/constructor/test_snapshots/test_passing_extra_constructor_arguments_causes_panic.1.json b/tests/constructor/test_snapshots/test_passing_extra_constructor_arguments_causes_panic.1.json index 426d84cb9..3df0b5df4 100644 --- a/tests/constructor/test_snapshots/test_passing_extra_constructor_arguments_causes_panic.1.json +++ b/tests/constructor/test_snapshots/test_passing_extra_constructor_arguments_causes_panic.1.json @@ -8,7 +8,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/constructor/test_snapshots/test_passing_incorrectly_typed_constructor_arguments_causes_panic.1.json b/tests/constructor/test_snapshots/test_passing_incorrectly_typed_constructor_arguments_causes_panic.1.json index 426d84cb9..3df0b5df4 100644 --- a/tests/constructor/test_snapshots/test_passing_incorrectly_typed_constructor_arguments_causes_panic.1.json +++ b/tests/constructor/test_snapshots/test_passing_incorrectly_typed_constructor_arguments_causes_panic.1.json @@ -8,7 +8,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/constructor/test_snapshots/test_passing_no_constructor_arguments_causes_panic.1.json b/tests/constructor/test_snapshots/test_passing_no_constructor_arguments_causes_panic.1.json index 426d84cb9..3df0b5df4 100644 --- a/tests/constructor/test_snapshots/test_passing_no_constructor_arguments_causes_panic.1.json +++ b/tests/constructor/test_snapshots/test_passing_no_constructor_arguments_causes_panic.1.json @@ -8,7 +8,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/empty/test_snapshots/test/test_hello.1.json b/tests/empty/test_snapshots/test/test_hello.1.json index 6a19fbf66..72bea1158 100644 --- a/tests/empty/test_snapshots/test/test_hello.1.json +++ b/tests/empty/test_snapshots/test/test_hello.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/empty2/test_snapshots/test/test_hello.1.json b/tests/empty2/test_snapshots/test/test_hello.1.json index 426d84cb9..3df0b5df4 100644 --- a/tests/empty2/test_snapshots/test/test_hello.1.json +++ b/tests/empty2/test_snapshots/test/test_hello.1.json @@ -8,7 +8,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/errors/test_snapshots/test/hello_ok.1.json b/tests/errors/test_snapshots/test/hello_ok.1.json index 4fdb813b0..fe800858d 100644 --- a/tests/errors/test_snapshots/test/hello_ok.1.json +++ b/tests/errors/test_snapshots/test/hello_ok.1.json @@ -10,7 +10,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/errors/test_snapshots/test/try_hello_error.1.json b/tests/errors/test_snapshots/test/try_hello_error.1.json index 3d940b4d1..61f0e84d2 100644 --- a/tests/errors/test_snapshots/test/try_hello_error.1.json +++ b/tests/errors/test_snapshots/test/try_hello_error.1.json @@ -10,7 +10,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/errors/test_snapshots/test/try_hello_error_panic.1.json b/tests/errors/test_snapshots/test/try_hello_error_panic.1.json index 3d940b4d1..61f0e84d2 100644 --- a/tests/errors/test_snapshots/test/try_hello_error_panic.1.json +++ b/tests/errors/test_snapshots/test/try_hello_error_panic.1.json @@ -10,7 +10,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/errors/test_snapshots/test/try_hello_error_panic_string.1.json b/tests/errors/test_snapshots/test/try_hello_error_panic_string.1.json index 3d940b4d1..61f0e84d2 100644 --- a/tests/errors/test_snapshots/test/try_hello_error_panic_string.1.json +++ b/tests/errors/test_snapshots/test/try_hello_error_panic_string.1.json @@ -10,7 +10,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/errors/test_snapshots/test/try_hello_error_unexpected_contract_error.1.json b/tests/errors/test_snapshots/test/try_hello_error_unexpected_contract_error.1.json index 3d940b4d1..61f0e84d2 100644 --- a/tests/errors/test_snapshots/test/try_hello_error_unexpected_contract_error.1.json +++ b/tests/errors/test_snapshots/test/try_hello_error_unexpected_contract_error.1.json @@ -10,7 +10,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/errors/test_snapshots/test/try_hello_ok.1.json b/tests/errors/test_snapshots/test/try_hello_ok.1.json index 4fdb813b0..fe800858d 100644 --- a/tests/errors/test_snapshots/test/try_hello_ok.1.json +++ b/tests/errors/test_snapshots/test/try_hello_ok.1.json @@ -10,7 +10,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/events/test_snapshots/test/test_event.1.json b/tests/events/test_snapshots/test/test_event.1.json index 536678272..4158d55df 100644 --- a/tests/events/test_snapshots/test/test_event.1.json +++ b/tests/events/test_snapshots/test/test_event.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/events/test_snapshots/test/test_event_with_option_none.1.json b/tests/events/test_snapshots/test/test_event_with_option_none.1.json index f246f09a5..d67286663 100644 --- a/tests/events/test_snapshots/test/test_event_with_option_none.1.json +++ b/tests/events/test_snapshots/test/test_event_with_option_none.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/events/test_snapshots/test/test_no_events_recorded_for_failed_call.1.json b/tests/events/test_snapshots/test/test_no_events_recorded_for_failed_call.1.json index 4588d0ce6..19fc74016 100644 --- a/tests/events/test_snapshots/test/test_no_events_recorded_for_failed_call.1.json +++ b/tests/events/test_snapshots/test/test_no_events_recorded_for_failed_call.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/events_ref/test_snapshots/test/test_event.1.json b/tests/events_ref/test_snapshots/test/test_event.1.json index 536678272..4158d55df 100644 --- a/tests/events_ref/test_snapshots/test/test_event.1.json +++ b/tests/events_ref/test_snapshots/test/test_event.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/events_ref/test_snapshots/test/test_event_with_option_none.1.json b/tests/events_ref/test_snapshots/test/test_event_with_option_none.1.json index f246f09a5..d67286663 100644 --- a/tests/events_ref/test_snapshots/test/test_event_with_option_none.1.json +++ b/tests/events_ref/test_snapshots/test/test_event_with_option_none.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/events_ref/test_snapshots/test/test_no_events_recorded_for_failed_call.1.json b/tests/events_ref/test_snapshots/test/test_no_events_recorded_for_failed_call.1.json index 4588d0ce6..19fc74016 100644 --- a/tests/events_ref/test_snapshots/test/test_no_events_recorded_for_failed_call.1.json +++ b/tests/events_ref/test_snapshots/test/test_no_events_recorded_for_failed_call.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/fuzz/fuzz/Cargo.lock b/tests/fuzz/fuzz/Cargo.lock index 86507c24d..e797213cf 100644 --- a/tests/fuzz/fuzz/Cargo.lock +++ b/tests/fuzz/fuzz/Cargo.lock @@ -50,6 +50,17 @@ dependencies = [ "ark-std", ] +[[package]] +name = "ark-bn254" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a22f4561524cd949590d78d7d4c5df8f592430d221f7f3c9497bbafd8972120f" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-std", +] + [[package]] name = "ark-ec" version = "0.4.2" @@ -1120,9 +1131,8 @@ checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" [[package]] name = "soroban-builtin-sdk-macros" -version = "23.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9336adeabcd6f636a4e0889c8baf494658ef5a3c4e7e227569acd2ce9091e85" +version = "25.0.0" +source = "git+https://github.com/stellar/rs-soroban-env?rev=0a0c2df704edeb3cdafabfcc759eddccd6775337#0a0c2df704edeb3cdafabfcc759eddccd6775337" dependencies = [ "itertools", "proc-macro2", @@ -1132,9 +1142,8 @@ dependencies = [ [[package]] name = "soroban-env-common" -version = "23.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00067f52e8bbf1abf0de03fe3e2fbb06910893cfbe9a7d9093d6425658833ff3" +version = "25.0.0" +source = "git+https://github.com/stellar/rs-soroban-env?rev=0a0c2df704edeb3cdafabfcc759eddccd6775337#0a0c2df704edeb3cdafabfcc759eddccd6775337" dependencies = [ "arbitrary", "crate-git-revision", @@ -1151,9 +1160,8 @@ dependencies = [ [[package]] name = "soroban-env-guest" -version = "23.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccd1e40963517b10963a8e404348d3fe6caf9c278ac47a6effd48771297374d6" +version = "25.0.0" +source = "git+https://github.com/stellar/rs-soroban-env?rev=0a0c2df704edeb3cdafabfcc759eddccd6775337#0a0c2df704edeb3cdafabfcc759eddccd6775337" dependencies = [ "soroban-env-common", "static_assertions", @@ -1161,11 +1169,11 @@ dependencies = [ [[package]] name = "soroban-env-host" -version = "23.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9766c5ad78e9d8ae10afbc076301f7d610c16407a1ebb230766dbe007a48725" +version = "25.0.0" +source = "git+https://github.com/stellar/rs-soroban-env?rev=0a0c2df704edeb3cdafabfcc759eddccd6775337#0a0c2df704edeb3cdafabfcc759eddccd6775337" dependencies = [ "ark-bls12-381", + "ark-bn254", "ark-ec", "ark-ff", "ark-serialize", @@ -1197,9 +1205,8 @@ dependencies = [ [[package]] name = "soroban-env-macros" -version = "23.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0e6a1c5844257ce96f5f54ef976035d5bd0ee6edefaf9f5e0bcb8ea4b34228c" +version = "25.0.0" +source = "git+https://github.com/stellar/rs-soroban-env?rev=0a0c2df704edeb3cdafabfcc759eddccd6775337#0a0c2df704edeb3cdafabfcc759eddccd6775337" dependencies = [ "itertools", "proc-macro2", @@ -1288,8 +1295,7 @@ dependencies = [ [[package]] name = "soroban-wasmi" version = "0.31.1-soroban.20.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "710403de32d0e0c35375518cb995d4fc056d0d48966f2e56ea471b8cb8fc9719" +source = "git+https://github.com/stellar/wasmi?rev=0ed3f3dee30dc41ebe21972399e0a73a41944aa0#0ed3f3dee30dc41ebe21972399e0a73a41944aa0" dependencies = [ "smallvec", "spin", @@ -1332,9 +1338,8 @@ dependencies = [ [[package]] name = "stellar-xdr" -version = "23.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d2848e1694b0c8db81fd812bfab5ea71ee28073e09ccc45620ef3cf7a75a9b" +version = "24.0.1" +source = "git+https://github.com/stellar/rs-stellar-xdr?rev=89cc1cbadf1b9a16843826954dede7fec514d8e7#89cc1cbadf1b9a16843826954dede7fec514d8e7" dependencies = [ "arbitrary", "base64", @@ -1530,15 +1535,13 @@ checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "wasmi_arena" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "104a7f73be44570cac297b3035d76b169d6599637631cf37a1703326a0727073" +version = "0.4.0" +source = "git+https://github.com/stellar/wasmi?rev=0ed3f3dee30dc41ebe21972399e0a73a41944aa0#0ed3f3dee30dc41ebe21972399e0a73a41944aa0" [[package]] name = "wasmi_core" version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf1a7db34bff95b85c261002720c00c3a6168256dcb93041d3fa2054d19856a" +source = "git+https://github.com/stellar/wasmi?rev=0ed3f3dee30dc41ebe21972399e0a73a41944aa0#0ed3f3dee30dc41ebe21972399e0a73a41944aa0" dependencies = [ "downcast-rs", "libm", diff --git a/tests/generics/test_snapshots/test/test_hello.1.json b/tests/generics/test_snapshots/test/test_hello.1.json index 6a19fbf66..72bea1158 100644 --- a/tests/generics/test_snapshots/test/test_hello.1.json +++ b/tests/generics/test_snapshots/test/test_hello.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/invoke_contract/test_snapshots/test/test_add.1.json b/tests/invoke_contract/test_snapshots/test/test_add.1.json index e35171bbe..f3e5c5600 100644 --- a/tests/invoke_contract/test_snapshots/test/test_add.1.json +++ b/tests/invoke_contract/test_snapshots/test/test_add.1.json @@ -10,7 +10,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/logging/test_snapshots/test/test_logging.1.json b/tests/logging/test_snapshots/test/test_logging.1.json index 6a19fbf66..72bea1158 100644 --- a/tests/logging/test_snapshots/test/test_logging.1.json +++ b/tests/logging/test_snapshots/test/test_logging.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/macros/test_snapshots/test/test_empty.1.json b/tests/macros/test_snapshots/test/test_empty.1.json index 6a19fbf66..72bea1158 100644 --- a/tests/macros/test_snapshots/test/test_empty.1.json +++ b/tests/macros/test_snapshots/test/test_empty.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/modular/test_snapshots/test/test.1.json b/tests/modular/test_snapshots/test/test.1.json index 721d018c4..b527a7198 100644 --- a/tests/modular/test_snapshots/test/test.1.json +++ b/tests/modular/test_snapshots/test/test.1.json @@ -11,7 +11,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/multiimpl/test_snapshots/test/test_hello.1.json b/tests/multiimpl/test_snapshots/test/test_hello.1.json index 721d018c4..b527a7198 100644 --- a/tests/multiimpl/test_snapshots/test/test_hello.1.json +++ b/tests/multiimpl/test_snapshots/test/test_hello.1.json @@ -11,7 +11,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/mutability/test_snapshots/test/test_calc.1.json b/tests/mutability/test_snapshots/test/test_calc.1.json index 6a19fbf66..72bea1158 100644 --- a/tests/mutability/test_snapshots/test/test_calc.1.json +++ b/tests/mutability/test_snapshots/test/test_calc.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/udt/test_snapshots/test/test_add.1.json b/tests/udt/test_snapshots/test/test_add.1.json index 3d940b4d1..61f0e84d2 100644 --- a/tests/udt/test_snapshots/test/test_add.1.json +++ b/tests/udt/test_snapshots/test/test_add.1.json @@ -10,7 +10,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/workspace_contract/test_snapshots/test/test_add.1.json b/tests/workspace_contract/test_snapshots/test/test_add.1.json index 6a19fbf66..72bea1158 100644 --- a/tests/workspace_contract/test_snapshots/test/test_add.1.json +++ b/tests/workspace_contract/test_snapshots/test/test_add.1.json @@ -9,7 +9,7 @@ [] ], "ledger": { - "protocol_version": 23, + "protocol_version": 25, "sequence_number": 0, "timestamp": 0, "network_id": "0000000000000000000000000000000000000000000000000000000000000000",