Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump missing versions, update clvmr, add traits and impls back #384

Merged
merged 2 commits into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ repository = "https://github.com/Chia-Network/chia_rs/"
py-bindings = ["dep:pyo3"]

[dependencies]
clvmr = "0.4.0"
clvmr = "0.5.0"
hex = "0.4.3"
pyo3 = { version = ">=0.19.0", optional = true }
clvm-utils = { version = "0.4.0", path = "clvm-utils" }
clvm-utils = { version = "0.5.0", path = "clvm-utils" }
chia-traits = { version = "0.5.0", path = "chia-traits" }
clvm-traits = { version = "0.3.3", path = "clvm-traits" }
clvm-traits = { version = "0.5.0", path = "clvm-traits" }
clvm-derive = { version = "0.2.14", path = "clvm-derive" }
chia-protocol = { version = "0.5.0", path = "chia-protocol" }
chia-wallet = { version = "0.5.0", path = "chia-wallet" }
Expand Down
2 changes: 1 addition & 1 deletion chia-bls/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "chia-bls"
version = "0.4.0"
version = "0.5.0"
edition = "2021"
license = "Apache-2.0"
description = "BLS signature, verification and aggregation funcions for the Chia blockchain"
Expand Down
2 changes: 1 addition & 1 deletion chia-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "chia-client"
version = "0.4.0"
version = "0.5.0"
edition = "2021"
license = "Apache-2.0"
description = "Chia light client and async peer connections."
Expand Down
8 changes: 4 additions & 4 deletions chia-protocol/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ sha2 = "0.10.8"
hex = "0.4.3"
chia_streamable_macro = { version = "0.3.0", path = "../chia_streamable_macro" }
chia_py_streamable_macro = { version = "0.5.0", path = "../chia_py_streamable_macro", optional = true }
clvmr = "0.4.0"
clvmr = "0.5.0"
chia-traits = { version = "0.5.0", path = "../chia-traits" }
clvm-traits = { version = "0.3.3", path = "../clvm-traits", features = ["derive"] }
clvm-utils = { version = "0.4.0", path = "../clvm-utils" }
chia-bls = { version = "0.4.0", path = "../chia-bls" }
clvm-traits = { version = "0.5.0", path = "../clvm-traits", features = ["derive"] }
clvm-utils = { version = "0.5.0", path = "../clvm-utils" }
chia-bls = { version = "0.5.0", path = "../chia-bls" }
arbitrary = { version = "1.3.0", features = ["derive"] }

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion chia-protocol/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ cargo-fuzz = true

[dependencies]
libfuzzer-sys = "0.4"
clvmr = "0.4.0"
clvmr = "0.5.0"
chia-traits = { path = "../../chia-traits" }
clvm-traits = { path = "../../clvm-traits" }
arbitrary = { version = "=1.3.0" }
Expand Down
6 changes: 3 additions & 3 deletions chia-protocol/src/program.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::bytes::Bytes;
use chia_traits::chia_error::{Error, Result};
use chia_traits::Streamable;
use clvm_traits::{FromClvmError, ToClvmError};
use clvm_traits::{FromClvmError, FromNodePtr, ToClvmError, ToNodePtr};
use clvmr::allocator::NodePtr;
use clvmr::cost::Cost;
use clvmr::reduction::EvalErr;
Expand All @@ -10,7 +10,7 @@ use clvmr::serde::{
node_from_bytes, node_from_bytes_backrefs, node_to_bytes, serialized_length_from_bytes,
serialized_length_from_bytes_trusted,
};
use clvmr::{Allocator, ChiaDialect, FromNodePtr, ToNodePtr};
use clvmr::{Allocator, ChiaDialect};
use sha2::{Digest, Sha256};
use std::io::Cursor;
use std::ops::Deref;
Expand Down Expand Up @@ -440,7 +440,7 @@ impl Program {
<(
clvm_traits::MatchByte<4>,
(clvm_traits::match_quote!(NodePtr), (NodePtr, ())),
) as clvmr::FromNodePtr>::from_node_ptr(&a, args)
) as clvm_traits::FromNodePtr>::from_node_ptr(&a, args)
.map_err(|error| PyErr::new::<PyTypeError, _>(error.to_string()))?;
curried_args.push(arg);
args = rest;
Expand Down
14 changes: 7 additions & 7 deletions chia-tools/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ homepage = "https://github.com/Chia-Network/chia_rs/chia-tools"
repository = "https://github.com/Chia-Network/chia_rs/chia-tools"

