Skip to content

Commit

Permalink
fmt + clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
prozacchiwawa committed Jul 15, 2024
1 parent 71de5f8 commit d4d9f51
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 21 deletions.
20 changes: 8 additions & 12 deletions src/common/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ use clvmr::allocator::{Allocator, NodePtr, SExp};
use clvmr::reduction::EvalErr;
use clvmr::serde::{node_from_bytes, node_to_bytes};

#[cfg(test)]
use clvm_tools_rs::classic::clvm::__type_compatibility__::Stream;
#[cfg(test)]
use clvm_tools_rs::classic::clvm::serialize::sexp_to_stream;
use clvm_tools_rs::classic::clvm::sexp::proper_list;
use clvm_tools_rs::classic::clvm::syntax_error::SyntaxErr;
use clvm_tools_rs::classic::clvm_tools::sha256tree::sha256tree;
Expand Down Expand Up @@ -546,14 +542,14 @@ impl Default for Node {
}
}

impl Node {
#[cfg(test)]
pub fn to_hex(&self, allocator: &mut AllocEncoder) -> String {
let mut stream = Stream::new(None);
sexp_to_stream(allocator.allocator(), self.0, &mut stream);
stream.get_value().hex()
}
}
// impl Node {
// #[cfg(test)]
// pub fn to_hex(&self, allocator: &mut AllocEncoder) -> String {
// let mut stream = Stream::new(None);
// sexp_to_stream(allocator.allocator(), self.0, &mut stream);
// stream.get_value().hex()
// }
// }

impl ToClvm<NodePtr> for Node {
fn to_clvm(
Expand Down
9 changes: 1 addition & 8 deletions src/tests/game.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
#[cfg(feature = "sim-tests")]
use crate::channel_handler::game::Game;
#[cfg(feature = "sim-tests")]
use crate::channel_handler::types::ChannelHandlerEnv;
use crate::common::standard_coin::{
private_to_public_key, puzzle_hash_for_synthetic_public_key, ChiaIdentity,
};
use crate::common::types::{Amount, CoinString, Error, IntoErr, Timeout};
use rand::prelude::*;

use crate::channel_handler::runner::ChannelHandlerGame;
use crate::channel_handler::types::{ChannelHandlerEnv, ChannelHandlerGame};

#[cfg(feature = "sim-tests")]
use crate::tests::simulator::Simulator;
Expand Down
2 changes: 1 addition & 1 deletion src/tests/game_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ fn test_game_handler_their_move_slash() {
.expect("should run");
if let TheirTurnResult::Slash(evidence, aggsig) = result {
// Good, check more
assert_eq!(aggsig, default_aggsig);
assert_eq!(*aggsig, default_aggsig);
assert_eq!(disassemble(allocator.allocator(), evidence.to_nodeptr(), None), "(1337 () () () 0x0000000000000000000000000000000000000000000000000000000000000000 () ())");
} else {
assert!(false);
Expand Down
1 change: 1 addition & 0 deletions src/tests/referee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use crate::referee::{GameMoveDetails, GameMoveStateInfo, RefereeMaker, Validator

pub struct DebugGamePrograms {
pub my_validation_program: NodePtr,
#[allow(dead_code)]
pub their_validation_program: NodePtr,
pub my_turn_handler: GameHandler,
pub their_turn_handler: GameHandler,
Expand Down

0 comments on commit d4d9f51

Please sign in to comment.