mirror of
https://github.com/alexgo-io/bitcoin-indexer.git
synced 2026-01-12 16:52:57 +08:00
fix: test warns and errors
This commit is contained in:
@@ -41,7 +41,7 @@ pub fn generate_test_stacks_block(
|
||||
(
|
||||
BlockIdentifier {
|
||||
index: block_height - 1,
|
||||
hash: to_hex(&parent_hash[..]),
|
||||
hash: hex::encode(&parent_hash[..]),
|
||||
},
|
||||
None,
|
||||
)
|
||||
@@ -51,7 +51,7 @@ pub fn generate_test_stacks_block(
|
||||
BlockEvent::Block(StacksBlockData {
|
||||
block_identifier: BlockIdentifier {
|
||||
index: block_height,
|
||||
hash: to_hex(&hash[..]),
|
||||
hash: hex::encode(&hash[..]),
|
||||
},
|
||||
parent_block_identifier,
|
||||
timestamp: 0,
|
||||
|
||||
@@ -92,12 +92,12 @@ pub fn generate_test_tx_bitcoin_p2pkh_transfer(
|
||||
.into_script();
|
||||
let outputs = vec![TxOut {
|
||||
value: amount,
|
||||
script_pubkey: format!("0x{}", to_hex(script.as_bytes())),
|
||||
script_pubkey: format!("0x{}", hex::encode(script.as_bytes())),
|
||||
}];
|
||||
|
||||
BitcoinTransactionData {
|
||||
transaction_identifier: TransactionIdentifier {
|
||||
hash: format!("0x{}", to_hex(&hash[..])),
|
||||
hash: format!("0x{}", hex::encode(&hash[..])),
|
||||
},
|
||||
operations: vec![],
|
||||
metadata: BitcoinTransactionMetadata {
|
||||
|
||||
@@ -18,9 +18,8 @@ use chainhook_types::{
|
||||
StacksBlockUpdate, StacksChainEvent, StacksChainUpdatedWithBlocksData, StacksNetwork,
|
||||
};
|
||||
use hiro_system_kit;
|
||||
use std::collections::{BTreeMap, HashMap, HashSet};
|
||||
use std::collections::BTreeMap;
|
||||
use std::sync::mpsc::{channel, Sender};
|
||||
use std::sync::{Arc, RwLock};
|
||||
|
||||
use super::ObserverEvent;
|
||||
|
||||
@@ -132,7 +131,7 @@ fn generate_and_register_new_stacks_chainhook(
|
||||
ChainhookSpecification::Stacks(chainhook.clone()),
|
||||
));
|
||||
assert!(match observer_events_rx.recv() {
|
||||
Ok(ObserverEvent::PredicateRegistered(registered_chainhook)) => {
|
||||
Ok(ObserverEvent::PredicateRegistered(_)) => {
|
||||
// assert_eq!(
|
||||
// ChainhookSpecification::Stacks(chainhook.clone()),
|
||||
// registered_chainhook
|
||||
@@ -145,7 +144,7 @@ fn generate_and_register_new_stacks_chainhook(
|
||||
ChainhookSpecification::Stacks(chainhook.clone()),
|
||||
));
|
||||
assert!(match observer_events_rx.recv() {
|
||||
Ok(ObserverEvent::PredicateEnabled(registered_chainhook)) => {
|
||||
Ok(ObserverEvent::PredicateEnabled(_)) => {
|
||||
// assert_eq!(
|
||||
// ChainhookSpecification::Bitcoin(chainhook.clone()),
|
||||
// registered_chainhook
|
||||
@@ -176,7 +175,7 @@ fn generate_and_register_new_bitcoin_chainhook(
|
||||
ChainhookSpecification::Bitcoin(chainhook.clone()),
|
||||
));
|
||||
assert!(match observer_events_rx.recv() {
|
||||
Ok(ObserverEvent::PredicateRegistered(registered_chainhook)) => {
|
||||
Ok(ObserverEvent::PredicateRegistered(_)) => {
|
||||
// assert_eq!(
|
||||
// ChainhookSpecification::Bitcoin(chainhook.clone()),
|
||||
// registered_chainhook
|
||||
@@ -186,7 +185,7 @@ fn generate_and_register_new_bitcoin_chainhook(
|
||||
_ => false,
|
||||
});
|
||||
assert!(match observer_events_rx.recv() {
|
||||
Ok(ObserverEvent::PredicateEnabled(registered_chainhook)) => {
|
||||
Ok(ObserverEvent::PredicateEnabled(_)) => {
|
||||
// assert_eq!(
|
||||
// ChainhookSpecification::Bitcoin(chainhook.clone()),
|
||||
// registered_chainhook
|
||||
@@ -471,7 +470,7 @@ fn test_stacks_chainhook_auto_deregister() {
|
||||
ChainhookSpecification::Stacks(chainhook.clone()),
|
||||
));
|
||||
assert!(match observer_events_rx.recv() {
|
||||
Ok(ObserverEvent::PredicateRegistered(registered_chainhook)) => {
|
||||
Ok(ObserverEvent::PredicateRegistered(_)) => {
|
||||
// assert_eq!(
|
||||
// ChainhookSpecification::Stacks(chainhook.clone()),
|
||||
// registered_chainhook
|
||||
|
||||
22
tests/zest-onboard-user.json
Normal file
22
tests/zest-onboard-user.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"uuid": "1",
|
||||
"name": "Stacking.club Events",
|
||||
"chain": "stacks",
|
||||
"version": 1,
|
||||
"networks": {
|
||||
"testnet": {
|
||||
"start_block": 1,
|
||||
"end_block": 103672,
|
||||
"if_this": {
|
||||
"contains": "onboard-user",
|
||||
"contract_identifier": "ST3AXH4EBHD63FCFPTZ8GR29TNTVWDYPGY0KDY5E5.globals",
|
||||
"scope": "print_event"
|
||||
},
|
||||
"then_that": {
|
||||
"file_append": {
|
||||
"path": "zest-results.txt"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
7
tests/zest-results.txt
Normal file
7
tests/zest-results.txt
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user