ran fmt + fized non-test build

This commit is contained in:
Pavitthra Pandurangan
2023-01-19 14:52:30 -05:00
parent 30d695f02e
commit 105700543f
4 changed files with 45 additions and 14 deletions

View File

@@ -38,7 +38,10 @@ use stacks::burnchains::{
};
use stacks::burnchains::{Burnchain, BurnchainParameters};
use stacks::chainstate::burn::db::sortdb::SortitionDB;
use stacks::chainstate::burn::operations::{BlockstackOperationType, DelegateStxOp, LeaderBlockCommitOp, LeaderKeyRegisterOp, PreStxOp, TransferStxOp, UserBurnSupportOp};
use stacks::chainstate::burn::operations::{
BlockstackOperationType, DelegateStxOp, LeaderBlockCommitOp, LeaderKeyRegisterOp, PreStxOp,
TransferStxOp, UserBurnSupportOp,
};
use stacks::chainstate::coordinator::comm::CoordinatorChannels;
#[cfg(test)]
use stacks::chainstate::stacks::address::PoxAddress;
@@ -831,6 +834,17 @@ impl BitcoinRegtestController {
unimplemented!()
}
#[cfg(not(test))]
fn build_delegate_stacks_tx(
&mut self,
_epoch_id: StacksEpochId,
_payload: DelegateStxOp,
_signer: &mut BurnchainOpSigner,
_utxo: Option<UTXO>,
) -> Option<Transaction> {
unimplemented!()
}
#[cfg(test)]
pub fn submit_manual(
&mut self,

View File

@@ -16,7 +16,9 @@ use rusqlite::types::ToSql;
use stacks::burnchains::bitcoin::address::{BitcoinAddress, LegacyBitcoinAddressType};
use stacks::burnchains::bitcoin::BitcoinNetworkType;
use stacks::burnchains::Txid;
use stacks::chainstate::burn::operations::{BlockstackOperationType, DelegateStxOp, PreStxOp, TransferStxOp};
use stacks::chainstate::burn::operations::{
BlockstackOperationType, DelegateStxOp, PreStxOp, TransferStxOp,
};
use stacks::chainstate::coordinator::comm::CoordinatorChannels;
use stacks::clarity_cli::vm_execute as execute;
use stacks::codec::StacksMessageCodec;
@@ -1703,7 +1705,7 @@ fn stx_delegate_btc_integration_test() {
let pox_pubkey = Secp256k1PublicKey::from_hex(
"02f006a09b59979e2cb8449f58076152af6b124aa29b948a3714b8d5f15aa94ede",
)
.unwrap();
.unwrap();
let pox_pubkey_hash = bytes_to_hex(
&Hash160::from_node_public_key(&pox_pubkey)
.to_bytes()
@@ -1777,7 +1779,10 @@ fn stx_delegate_btc_integration_test() {
burnchain_config.pox_constants = pox_constants.clone();
let mut btc_regtest_controller = BitcoinRegtestController::with_burnchain(
conf.clone(), None, Some(burnchain_config.clone()), None
conf.clone(),
None,
Some(burnchain_config.clone()),
None,
);
let http_origin = format!("http://{}", &conf.node.rpc_bind);
@@ -1882,8 +1887,8 @@ fn stx_delegate_btc_integration_test() {
&format!("{{ hashbytes: 0x{}, version: 0x00 }}", pox_pubkey_hash),
ClarityVersion::Clarity2,
)
.unwrap()
.unwrap(),
.unwrap()
.unwrap(),
Value::UInt(sort_height as u128),
Value::UInt(6),
],
@@ -1919,9 +1924,15 @@ fn stx_delegate_btc_integration_test() {
// Ensure that the function name is as expected
// This verifies that there were print events for delegate-stack-stx and delegate-stx
let name_field = &contract_event["value"]["Response"]["data"]["Tuple"]["data_map"]["name"];
let name_data = name_field["Sequence"]["String"]["ASCII"]["data"].as_array().unwrap();
let ascii_vec = name_data.iter().map(|num| num.as_u64().unwrap() as u8).collect();
let name_field =
&contract_event["value"]["Response"]["data"]["Tuple"]["data_map"]["name"];
let name_data = name_field["Sequence"]["String"]["ASCII"]["data"]
.as_array()
.unwrap();
let ascii_vec = name_data
.iter()
.map(|num| num.as_u64().unwrap() as u8)
.collect();
let name = String::from_utf8(ascii_vec).unwrap();
if name == "delegate-stack-stx" {
delegate_stack_stx_found = true;