Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions stackslib/src/net/api/tests/callreadonly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ use crate::core::BLOCK_LIMIT_MAINNET_21;
use crate::net::api::*;
use crate::net::connection::ConnectionOptions;
use crate::net::httpcore::{
HttpPreambleExtensions as _, HttpRequestContentsExtensions as _, RPCRequestHandler, StacksHttp,
StacksHttpRequest,
HttpRequestContentsExtensions as _, RPCRequestHandler, StacksHttp, StacksHttpRequest,
};
use crate::net::{ProtocolFamily, TipRequest};

Expand Down Expand Up @@ -191,11 +190,6 @@ fn test_try_make_response() {
std::str::from_utf8(&response.try_serialize().unwrap()).unwrap()
);

assert_eq!(
response.preamble().get_canonical_stacks_tip_height(),
Some(1)
);

let resp = response.decode_call_readonly_response().unwrap();

assert!(resp.okay);
Expand All @@ -212,11 +206,6 @@ fn test_try_make_response() {
std::str::from_utf8(&response.try_serialize().unwrap()).unwrap()
);

assert_eq!(
response.preamble().get_canonical_stacks_tip_height(),
Some(1)
);

let resp = response.decode_call_readonly_response().unwrap();

assert!(resp.okay);
Expand Down
13 changes: 1 addition & 12 deletions stackslib/src/net/api/tests/fastcallreadonly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ use super::{test_rpc, test_rpc_with_config};
use crate::net::api::*;
use crate::net::connection::ConnectionOptions;
use crate::net::httpcore::{
HttpPreambleExtensions as _, HttpRequestContentsExtensions as _, RPCRequestHandler, StacksHttp,
StacksHttpRequest,
HttpRequestContentsExtensions as _, RPCRequestHandler, StacksHttp, StacksHttpRequest,
};
use crate::net::{ProtocolFamily, TipRequest};

Expand Down Expand Up @@ -211,11 +210,6 @@ fn test_try_make_response() {
std::str::from_utf8(&response.try_serialize().unwrap()).unwrap()
);

assert_eq!(
response.preamble().get_canonical_stacks_tip_height(),
Some(1)
);

let resp = response.decode_call_readonly_response().unwrap();

assert!(resp.okay);
Expand All @@ -232,11 +226,6 @@ fn test_try_make_response() {
std::str::from_utf8(&response.try_serialize().unwrap()).unwrap()
);

assert_eq!(
response.preamble().get_canonical_stacks_tip_height(),
Some(1)
);

let resp = response.decode_call_readonly_response().unwrap();

assert!(resp.okay);
Expand Down
24 changes: 1 addition & 23 deletions stackslib/src/net/api/tests/getaccount.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ use stacks_common::types::Address;
use super::test_rpc;
use crate::net::api::*;
use crate::net::connection::ConnectionOptions;
use crate::net::httpcore::{
HttpPreambleExtensions as _, RPCRequestHandler, StacksHttp, StacksHttpRequest,
};
use crate::net::httpcore::{RPCRequestHandler, StacksHttp, StacksHttpRequest};
use crate::net::{ProtocolFamily, TipRequest};

#[test]
Expand Down Expand Up @@ -130,11 +128,6 @@ fn test_try_make_response() {
std::str::from_utf8(&response.try_serialize().unwrap()).unwrap()
);

assert_eq!(
response.preamble().get_canonical_stacks_tip_height(),
Some(1)
);

let resp = response.decode_account_entry_response().unwrap();

assert_eq!(resp.balance, "0x0000000000000000000000003b9aca00");
Expand All @@ -149,11 +142,6 @@ fn test_try_make_response() {
std::str::from_utf8(&response.try_serialize().unwrap()).unwrap()
);

assert_eq!(
response.preamble().get_canonical_stacks_tip_height(),
Some(1)
);

let resp = response.decode_account_entry_response().unwrap();

