Skip to content

Commit 22403b2

Browse files
committed
Fix sim-tests config
1 parent d4d9f51 commit 22403b2

File tree

2 files changed

+22
-9
lines changed

2 files changed

+22
-9
lines changed

src/common/types.rs

+12-8
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ use clvmr::allocator::{Allocator, NodePtr, SExp};
1616
use clvmr::reduction::EvalErr;
1717
use clvmr::serde::{node_from_bytes, node_to_bytes};
1818

19+
#[cfg(all(test, feature="sim-tests"))]
20+
use clvm_tools_rs::classic::clvm::__type_compatibility__::Stream;
21+
#[cfg(all(test, feature="sim-tests"))]
22+
use clvm_tools_rs::classic::clvm::serialize::sexp_to_stream;
1923
use clvm_tools_rs::classic::clvm::sexp::proper_list;
2024
use clvm_tools_rs::classic::clvm::syntax_error::SyntaxErr;
2125
use clvm_tools_rs::classic::clvm_tools::sha256tree::sha256tree;
@@ -542,14 +546,14 @@ impl Default for Node {
542546
}
543547
}
544548

545-
// impl Node {
546-
// #[cfg(test)]
547-
// pub fn to_hex(&self, allocator: &mut AllocEncoder) -> String {
548-
// let mut stream = Stream::new(None);
549-
// sexp_to_stream(allocator.allocator(), self.0, &mut stream);
550-
// stream.get_value().hex()
551-
// }
552-
// }
549+
impl Node {
550+
#[cfg(all(test, feature="sim-tests"))]
551+
pub fn to_hex(&self, allocator: &mut AllocEncoder) -> String {
552+
let mut stream = Stream::new(None);
553+
sexp_to_stream(allocator.allocator(), self.0, &mut stream);
554+
stream.get_value().hex()
555+
}
556+
}
553557

554558
impl ToClvm<NodePtr> for Node {
555559
fn to_clvm(

src/tests/game.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1+
#[cfg(feature = "sim-tests")]
2+
use rand::prelude::*;
3+
14
#[cfg(feature = "sim-tests")]
25
use crate::channel_handler::game::Game;
36
#[cfg(feature = "sim-tests")]
4-
use crate::channel_handler::types::{ChannelHandlerEnv, ChannelHandlerGame};
7+
use crate::channel_handler::types::ChannelHandlerEnv;
8+
#[cfg(feature = "sim-tests")]
9+
use crate::channel_handler::runner::ChannelHandlerGame;
10+
#[cfg(feature = "sim-tests")]
11+
use crate::common::types::{Amount, CoinString, Error, IntoErr, Timeout};
12+
#[cfg(feature = "sim-tests")]
13+
use crate::common::standard_coin::{ChiaIdentity, private_to_public_key, puzzle_hash_for_synthetic_public_key};
514

615
#[cfg(feature = "sim-tests")]
716
use crate::tests::simulator::Simulator;

0 commit comments

Comments
 (0)