Skip to content

Commit

Permalink
fix tests, and lints, add to ser / der correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
D-Stacks committed Aug 28, 2024
1 parent 2450fd5 commit d546cb6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions consensus/core/src/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ pub trait ConsensusApi: Send + Sync {
/// Gets the virtual chain paths from `low` to the `sink` hash, or until `limit`` is reached
///
/// Note:
/// 1) `limit` will populate removed and then the added chain path, up to the specified amount.
/// 1.1) use `usize::MAX` to impose no limit with optimized backward chain iteration, for better performance in cases where batching is not required.
/// 1) `limit` will populate removed and then the added chain path, up to the specified amount.
/// 1.1) use `usize::MAX` to impose no limit with optimized backward chain iteration, for better performance in cases where batching is not required.
fn get_virtual_chain_from_block(&self, low: Hash, limit: usize) -> ConsensusResult<ChainPath> {
unimplemented!()
}
Expand Down
4 changes: 2 additions & 2 deletions rpc/core/src/model/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ impl GetVirtualChainFromBlockRequest {
impl Serializer for GetVirtualChainFromBlockRequest {
fn serialize<W: std::io::Write>(&self, writer: &mut W) -> std::io::Result<()> {
store!(u16, &1, writer)?;
store!(RpcHash, &self.start_hash, writer)?;
store!(Option<RpcHash>, &self.start_hash, writer)?;
store!(bool, &self.include_accepted_transaction_ids, writer)?;

Ok(())
Expand All @@ -880,7 +880,7 @@ impl Serializer for GetVirtualChainFromBlockRequest {
impl Deserializer for GetVirtualChainFromBlockRequest {
fn deserialize<R: std::io::Read>(reader: &mut R) -> std::io::Result<Self> {
let _version = load!(u16, reader)?;
let start_hash = load!(RpcHash, reader)?;
let start_hash = load!(Option<RpcHash>, reader)?;
let include_accepted_transaction_ids = load!(bool, reader)?;

Ok(Self { start_hash, include_accepted_transaction_ids })
Expand Down
14 changes: 7 additions & 7 deletions rpc/grpc/core/proto/rpc.proto
Original file line number Diff line number Diff line change
Expand Up @@ -375,13 +375,13 @@ message GetSubnetworkResponseMessage{
RPCError error = 1000;
}

// GetVirtualChainFromBlockRequestMessage requests the virtual selected
// parent chain from some startHash to this kaspad's current virtual
// note:
// 1) this call batches the response to:
// a. the network's `mergeset size limit * 10` amount of chain blocks, if `includeAcceptedTransactionIds = false`
// b. when the acceptance data queried exceeds the network's `mergeset size limit * 10` amount of merged blocks, if `includeAcceptedTransactionIds = true`
// 2) if startHash is not supplied it will default to the node's source hash
/// GetVirtualChainFromBlockRequestMessage requests the virtual selected
/// parent chain from some startHash to this kaspad's current virtual
/// Note:
/// 1) this call batches the response to:
/// a. the network's `mergeset size limit * 10` amount of chain blocks, if `includeAcceptedTransactionIds = false`
/// b. when the acceptance data queried exceeds the network's `mergeset size limit * 10` amount of merged blocks, if `includeAcceptedTransactionIds = true`
/// 2) if startHash is not supplied it will default to the node's source hash
message GetVirtualChainFromBlockRequestMessage{
string startHash = 1;
bool includeAcceptedTransactionIds = 2;
Expand Down
4 changes: 2 additions & 2 deletions testing/integration/src/rpc_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ async fn sanity_test() {
.get_virtual_chain_from_block_call(
None,
GetVirtualChainFromBlockRequest {
start_hash: SIMNET_GENESIS.hash,
start_hash: Some(SIMNET_GENESIS.hash),
include_accepted_transaction_ids: false,
},
)
Expand Down Expand Up @@ -153,7 +153,7 @@ async fn sanity_test() {
.get_virtual_chain_from_block_call(
None,
GetVirtualChainFromBlockRequest {
start_hash: SIMNET_GENESIS.hash,
start_hash: Some(SIMNET_GENESIS.hash),
include_accepted_transaction_ids: false,
},
)
Expand Down

0 comments on commit d546cb6

Please sign in to comment.