assert_eq!(resp.balance, "0x0000000000000000000000003b9aca00");
Expand All @@ -168,11 +156,6 @@ fn test_try_make_response() {
std::str::from_utf8(&response.try_serialize().unwrap()).unwrap()
);

assert_eq!(
response.preamble().get_canonical_stacks_tip_height(),
Some(1)
);

let resp = response.decode_account_entry_response().unwrap();

assert_eq!(resp.balance, "0x00000000000000000000000000000000");
Expand All @@ -187,11 +170,6 @@ fn test_try_make_response() {
std::str::from_utf8(&response.try_serialize().unwrap()).unwrap()
);

assert_eq!(
response.preamble().get_canonical_stacks_tip_height(),
Some(1)
);

let resp = response.decode_account_entry_response().unwrap();

assert_eq!(resp.balance, "0x0000000000000000000000003b9ac985");
Expand Down
9 changes: 1 addition & 8 deletions stackslib/src/net/api/tests/getattachment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ use stacks_common::util::hash::Hash160;
use super::test_rpc;
use crate::net::api::*;
use crate::net::connection::ConnectionOptions;
use crate::net::httpcore::{
HttpPreambleExtensions as _, RPCRequestHandler, StacksHttp, StacksHttpRequest,
};
use crate::net::httpcore::{RPCRequestHandler, StacksHttp, StacksHttpRequest};
use crate::net::{Attachment, ProtocolFamily};

#[test]
Expand Down Expand Up @@ -87,11 +85,6 @@ fn test_try_make_response() {
std::str::from_utf8(&response.try_serialize().unwrap()).unwrap()
);

assert_eq!(
response.preamble().get_canonical_stacks_tip_height(),
Some(1)
);

let resp = response.decode_atlas_get_attachment().unwrap();
assert_eq!(resp.attachment, attachment);

Expand Down
10 changes: 0 additions & 10 deletions stackslib/src/net/api/tests/getattachmentsinv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,6 @@ fn test_try_make_response() {
std::str::from_utf8(&response.try_serialize().unwrap()).unwrap()
);

assert_eq!(
response.preamble().get_canonical_stacks_tip_height(),
Some(1)
);

let resp = response.decode_atlas_attachments_inv_response().unwrap();

// there should be a bit set in the inventory vector
Expand All @@ -128,11 +123,6 @@ fn test_try_make_response() {
"Response:\n{}\n",
std::str::from_utf8(&response.try_serialize().unwrap()).unwrap()
);

assert_eq!(
response.preamble().get_canonical_stacks_tip_height(),
Some(1)
);
let resp = response.decode_atlas_attachments_inv_response().unwrap();

// this is a HTTP 200, but no bits are set
Expand Down
13 changes: 1 addition & 12 deletions stackslib/src/net/api/tests/getclaritymarfvalue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ use super::test_rpc;
use crate::net::api::*;
use crate::net::connection::ConnectionOptions;
use crate::net::httpcore::{
HttpPreambleExtensions as _, HttpRequestContentsExtensions as _, RPCRequestHandler, StacksHttp,
StacksHttpRequest,
HttpRequestContentsExtensions as _, RPCRequestHandler, StacksHttp, StacksHttpRequest,
};
use crate::net::{ProtocolFamily, TipRequest};

Expand Down Expand Up @@ -141,11 +140,6 @@ fn test_try_make_response() {
std::str::from_utf8(&response.try_serialize().unwrap()).unwrap()
);

assert_eq!(
response.preamble().get_canonical_stacks_tip_height(),
Some(1)
);

let resp = response.decode_clarity_marf_response().unwrap();
assert_eq!(resp.data, "0x0000000000000000000000000000000000");
assert!(resp.marf_proof.is_some());
Expand All @@ -157,11 +151,6 @@ fn test_try_make_response() {
std::str::from_utf8(&response.try_serialize().unwrap()).unwrap()
);

assert_eq!(
response.preamble().get_canonical_stacks_tip_height(),
Some(1)
);