[dependencies]
chia-protocol = { version = "0.5.0", path = "../chia-protocol" }
chia-traits = { path = "../chia-traits" }
clvm-utils = { path = "../clvm-utils" }
clvm-traits = { version = "=0.3.3", path = "../clvm-traits" }
chia-protocol = { version = "=0.5.0", path = "../chia-protocol" }
chia-traits = { version = "=0.5.0", path = "../chia-traits" }
clvm-utils = { version = "=0.5.0", path = "../clvm-utils" }
Rigidity marked this conversation as resolved.
Show resolved Hide resolved
clvm-traits = { version = "=0.5.0", path = "../clvm-traits" }
chia-wallet = { version = "=0.5.0", path = "../chia-wallet" }
chia-bls = { version = "0.4.0", path = "../chia-bls" }
clvmr = { version = "0.4.0", features = ["counters"] }
chia = { version = "0.5.0", path = ".." }
chia-bls = { version = "=0.5.0", path = "../chia-bls" }
clvmr = { version = "0.5.0", features = ["counters"] }
chia = { version = "=0.5.0", path = ".." }
rusqlite = { version = "=0.30.0", features = ["bundled"] }
clap = { version = "=4.3.9", features = ["derive"] }
zstd = "=0.12.3"
Expand Down
2 changes: 1 addition & 1 deletion chia-tools/src/bin/fast-forward-spend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ use chia::fast_forward::fast_forward_singleton;
use chia_protocol::bytes::Bytes32;
use chia_protocol::{coin::Coin, coin_spend::CoinSpend, program::Program};
use chia_traits::streamable::Streamable;
use clvm_traits::{FromNodePtr, ToNodePtr};
use clvm_utils::tree_hash;
use clvmr::allocator::Allocator;
use clvmr::{FromNodePtr, ToNodePtr};

#[derive(Parser, Debug)]
#[command(author, version, about, long_about = None)]
Expand Down
4 changes: 2 additions & 2 deletions chia-tools/src/bin/gen-corpus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ use chia_traits::streamable::Streamable;

use chia_protocol::{Bytes32, Coin, CoinSpend, Program, SpendBundle};
use chia_wallet::singleton::SINGLETON_TOP_LAYER_PUZZLE_HASH;
use clvm_traits::FromClvm;
use clvm_traits::{FromClvm, FromNodePtr};
use clvm_utils::{tree_hash, CurriedProgram};
use clvmr::allocator::NodePtr;
use clvmr::{Allocator, FromNodePtr};
use clvmr::Allocator;
use std::thread::available_parallelism;
use threadpool::ThreadPool;

Expand Down
3 changes: 1 addition & 2 deletions chia-tools/src/bin/run-spend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ use chia::gen::conditions::Condition;
use chia_protocol::Bytes32;
use chia_traits::Streamable;
use clap::Parser;
use clvm_traits::{FromClvm, ToClvm};
use clvm_traits::{FromClvm, ToClvm, ToNodePtr};
use clvm_utils::tree_hash;
use clvm_utils::CurriedProgram;
use clvmr::ToNodePtr;
use clvmr::{allocator::NodePtr, Allocator};
use hex_literal::hex;

Expand Down
8 changes: 4 additions & 4 deletions chia-wallet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ homepage = "https://github.com/Chia-Network/chia_rs/chia-wallet/"
repository = "https://github.com/Chia-Network/chia_rs/chia-wallet/"

[dependencies]
clvmr = "0.4.0"
clvmr = "0.5.0"
sha2 = "0.10.8"
num-bigint = "0.4.3"
hex-literal = "0.4.1"
clvm-utils = { version = "0.4.0", path = "../clvm-utils" }
clvm-traits = { version = "0.3.3", path = "../clvm-traits", features = ["chia-bls"] }
chia-bls = { version = "0.4.0", path = "../chia-bls" }
clvm-utils = { version = "0.5.0", path = "../clvm-utils" }
clvm-traits = { version = "0.5.0", path = "../clvm-traits", features = ["chia-bls"] }
chia-bls = { version = "0.5.0", path = "../chia-bls" }
chia-protocol = { version = "0.5.0", path = "../chia-protocol" }
arbitrary = "1.3.0"

Expand Down
6 changes: 3 additions & 3 deletions chia-wallet/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "chia-wallet-fuzz"
version = "0.4.0"
version = "0.5.0"
authors = ["Automatically generated"]
publish = false
edition = "2021"
Expand All @@ -10,10 +10,10 @@ cargo-fuzz = true

[dependencies]
libfuzzer-sys = "0.4"
clvmr = "0.4.0"
clvmr = "0.5.0"
pyo3 = { version = ">=0.19.0", features = ["auto-initialize"]}
chia-wallet = { path = ".." }
clvm-traits = { version = "=0.3.3", path = "../../clvm-traits" }
clvm-traits = { version = "=0.5.0", path = "../../clvm-traits" }

