Skip to content

Commit

Permalink
Use avltree fork to fix empty hash (#732)
Browse files Browse the repository at this point in the history
* use avltre fork to fix empty hash

* fix rust fmt

* fix changed gf2 crate version
  • Loading branch information
ross-weir authored Dec 1, 2023
1 parent 417b928 commit d5343f0
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion ergotree-interpreter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ serde = { workspace = true, optional = true }
serde_json = { workspace = true, optional = true }
serde_with = { workspace = true, optional = true }
proptest = { workspace = true, optional = true }
scorex_crypto_avltree = "0.1.0"
ergo_avltree_rust = "0.1.0"
gf2_192 = { version = "^0.26.0", path = "../gf2_192" }
miette = { workspace = true }
hashbrown = "0.14.1"
Expand Down
6 changes: 3 additions & 3 deletions ergotree-interpreter/src/eval/create_avl_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ mod tests {
use super::*;
use crate::eval::tests::eval_out_wo_ctx;

use ergo_avltree_rust::authenticated_tree_ops::AuthenticatedTreeOps;
use ergo_avltree_rust::batch_avl_prover::BatchAVLProver;
use ergo_avltree_rust::batch_node::{AVLTree, Node, NodeHeader};
use ergo_chain_types::ADDigest;
use ergotree_ir::mir::{
avl_tree_data::{AvlTreeData, AvlTreeFlags},
expr::Expr,
};
use scorex_crypto_avltree::authenticated_tree_ops::AuthenticatedTreeOps;
use scorex_crypto_avltree::batch_avl_prover::BatchAVLProver;
use scorex_crypto_avltree::batch_node::{AVLTree, Node, NodeHeader};
use sigma_ser::ScorexSerializable;

#[test]
Expand Down
18 changes: 9 additions & 9 deletions ergotree-interpreter/src/eval/savltree.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
use std::convert::TryFrom;

use bytes::Bytes;
use ergo_avltree_rust::authenticated_tree_ops::AuthenticatedTreeOps;
use ergo_avltree_rust::batch_avl_verifier::BatchAVLVerifier;
use ergo_avltree_rust::batch_node::AVLTree;
use ergo_avltree_rust::batch_node::Node;
use ergo_avltree_rust::batch_node::NodeHeader;
use ergo_avltree_rust::operation::KeyValue;
use ergo_avltree_rust::operation::Operation;
use ergo_chain_types::ADDigest;
use ergotree_ir::mir::avl_tree_data::AvlTreeData;
use ergotree_ir::mir::avl_tree_data::AvlTreeFlags;
use ergotree_ir::mir::constant::TryExtractInto;
use ergotree_ir::mir::value::{CollKind, NativeColl, Value};
use scorex_crypto_avltree::authenticated_tree_ops::AuthenticatedTreeOps;
use scorex_crypto_avltree::batch_avl_verifier::BatchAVLVerifier;
use scorex_crypto_avltree::batch_node::AVLTree;
use scorex_crypto_avltree::batch_node::Node;
use scorex_crypto_avltree::batch_node::NodeHeader;
use scorex_crypto_avltree::operation::KeyValue;
use scorex_crypto_avltree::operation::Operation;
use sigma_ser::ScorexSerializable;

use super::EvalError;
Expand Down Expand Up @@ -435,6 +435,7 @@ fn map_eval_err<T: std::fmt::Debug>(e: T) -> EvalError {
mod tests {
use std::convert::TryFrom;

use ergo_avltree_rust::batch_avl_prover::BatchAVLProver;
use ergotree_ir::{
mir::{
avl_tree_data::{AvlTreeData, AvlTreeFlags},
Expand All @@ -446,7 +447,6 @@ mod tests {
types::{savltree, stuple::STuple, stype::SType},
};
use proptest::prelude::*;
use scorex_crypto_avltree::batch_avl_prover::BatchAVLProver;

use crate::eval::tests::eval_out_wo_ctx;

Expand Down Expand Up @@ -603,7 +603,7 @@ mod tests {

#[test]
fn eval_avl_insert() {
// This example taken from `scorex_crypto_avltree` README
// This example taken from `ergo_avltree_rust` README
let mut prover = BatchAVLProver::new(
AVLTree::new(
|digest| Node::LabelOnly(NodeHeader::new(Some(*digest), None)),
Expand Down
12 changes: 6 additions & 6 deletions ergotree-interpreter/src/eval/tree_lookup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ use crate::eval::env::Env;
use crate::eval::EvalContext;
use crate::eval::EvalError;
use crate::eval::Evaluable;
use ergo_avltree_rust::batch_avl_verifier::BatchAVLVerifier;
use ergo_avltree_rust::batch_node::{AVLTree, Node, NodeHeader};
use ergo_avltree_rust::operation::Operation;
use ergotree_ir::mir::avl_tree_data::AvlTreeData;
use ergotree_ir::mir::constant::TryExtractInto;
use scorex_crypto_avltree::batch_avl_verifier::BatchAVLVerifier;
use scorex_crypto_avltree::batch_node::{AVLTree, Node, NodeHeader};
use scorex_crypto_avltree::operation::Operation;
use sigma_util::AsVecU8;

impl Evaluable for TreeLookup {
Expand Down Expand Up @@ -67,15 +67,15 @@ mod tests {
use super::*;
use crate::eval::tests::eval_out_wo_ctx;

use ergo_avltree_rust::authenticated_tree_ops::AuthenticatedTreeOps;
use ergo_avltree_rust::batch_avl_prover::BatchAVLProver;
use ergo_avltree_rust::operation::KeyValue;
use ergo_chain_types::ADDigest;
use ergotree_ir::mir::{
avl_tree_data::{AvlTreeData, AvlTreeFlags},
expr::Expr,
value::{CollKind, NativeColl},
};
use scorex_crypto_avltree::authenticated_tree_ops::AuthenticatedTreeOps;
use scorex_crypto_avltree::batch_avl_prover::BatchAVLProver;
use scorex_crypto_avltree::operation::KeyValue;
use sigma_ser::ScorexSerializable;
use sigma_util::AsVecI8;

Expand Down

0 comments on commit d5343f0

Please sign in to comment.