Skip to content

Commit

Permalink
merge up
Browse files Browse the repository at this point in the history
  • Loading branch information
prozacchiwawa committed Dec 30, 2024
2 parents f9afcfd + ae419d4 commit 220576f
Show file tree
Hide file tree
Showing 5 changed files with 177 additions and 115 deletions.
6 changes: 5 additions & 1 deletion src/channel_handler/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ pub struct PrintableGameStartInfo<'a> {
pub info: &'a GameStartInfo,
}

impl<'a> std::fmt::Debug for PrintableGameStartInfo<'a> {
impl std::fmt::Debug for PrintableGameStartInfo<'_> {
fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
writeln!(formatter, "- game_id: {:?}", self.info.game_id)?;
writeln!(formatter, "- amount: {:?}", self.info.amount)?;
Expand Down Expand Up @@ -294,6 +294,10 @@ impl ReadableMove {
self.0.to_nodeptr(allocator)
}

pub fn to_program(&self) -> &Program {
&self.0
}

pub fn from_program(p: Program) -> Self {
ReadableMove(p)
}
Expand Down
4 changes: 2 additions & 2 deletions src/common/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ impl Distribution<PrivateKey> for Standard {

struct SerdeByteConsumer;

impl<'de> Visitor<'de> for SerdeByteConsumer {
impl Visitor<'_> for SerdeByteConsumer {
type Value = Vec<u8>;
fn expecting(&self, fmt: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
fmt.write_str("expected bytes")
Expand Down Expand Up @@ -507,7 +507,7 @@ pub enum Sha256Input<'a> {
Array(Vec<Sha256Input<'a>>),
}

impl<'a> Sha256Input<'a> {
impl Sha256Input<'_> {
fn update(&self, hasher: &mut Sha256) {
match self {
Sha256Input::Bytes(b) => {
Expand Down
17 changes: 8 additions & 9 deletions src/potato_handler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2109,15 +2109,14 @@ impl PotatoHandler {
}
CoinSpentInformation::OurSpend(ph, amt) => {
if let HandshakeState::OnChain(game_map) = &mut self.handshake_state {
game_map.insert(CoinString::from_parts(
&coin_id.to_coin_id(),
&ph,
&amt
), OnChainGameState {
puzzle_hash: ph,
our_turn: false,
.. old_definition
});
game_map.insert(
CoinString::from_parts(&coin_id.to_coin_id(), &ph, &amt),
OnChainGameState {
puzzle_hash: ph,
our_turn: false,
..old_definition
},
);
// Do some kind of UI indication.
unblock_queue = true;
}
Expand Down
Loading

0 comments on commit 220576f

Please sign in to comment.