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

Remove clvm-traits and bump chia-bls #368

Merged
merged 1 commit into from
Feb 2, 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: 19 additions & 13 deletions Cargo.lock

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

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ lazy_static = "1.4.0"
num-bigint = "0.4.3"
num-traits = "0.2.15"
num-integer = "0.1.45"
clvm-traits = "0.3.2"
chia-bls = "0.3.3"
chia-bls = "0.4.0"
sha2 = "0.10.8"
openssl = { version = "=0.10.55", features = ["vendored"], optional = true }
# for secp sigs
Expand Down
37 changes: 0 additions & 37 deletions src/allocator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use crate::err_utils::err;
use crate::number::{node_from_number, number_from_u8, Number};
use crate::reduction::EvalErr;
use chia_bls::{G1Element, G2Element};
use clvm_traits::{ClvmDecoder, ClvmEncoder, FromClvmError, ToClvmError};

const MAX_NUM_ATOMS: usize = 62500000;
const MAX_NUM_PAIRS: usize = 62500000;
Expand Down Expand Up @@ -375,42 +374,6 @@ impl Allocator {
}
}

impl ClvmEncoder for Allocator {
type Node = NodePtr;

fn encode_atom(&mut self, bytes: &[u8]) -> Result<Self::Node, ToClvmError> {
self.new_atom(bytes).or(Err(ToClvmError::OutOfMemory))
}

fn encode_pair(
&mut self,
first: Self::Node,
rest: Self::Node,
) -> Result<Self::Node, ToClvmError> {
self.new_pair(first, rest).or(Err(ToClvmError::OutOfMemory))
}
}

impl ClvmDecoder for Allocator {
type Node = NodePtr;

fn decode_atom(&self, node: &Self::Node) -> Result<&[u8], FromClvmError> {
if let SExp::Atom = self.sexp(*node) {
Ok(self.atom(*node))
} else {
Err(FromClvmError::ExpectedAtom)
}
}

fn decode_pair(&self, node: &Self::Node) -> Result<(Self::Node, Self::Node), FromClvmError> {
if let SExp::Pair(first, rest) = self.sexp(*node) {
Ok((first, rest))
} else {
Err(FromClvmError::ExpectedPair)
}
}
}

#[test]
fn test_node_as_index() {
assert_eq!(NodePtr::new(ObjectType::Pair, 0).as_index(), 0);
Expand Down
115 changes: 0 additions & 115 deletions src/from_node_ptr.rs

This file was deleted.

6 changes: 0 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ pub mod serde;
pub mod sha2;
pub mod traverse_path;

pub mod from_node_ptr;
pub mod to_node_ptr;

pub use from_node_ptr::FromNodePtr;
pub use to_node_ptr::ToNodePtr;

pub use allocator::{Allocator, NodePtr};
pub use chia_dialect::ChiaDialect;
pub use run_program::run_program;
Expand Down
143 changes: 0 additions & 143 deletions src/to_node_ptr.rs

This file was deleted.

Loading