diff --git a/Cargo.lock b/Cargo.lock index 01a6e39c..f5fccae5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -269,17 +269,18 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chia" -version = "0.13.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b730bab32685f98520fff23181dd17965ef62eb37b2cf4ec749614d2e5a10be4" +checksum = "f9d1d96346b44725c95fb4e504b265879b8bdced1b2746aa377eb594ee066452" dependencies = [ - "chia-bls 0.13.0", + "chia-bls 0.15.0", "chia-client", "chia-consensus", "chia-protocol", "chia-puzzles", + "chia-sha2", "chia-ssl", - "chia-traits 0.11.0", + "chia-traits 0.15.0", "clvm-traits", "clvm-utils", "clvmr", @@ -303,14 +304,13 @@ dependencies = [ [[package]] name = "chia-bls" -version = "0.13.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "281de3426c8abee22bb0aac614ced4ca143f148071dfe10c11f78b5da918ed0b" +checksum = "53dea95bd7dac1e69c59ef6839ecf30ff3fe29170c16c4aa00093be21e0d789e" dependencies = [ - "anyhow", "blst", - "chia-traits 0.11.0", - "clvmr", + "chia-sha2", + "chia-traits 0.15.0", "hex", "hkdf", "lru", @@ -320,12 +320,12 @@ dependencies = [ [[package]] name = "chia-client" -version = "0.13.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f5234e4b1d3c34a00a2764f7779279ef3c362c0610be8fda708b1903065f6c6" +checksum = "3fe257396261b38853dcd0b8e0d9daf9fd8f4f67609657c92e6d99ace7103dd8" dependencies = [ "chia-protocol", - "chia-traits 0.11.0", + "chia-traits 0.15.0", "futures-util", "thiserror", "tokio", @@ -335,16 +335,16 @@ dependencies = [ [[package]] name = "chia-consensus" -version = "0.13.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddc7b4621512c9d00d9199b42431eface49efbbf9b0f7d576c771a359c5684ec" +checksum = "b090eecc39c8ad7db68dd77a753e75bea4945c237cb85528719525b0e063c99f" dependencies = [ - "chia-bls 0.13.0", + "chia-bls 0.15.0", "chia-protocol", "chia-puzzles", - "chia-traits 0.11.0", - "chia_streamable_macro 0.11.0", - "clvm-derive", + "chia-sha2", + "chia-traits 0.15.0", + "chia_streamable_macro 0.15.0", "clvm-traits", "clvm-utils", "clvmr", @@ -355,13 +355,14 @@ dependencies = [ [[package]] name = "chia-protocol" -version = "0.13.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88e5dd3701f0655b50d14b9a85012d29bc35398ec017e54721c8ac13255ad65a" +checksum = "0bc9ed4c5ce38d14f0e00f4814c37692c2f43b184df632bf168dfadcb2d5b7dc" dependencies = [ - "chia-bls 0.13.0", - "chia-traits 0.11.0", - "chia_streamable_macro 0.11.0", + "chia-bls 0.15.0", + "chia-sha2", + "chia-traits 0.15.0", + "chia_streamable_macro 0.15.0", "clvm-traits", "clvm-utils", "clvmr", @@ -370,12 +371,13 @@ dependencies = [ [[package]] name = "chia-puzzles" -version = "0.13.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3237073f8bd068bc0ea78399725bb09ac198b25664baf9e6a93a3858108a3ff3" +checksum = "a935f5a32dbc162859b4789c5512ac267340dd8595cdb9709292bec2cb9ea4f3" dependencies = [ - "chia-bls 0.13.0", + "chia-bls 0.15.0", "chia-protocol", + "chia-sha2", "clvm-traits", "clvm-utils", "clvmr", @@ -390,7 +392,7 @@ dependencies = [ "chia-protocol", "chia-sdk-types", "chia-ssl", - "chia-traits 0.11.0", + "chia-traits 0.15.0", "futures-util", "native-tls", "rustls", @@ -416,10 +418,11 @@ name = "chia-sdk-driver" version = "0.16.0" dependencies = [ "anyhow", - "chia-bls 0.13.0", + "chia-bls 0.15.0", "chia-consensus", "chia-protocol", "chia-puzzles", + "chia-sdk-signer", "chia-sdk-test", "chia-sdk-types", "clvm-traits", @@ -438,13 +441,13 @@ version = "0.16.0" dependencies = [ "anyhow", "bech32", - "chia-bls 0.13.0", + "chia-bls 0.15.0", "chia-protocol", "chia-puzzles", "chia-sdk-driver", "chia-sdk-test", "chia-sdk-types", - "chia-traits 0.11.0", + "chia-traits 0.15.0", "clvm-traits", "clvm-utils", "clvmr", @@ -460,7 +463,7 @@ dependencies = [ name = "chia-sdk-signer" version = "0.16.0" dependencies = [ - "chia-bls 0.13.0", + "chia-bls 0.15.0", "chia-consensus", "chia-protocol", "chia-puzzles", @@ -478,14 +481,14 @@ version = "0.16.0" dependencies = [ "anyhow", "bip39", - "chia-bls 0.13.0", + "chia-bls 0.15.0", "chia-consensus", "chia-protocol", "chia-puzzles", "chia-sdk-client", "chia-sdk-signer", "chia-sdk-types", - "chia-traits 0.11.0", + "chia-traits 0.15.0", "clvm-traits", "clvm-utils", "clvmr", @@ -507,7 +510,7 @@ name = "chia-sdk-types" version = "0.16.0" dependencies = [ "anyhow", - "chia-bls 0.13.0", + "chia-bls 0.15.0", "chia-consensus", "chia-protocol", "chia-sdk-derive", @@ -518,6 +521,15 @@ dependencies = [ "once_cell", ] +[[package]] +name = "chia-sha2" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7020f53eeae8b4c24c5666165738173a167c6478e0c0a9e1c428a491a2e1383d" +dependencies = [ + "sha2", +] + [[package]] name = "chia-ssl" version = "0.11.0" @@ -545,12 +557,12 @@ dependencies = [ [[package]] name = "chia-traits" -version = "0.11.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d677fcdf166a855ddc1f5e6a0e3dfa0bd7e823d24a82198e79400dbacb1a503" +checksum = "e57bbde886b38a9a5df185e751d90e295d14e99659bf43df7fa701d52d4da1ea" dependencies = [ - "chia_streamable_macro 0.11.0", - "clvmr", + "chia-sha2", + "chia_streamable_macro 0.15.0", "thiserror", ] @@ -560,7 +572,7 @@ version = "0.16.0" dependencies = [ "anyhow", "bech32", - "chia-bls 0.13.0", + "chia-bls 0.15.0", "chia-protocol", "chia-puzzles", "chia-sdk-client", @@ -608,11 +620,10 @@ dependencies = [ [[package]] name = "chia_streamable_macro" -version = "0.11.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e4fde91c96e99445cca016635bc4830a302e8366c238d87b8a4213c16abb270" +checksum = "00e78b5981952d2383b08344fdc6e6f843e72cc9d502d46d1d2824c485b34694" dependencies = [ - "clvmr", "proc-macro-crate 1.3.1", "proc-macro2", "quote", @@ -643,11 +654,11 @@ dependencies = [ [[package]] name = "clvm-traits" -version = "0.13.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e46a5ec963484ea2cb2a450691b80cf7db1d3fca4192120a2606026a261e73e" +checksum = "a57904e25f33decdbcd778857c3eb1eb65470528dcccb39b1e3f06f32aa6097c" dependencies = [ - "chia-bls 0.13.0", + "chia-bls 0.15.0", "clvm-derive", "clvmr", "num-bigint", @@ -656,10 +667,11 @@ dependencies = [ [[package]] name = "clvm-utils" -version = "0.13.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dfb6b76affa69bdf036fef6da3dbefb4feedc2db37cc6341b02c935c94c0d0a" +checksum = "0370210160017106e9d9c8f5620a9a48295da5430536ea0ce6c58d954aa39f6e" dependencies = [ + "chia-sha2", "clvm-traits", "clvmr", "hex", @@ -667,9 +679,9 @@ dependencies = [ [[package]] name = "clvmr" -version = "0.8.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "903233f3bc9392b44a589f0cea46a53a67fedc3afb4b1303f636977074a505c5" +checksum = "cd48d84ed6eac4638131341402f30476c9f6c6970ed3ed6984bdf125c5a09538" dependencies = [ "chia-bls 0.10.0", "hex-literal", @@ -1227,9 +1239,9 @@ dependencies = [ [[package]] name = "k256" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" +checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" dependencies = [ "cfg-if", "ecdsa", diff --git a/Cargo.toml b/Cargo.toml index 14637277..b8f5845a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -95,16 +95,16 @@ chia-sdk-offers = { version = "0.16.0", path = "./crates/chia-sdk-offers" } chia-sdk-signer = { version = "0.16.0", path = "./crates/chia-sdk-signer" } chia-sdk-test = { version = "0.16.0", path = "./crates/chia-sdk-test" } chia-sdk-types = { version = "0.16.0", path = "./crates/chia-sdk-types" } -chia = "0.13.0" +chia = "0.15.0" chia-ssl = "0.11.0" -chia-protocol = "0.13.0" -chia-consensus = "0.13.0" -chia-traits = "0.11.0" -chia-bls = "0.13.0" -chia-puzzles = "0.13.0" -clvm-traits = "0.13.0" -clvm-utils = "0.13.0" -clvmr = "0.8.0" +chia-protocol = "0.15.0" +chia-consensus = "0.15.0" +chia-traits = "0.15.0" +chia-bls = "0.15.0" +chia-puzzles = "0.15.0" +clvm-traits = "0.15.0" +clvm-utils = "0.15.0" +clvmr = "0.9.0" thiserror = "1.0.61" hex = "0.4.3" bech32 = "0.9.1" diff --git a/crates/chia-sdk-driver/Cargo.toml b/crates/chia-sdk-driver/Cargo.toml index f9cf383b..a82e5549 100644 --- a/crates/chia-sdk-driver/Cargo.toml +++ b/crates/chia-sdk-driver/Cargo.toml @@ -35,6 +35,7 @@ hex = { workspace = true } [dev-dependencies] chia-sdk-test = { workspace = true } +chia-sdk-signer = { workspace = true } anyhow = { workspace = true } chia-consensus = { workspace = true } hex = { workspace = true } diff --git a/crates/chia-sdk-driver/src/primitives/nft/nft_launcher.rs b/crates/chia-sdk-driver/src/primitives/nft/nft_launcher.rs index d5d51eb8..f43abb84 100644 --- a/crates/chia-sdk-driver/src/primitives/nft/nft_launcher.rs +++ b/crates/chia-sdk-driver/src/primitives/nft/nft_launcher.rs @@ -110,13 +110,11 @@ mod tests { use super::*; - use chia_consensus::gen::{ - conditions::EmptyVisitor, run_block_generator::run_block_generator, - solution_generator::solution_generator, - }; - use chia_protocol::Coin; + use chia_consensus::spendbundle_conditions::get_conditions_from_spendbundle; + use chia_protocol::{Coin, SpendBundle}; use chia_puzzles::{nft::NftMetadata, standard::StandardArgs}; - use chia_sdk_test::{test_secret_key, Simulator}; + use chia_sdk_signer::AggSigConstants; + use chia_sdk_test::{sign_transaction, test_secret_key, Simulator}; use chia_sdk_types::{announcement_id, TESTNET11_CONSTANTS}; #[test] @@ -157,22 +155,22 @@ mod tests { )?; let coin_spends = ctx.take(); - - let generator = solution_generator( - coin_spends - .iter() - .map(|cs| (cs.coin, cs.puzzle_reveal.clone(), cs.solution.clone())), + let signature = sign_transaction( + &coin_spends, + &[sk], + &AggSigConstants::new(TESTNET11_CONSTANTS.agg_sig_me_additional_data), )?; - let conds = run_block_generator::, EmptyVisitor, _>( + let spend_bundle = SpendBundle::new(coin_spends, signature); + + let conds = get_conditions_from_spendbundle( &mut ctx.allocator, - &generator, - [], - 11_000_000_000, - 0, + &spend_bundle, + u64::MAX, + 100_000_000, &TESTNET11_CONSTANTS, )?; - assert_eq!(conds.cost, 119_613_445); + assert_eq!(conds.cost, 109_517_025); Ok(()) } diff --git a/napi/src/clvm.rs b/napi/src/clvm.rs index d1f7fef8..2597f0c8 100644 --- a/napi/src/clvm.rs +++ b/napi/src/clvm.rs @@ -19,7 +19,7 @@ use chia_wallet_sdk::{ use clvmr::{ run_program, serde::{node_from_bytes, node_from_bytes_backrefs}, - ChiaDialect, NodePtr, ENABLE_BLS_OPS_OUTSIDE_GUARD, ENABLE_FIXED_DIV, MEMPOOL_MODE, + ChiaDialect, NodePtr, MEMPOOL_MODE, }; use napi::bindgen_prelude::*; @@ -79,7 +79,7 @@ impl ClvmAllocator { max_cost: BigInt, mempool_mode: bool, ) -> Result { - let mut flags = ENABLE_BLS_OPS_OUTSIDE_GUARD | ENABLE_FIXED_DIV; + let mut flags = 0; if mempool_mode { flags |= MEMPOOL_MODE;