[[bin]]
name = "roundtrip"
Expand Down
3 changes: 2 additions & 1 deletion chia-wallet/src/puzzles/cat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,9 @@ pub static CAT_PUZZLE_HASH_V1: [u8; 32] = hex!(

#[cfg(test)]
mod tests {
use clvm_traits::ToNodePtr;
use clvm_utils::{tree_hash, CurriedProgram};
use clvmr::{serde::node_from_bytes, Allocator, ToNodePtr};
use clvmr::{serde::node_from_bytes, Allocator};

use super::*;

Expand Down
3 changes: 2 additions & 1 deletion chia-wallet/src/puzzles/standard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ pub static DEFAULT_HIDDEN_PUZZLE_HASH: [u8; 32] = hex!(

#[cfg(test)]
mod tests {
use clvm_traits::ToNodePtr;
use clvm_utils::{tree_hash, CurriedProgram};
use clvmr::{serde::node_from_bytes, Allocator, ToNodePtr};
use clvmr::{serde::node_from_bytes, Allocator};

use super::*;

Expand Down
5 changes: 3 additions & 2 deletions clvm-traits/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "clvm-traits"
version = "0.3.3"
version = "0.5.0"
edition = "2021"
license = "Apache-2.0"
description = "Traits for encoding and decoding CLVM objects."
Expand All @@ -18,8 +18,9 @@ py-bindings = ["dep:pyo3"]

[dependencies]
pyo3 = { version = ">=0.19.0", optional = true }
clvmr = "0.5.0"
clvm-derive = { version = "0.2.14", path = "../clvm-derive", optional = true }
chia-bls = { version = "0.4.0", path = "../chia-bls", optional = true }
chia-bls = { version = "0.5.0", path = "../chia-bls", optional = true }
num-bigint = "0.4.3"
thiserror = "1.0.44"

Expand Down
14 changes: 7 additions & 7 deletions clvm-traits/docs/derive_macros.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ For example:
- `(A, B, C)` is encoded as `(A . (B . C))`, since every cons-pair must contain two values.
- `(A, B, C, D)` is encoded as `(A . (B . (C . D)))` for the same reason as above.

```rust compile_fail
```rust
use clvmr::Allocator;
use clvm_traits::{ToClvm, FromClvm};

Expand Down Expand Up @@ -59,7 +59,7 @@ For example:
Note that the following code is for example purposes only and is not indicative of how to create a secure program.
Using a password like shown in this example is an insecure method of locking coins, but it's effective for learning.

```rust compile_fail
```rust
use clvmr::Allocator;
use clvm_traits::{ToClvm, FromClvm};

Expand Down Expand Up @@ -91,7 +91,7 @@ You can read more about currying on the [Chia blockchain documentation](https://
Note that the following code is for example purposes only and is not indicative of how to create a secure program.
Using a password like shown in this example is an insecure method of locking coins, but it's effective for learning.

```rust compile_fail
```rust
use clvmr::Allocator;
use clvm_traits::{ToClvm, FromClvm};

Expand Down Expand Up @@ -121,7 +121,7 @@ For convenience, this is the behavior when deriving `ToClvm` and `FromClvm` for
In this example, since the `tuple` representation is used and the only values are the discriminants, the variants will be encoded as an atom.
Discriminants default to the `isize` type and the first value is `0`. Subsequent values are incremented by `1` by default.

```rust compile_fail
```rust
use clvmr::Allocator;
use clvm_traits::{ToClvm, FromClvm};

Expand All @@ -145,7 +145,7 @@ It's possible to override both the type of the discriminator, and the value.
The `#[repr(...)]` attribute is used by the Rust compiler to allow overriding the discriminator type.
As such, this attribute is also used to change the underlying type used to serialize and deserialize discriminator values.

```rust compile_fail
```rust
use clvmr::Allocator;
use clvm_traits::{ToClvm, FromClvm};

Expand All @@ -169,7 +169,7 @@ assert_eq!(Status::from_clvm(a, ptr).unwrap(), status);
Of course, you can also include fields on enum variants, and they will be serialized after the discriminator accordingly.
It's also possible to override the representation of an individual variant, as if it were a standalone struct.

```rust compile_fail
```rust
use clvmr::Allocator;
use clvm_traits::{ToClvm, FromClvm};

Expand Down Expand Up @@ -199,7 +199,7 @@ This is what `#[clvm(untagged)]` allows you to do. However, due to current limit
Note that if there is any ambiguity, the first variant which matches a value will be the resulting value.
For example, if both `A` and `B` are in that order and are the same type, if you serialize a value of `B`, it will be deserialized as `A`.

```rust compile_fail
```rust
use clvmr::Allocator;
use clvm_traits::{ToClvm, FromClvm};

Expand Down
Loading
Loading