Skip to content

Commit

Permalink
Hotfix: add default restrictions id to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vicsn committed Jun 10, 2024
1 parent 1b5e740 commit 579507e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 4 additions & 3 deletions node/router/tests/common/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,10 @@ use snarkvm::prelude::{
puzzle::Solution,
Field,
Network,
Zero,
};

use async_trait::async_trait;
use std::{io, net::SocketAddr};
use std::{io, net::SocketAddr, str::FromStr};
use tracing::*;

#[derive(Clone)]
Expand Down Expand Up @@ -82,7 +81,9 @@ impl<N: Network> Handshake for TestRouter<N> {
let conn_side = connection.side();
let stream = self.borrow_stream(&mut connection);
let genesis_header = *sample_genesis_block().header();
let restrictions_id = Field::<N>::zero();
let restrictions_id =
Field::<N>::from_str("7562506206353711030068167991213732850758501012603348777370400520506564970105field")
.unwrap();
self.router().handshake(peer_addr, stream, conn_side, genesis_header, restrictions_id).await?;

Ok(connection)
Expand Down
7 changes: 5 additions & 2 deletions node/tests/common/test_peer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use snarkos_node_router::{
};
use snarkvm::{
ledger::narwhal::Data,
prelude::{block::Block, error, Address, Field, FromBytes, MainnetV0 as CurrentNetwork, Network, TestRng, Zero},
prelude::{block::Block, error, Address, Field, FromBytes, MainnetV0 as CurrentNetwork, Network, TestRng},
};

use std::{
Expand Down Expand Up @@ -127,7 +127,10 @@ impl Handshake for TestPeer {
// Retrieve the genesis block header.
let genesis_header = *sample_genesis_block().header();
// Retrieve the restrictions ID.
let restrictions_id = Field::<CurrentNetwork>::zero();
let restrictions_id = Field::<CurrentNetwork>::from_str(
"7562506206353711030068167991213732850758501012603348777370400520506564970105field",
)
.unwrap();

// TODO(nkls): add assertions on the contents of messages.
match node_side {
Expand Down

0 comments on commit 579507e

Please sign in to comment.