From 48fc0e4c00f7e2454b0f593278be1fc87ee2775b Mon Sep 17 00:00:00 2001 From: Siddharth Suresh Date: Thu, 15 Aug 2024 13:39:58 -0700 Subject: [PATCH] Fix event comment (#1315) ### What Context - https://github.com/stellar/stellar-protocol/pull/1522 The second commit for unwrap.rs is required due to https://github.com/rust-lang/rust/issues/129031. --- soroban-sdk/src/token.rs | 18 ++++++------ soroban-sdk/src/unwrap.rs | 3 ++ tests/fuzz/fuzz/Cargo.lock | 58 ++++++++++++++++++++++---------------- 3 files changed, 46 insertions(+), 33 deletions(-) diff --git a/soroban-sdk/src/token.rs b/soroban-sdk/src/token.rs index 4d7e64edc..37626e81f 100644 --- a/soroban-sdk/src/token.rs +++ b/soroban-sdk/src/token.rs @@ -140,7 +140,7 @@ pub trait TokenInterface { /// # Events /// /// Emits an event with topics `["transfer", from: Address, to: Address], - /// data = [amount: i128]` + /// data = amount: i128` fn transfer(env: Env, from: Address, to: Address, amount: i128); /// Transfer `amount` from `from` to `to`, consuming the allowance that @@ -164,7 +164,7 @@ pub trait TokenInterface { /// # Events /// /// Emits an event with topics `["transfer", from: Address, to: Address], - /// data = [amount: i128]` + /// data = amount: i128` fn transfer_from(env: Env, spender: Address, from: Address, to: Address, amount: i128); /// Burn `amount` from `from`. @@ -180,8 +180,8 @@ pub trait TokenInterface { /// /// # Events /// - /// Emits an event with topics `["burn", from: Address], data = [amount: - /// i128]` + /// Emits an event with topics `["burn", from: Address], data = amount: + /// i128` fn burn(env: Env, from: Address, amount: i128); /// Burn `amount` from `from`, consuming the allowance of `spender`. @@ -204,8 +204,8 @@ pub trait TokenInterface { /// /// # Events /// - /// Emits an event with topics `["burn", from: Address], data = [amount: - /// i128]` + /// Emits an event with topics `["burn", from: Address], data = amount: + /// i128` fn burn_from(env: Env, spender: Address, from: Address, amount: i128); /// Returns the number of decimals used to represent amounts of this token. @@ -286,7 +286,7 @@ pub trait StellarAssetInterface { /// # Events /// /// Emits an event with topics `["mint", admin: Address, to: Address], data - /// = [amount: i128]` + /// = amount: i128` fn mint(env: Env, to: Address, amount: i128); /// Clawback `amount` from `from` account. `amount` is burned in the @@ -301,7 +301,7 @@ pub trait StellarAssetInterface { /// # Events /// /// Emits an event with topics `["clawback", admin: Address, to: Address], - /// data = [amount: i128]` + /// data = amount: i128` fn clawback(env: Env, from: Address, amount: i128); } @@ -330,7 +330,7 @@ pub(crate) const SPEC_XDR_INPUT: &[&[u8]] = &[ &StellarAssetSpec::spec_xdr_transfer_from(), ]; -pub(crate) const SPEC_XDR_LEN: usize = 6460; +pub(crate) const SPEC_XDR_LEN: usize = 6456; impl StellarAssetSpec { /// Returns the XDR spec for the Token contract. diff --git a/soroban-sdk/src/unwrap.rs b/soroban-sdk/src/unwrap.rs index 52b03854c..102bbf165 100644 --- a/soroban-sdk/src/unwrap.rs +++ b/soroban-sdk/src/unwrap.rs @@ -64,6 +64,9 @@ impl UnwrapInfallible for Result { // destructuring the `never` variable into an empty set of cases is // the most honest since it's statically checked to _be_ infallible, // not just an assertion of our hopes.) + + // This allow and the Err can be removed once 1.82 becomes stable + #[allow(unreachable_patterns)] Err(never) => match never {}, } } diff --git a/tests/fuzz/fuzz/Cargo.lock b/tests/fuzz/fuzz/Cargo.lock index eb271c87f..d108f1c43 100644 --- a/tests/fuzz/fuzz/Cargo.lock +++ b/tests/fuzz/fuzz/Cargo.lock @@ -338,15 +338,16 @@ dependencies = [ [[package]] name = "ed25519-dalek" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7277392b266383ef8396db7fdeb1e77b6c52fed775f5df15bb24f35b72156980" +checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" dependencies = [ "curve25519-dalek", "ed25519", "rand_core", "serde", "sha2", + "subtle", "zeroize", ] @@ -959,8 +960,9 @@ checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" [[package]] name = "soroban-builtin-sdk-macros" -version = "20.3.0" -source = "git+https://github.com/stellar/rs-soroban-env?rev=a8c713db03ba5ebfdc4786b73dcba00284e15dbe#a8c713db03ba5ebfdc4786b73dcba00284e15dbe" +version = "21.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44877373b3dc6c662377cb1600e3a62706d75e484b6064f9cd22e467c676b159" dependencies = [ "itertools", "proc-macro2", @@ -970,8 +972,9 @@ dependencies = [ [[package]] name = "soroban-env-common" -version = "20.3.0" -source = "git+https://github.com/stellar/rs-soroban-env?rev=a8c713db03ba5ebfdc4786b73dcba00284e15dbe#a8c713db03ba5ebfdc4786b73dcba00284e15dbe" +version = "21.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "590add16843a61b01844e19e89bccaaee6aa21dc76809017b0662c17dc139ee9" dependencies = [ "arbitrary", "crate-git-revision", @@ -988,8 +991,9 @@ dependencies = [ [[package]] name = "soroban-env-guest" -version = "20.3.0" -source = "git+https://github.com/stellar/rs-soroban-env?rev=a8c713db03ba5ebfdc4786b73dcba00284e15dbe#a8c713db03ba5ebfdc4786b73dcba00284e15dbe" +version = "21.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05ec8dc43acdd6c7e7b371acf44fc1a7dac24934ae3b2f05fafd618818548176" dependencies = [ "soroban-env-common", "static_assertions", @@ -997,8 +1001,9 @@ dependencies = [ [[package]] name = "soroban-env-host" -version = "20.3.0" -source = "git+https://github.com/stellar/rs-soroban-env?rev=a8c713db03ba5ebfdc4786b73dcba00284e15dbe#a8c713db03ba5ebfdc4786b73dcba00284e15dbe" +version = "21.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e25aaffe0c62eb65e0e349f725b4b8b13ad0764d78a15aab5bbccb5c4797726" dependencies = [ "backtrace", "curve25519-dalek", @@ -1029,8 +1034,9 @@ dependencies = [ [[package]] name = "soroban-env-macros" -version = "20.3.0" -source = "git+https://github.com/stellar/rs-soroban-env?rev=a8c713db03ba5ebfdc4786b73dcba00284e15dbe#a8c713db03ba5ebfdc4786b73dcba00284e15dbe" +version = "21.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e16b761459fdf3c4b62b24df3941498d14e5246e6fadfb4774ed8114d243aa4" dependencies = [ "itertools", "proc-macro2", @@ -1043,7 +1049,7 @@ dependencies = [ [[package]] name = "soroban-ledger-snapshot" -version = "20.5.0" +version = "21.5.0" dependencies = [ "serde", "serde_json", @@ -1055,7 +1061,7 @@ dependencies = [ [[package]] name = "soroban-sdk" -version = "20.5.0" +version = "21.5.0" dependencies = [ "arbitrary", "bytes-lit", @@ -1073,7 +1079,7 @@ dependencies = [ [[package]] name = "soroban-sdk-macros" -version = "20.5.0" +version = "21.5.0" dependencies = [ "crate-git-revision", "darling", @@ -1091,7 +1097,7 @@ dependencies = [ [[package]] name = "soroban-spec" -version = "20.5.0" +version = "21.5.0" dependencies = [ "base64 0.13.1", "stellar-xdr", @@ -1101,7 +1107,7 @@ dependencies = [ [[package]] name = "soroban-spec-rust" -version = "20.5.0" +version = "21.5.0" dependencies = [ "prettyplease", "proc-macro2", @@ -1116,7 +1122,8 @@ dependencies = [ [[package]] name = "soroban-wasmi" version = "0.31.1-soroban.20.0.1" -source = "git+https://github.com/stellar/wasmi?rev=0ed3f3dee30dc41ebe21972399e0a73a41944aa0#0ed3f3dee30dc41ebe21972399e0a73a41944aa0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "710403de32d0e0c35375518cb995d4fc056d0d48966f2e56ea471b8cb8fc9719" dependencies = [ "smallvec", "spin", @@ -1160,8 +1167,9 @@ dependencies = [ [[package]] name = "stellar-xdr" -version = "20.1.0" -source = "git+https://github.com/stellar/rs-stellar-xdr?rev=3a001b1fbb20e4cfa2cef2c0cc450564e8528057#3a001b1fbb20e4cfa2cef2c0cc450564e8528057" +version = "21.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2675a71212ed39a806e415b0dbf4702879ff288ec7f5ee996dda42a135512b50" dependencies = [ "arbitrary", "base64 0.13.1", @@ -1198,7 +1206,7 @@ dependencies = [ [[package]] name = "test_fuzz" -version = "20.5.0" +version = "21.5.0" dependencies = [ "soroban-sdk", ] @@ -1339,13 +1347,15 @@ checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "wasmi_arena" -version = "0.4.0" -source = "git+https://github.com/stellar/wasmi?rev=0ed3f3dee30dc41ebe21972399e0a73a41944aa0#0ed3f3dee30dc41ebe21972399e0a73a41944aa0" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "104a7f73be44570cac297b3035d76b169d6599637631cf37a1703326a0727073" [[package]] name = "wasmi_core" version = "0.13.0" -source = "git+https://github.com/stellar/wasmi?rev=0ed3f3dee30dc41ebe21972399e0a73a41944aa0#0ed3f3dee30dc41ebe21972399e0a73a41944aa0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf1a7db34bff95b85c261002720c00c3a6168256dcb93041d3fa2054d19856a" dependencies = [ "downcast-rs", "libm",