let resp = response.decode_clarity_marf_response().unwrap();
assert_eq!(resp.data, "0x0100000000000000000000000000000001");
assert!(resp.marf_proof.is_some());
Expand Down
11 changes: 1 addition & 10 deletions stackslib/src/net/api/tests/getclaritymetadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ use crate::net::api::*;
use crate::net::connection::ConnectionOptions;
use crate::net::http::Error as HttpError;
use crate::net::httpcore::{
HttpPreambleExtensions as _, HttpRequestContentsExtensions as _, RPCRequestHandler, StacksHttp,
StacksHttpRequest,
HttpRequestContentsExtensions as _, RPCRequestHandler, StacksHttp, StacksHttpRequest,
};
use crate::net::{ProtocolFamily, TipRequest};

Expand Down Expand Up @@ -309,10 +308,6 @@ fn test_try_make_response() {

// contract size metadata
let response = responses.remove(0);
assert_eq!(
response.preamble().get_canonical_stacks_tip_height(),
Some(1)
);
let resp = response.decode_clarity_metadata_response().unwrap();
assert_eq!(resp.data, "1432");

Expand Down Expand Up @@ -356,10 +351,6 @@ fn test_try_make_response() {

// contract size metadata
let response = responses.remove(0);
assert_eq!(
response.preamble().get_canonical_stacks_tip_height(),
Some(1)
);
let resp = response.decode_clarity_metadata_response().unwrap();
assert_eq!(resp.data, "1432");

Expand Down
13 changes: 1 addition & 12 deletions stackslib/src/net/api/tests/getconstantval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ use super::test_rpc;
use crate::net::api::*;
use crate::net::connection::ConnectionOptions;
use crate::net::httpcore::{
HttpPreambleExtensions as _, HttpRequestContentsExtensions as _, RPCRequestHandler, StacksHttp,
StacksHttpRequest,
HttpRequestContentsExtensions as _, RPCRequestHandler, StacksHttp, StacksHttpRequest,
};
use crate::net::{ProtocolFamily, TipRequest};

Expand Down Expand Up @@ -138,11 +137,6 @@ fn test_try_make_response() {
std::str::from_utf8(&response.try_serialize().unwrap()).unwrap()
);

assert_eq!(
response.preamble().get_canonical_stacks_tip_height(),
Some(1)
);

let resp = response.decode_constant_val_response().unwrap();

assert_eq!(resp.data, "0x000000000000000000000000000000007b");
Expand All @@ -154,11 +148,6 @@ fn test_try_make_response() {
std::str::from_utf8(&response.try_serialize().unwrap()).unwrap()
);

assert_eq!(
response.preamble().get_canonical_stacks_tip_height(),
Some(1)
);

let resp = response.decode_constant_val_response().unwrap();

assert_eq!(resp.data, "0x00000000000000000000000000000001c8");
Expand Down
13 changes: 1 addition & 12 deletions stackslib/src/net/api/tests/getcontractabi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ use super::test_rpc;
use crate::net::api::*;
use crate::net::connection::ConnectionOptions;
use crate::net::httpcore::{
HttpPreambleExtensions as _, HttpRequestContentsExtensions as _, RPCRequestHandler, StacksHttp,
StacksHttpRequest,
HttpRequestContentsExtensions as _, RPCRequestHandler, StacksHttp, StacksHttpRequest,
};
use crate::net::{ProtocolFamily, TipRequest};

Expand Down Expand Up @@ -123,11 +122,6 @@ fn test_try_make_response() {
std::str::from_utf8(&response.try_serialize().unwrap()).unwrap()
);

assert_eq!(
response.preamble().get_canonical_stacks_tip_height(),
Some(1)
);

let resp = response.decode_contract_abi_response().unwrap();

// unconfirmed data
Expand All @@ -137,11 +131,6 @@ fn test_try_make_response() {
std::str::from_utf8(&response.try_serialize().unwrap()).unwrap()
);

assert_eq!(
response.preamble().get_canonical_stacks_tip_height(),
Some(1)
);

let resp = response.decode_contract_abi_response().unwrap();

// no such contract
Expand Down
13 changes: 1 addition & 12 deletions stackslib/src/net/api/tests/getcontractsrc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ use super::test_rpc;
use crate::net::api::*;
use crate::net::connection::ConnectionOptions;
use crate::net::httpcore::{
HttpPreambleExtensions as _, HttpRequestContentsExtensions as _, RPCRequestHandler, StacksHttp,
StacksHttpRequest,
HttpRequestContentsExtensions as _, RPCRequestHandler, StacksHttp, StacksHttpRequest,
};
use crate::net::{ProtocolFamily, TipRequest};

Expand Down Expand Up @@ -128,11 +127,6 @@ fn test_try_make_response() {
std::str::from_utf8(&response.try_serialize().unwrap()).unwrap()
);

assert_eq!(
response.preamble().get_canonical_stacks_tip_height(),
Some(1)
);

let resp = response.decode_contract_src_response().unwrap();
assert_eq!(resp.publish_height, 1);
assert!(resp.marf_proof.is_some());
Expand All @@ -144,11 +138,6 @@ fn test_try_make_response() {
std::str::from_utf8(&response.try_serialize().unwrap()).unwrap()
);

assert_eq!(
response.preamble().get_canonical_stacks_tip_height(),
Some(1)
);

let resp = response.decode_contract_src_response().unwrap();
assert_eq!(resp.publish_height, 2);
assert!(resp.marf_proof.is_some());
Expand Down
13 changes: 1 addition & 12 deletions stackslib/src/net/api/tests/getdatavar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ use super::test_rpc;
use crate::net::api::*;
use crate::net::connection::ConnectionOptions;
use crate::net::httpcore::{
HttpPreambleExtensions as _, HttpRequestContentsExtensions as _, RPCRequestHandler, StacksHttp,
StacksHttpRequest,
HttpRequestContentsExtensions as _, RPCRequestHandler, StacksHttp, StacksHttpRequest,
};
use crate::net::{ProtocolFamily, TipRequest};

Expand Down Expand Up @@ -145,11 +144,6 @@ fn test_try_make_response() {
std::str::from_utf8(&response.try_serialize().unwrap()).unwrap()
);

assert_eq!(
response.preamble().get_canonical_stacks_tip_height(),
Some(1)
);

let resp = response.decode_data_var_response().unwrap();
assert_eq!(resp.data, "0x0000000000000000000000000000000000");
assert!(resp.marf_proof.is_some());
Expand All @@ -161,11 +155,6 @@ fn test_try_make_response() {
std::str::from_utf8(&response.try_serialize().unwrap()).unwrap()
);

assert_eq!(
response.preamble().get_canonical_stacks_tip_height(),
Some(1)
);

let resp = response.decode_data_var_response().unwrap();
assert_eq!(resp.data, "0x0100000000000000000000000000000001");
assert!(resp.marf_proof.is_some());
Expand Down
6 changes: 1 addition & 5 deletions stackslib/src/net/api/tests/getinfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use serde_json;
use super::test_rpc;
use crate::net::api::getinfo::RPCPeerInfoData;
use crate::net::connection::ConnectionOptions;
use crate::net::httpcore::{HttpPreambleExtensions as _, StacksHttp, StacksHttpRequest};
use crate::net::httpcore::{StacksHttp, StacksHttpRequest};
use crate::net::ProtocolFamily;

#[test]
Expand Down Expand Up @@ -87,10 +87,6 @@ fn test_try_make_response() {
std::str::from_utf8(&response.try_serialize().unwrap()).unwrap()
);

assert_eq!(
response.preamble().get_canonical_stacks_tip_height(),
Some(1)
);
let resp = response.decode_peer_info().unwrap();

assert_eq!(resp.tenure_height, 1);
Expand Down
Loading
Loading