Skip to content

Commit 7ba4142

Browse files
committed
test: add tx_rate assertion to get_chain_tx_stats
Change to a Default wallet and fund/mine so we get transactions for `GetChainTxStats` to report meaningful data.
1 parent 687119b commit 7ba4142

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

integration_test/tests/blockchain.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,15 @@ fn blockchain__get_chain_tips__modelled() {
218218

219219
#[test]
220220
fn blockchain__get_chain_tx_stats__modelled() {
221-
let node = Node::with_wallet(Wallet::None, &[]);
221+
let node = Node::with_wallet(Wallet::Default, &[]);
222+
node.fund_wallet();
223+
let (_address, _tx) = node.create_mined_transaction();
222224

223225
let json: GetChainTxStats = node.client.get_chain_tx_stats().expect("getchaintxstats");
224226
let model: Result<mtype::GetChainTxStats, GetChainTxStatsError> = json.into_model();
225-
model.unwrap();
227+
let chain_tx_stats = model.unwrap();
228+
229+
assert!(chain_tx_stats.tx_rate.unwrap() > 0.0);
226230
}
227231

228232
#[test]

0 commit comments

Comments
 (0)