Skip to content

Commit 9cfb3cf

Browse files
committed
Update testmempoolaccept RPC
1 parent 06a6c15 commit 9cfb3cf

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

integration_test/src/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -762,12 +762,12 @@ fn test_test_mempool_accept(cl: &Client) {
762762
let tx =
763763
cl.create_raw_transaction(&[input.clone()], &output, Some(500_000), Some(false)).unwrap();
764764
let res = cl.test_mempool_accept(&[&tx]).unwrap();
765-
assert!(!res[0].allowed);
765+
assert!(res[0].allowed.is_some() && !res[0].allowed.unwrap());
766766
assert!(res[0].reject_reason.is_some());
767767
let signed =
768768
cl.sign_raw_transaction_with_wallet(&tx, None, None).unwrap().transaction().unwrap();
769769
let res = cl.test_mempool_accept(&[&signed]).unwrap();
770-
assert!(res[0].allowed, "not allowed: {:?}", res[0].reject_reason);
770+
assert!(res[0].allowed.unwrap(), "not allowed: {:?}", res[0].reject_reason);
771771
}
772772

773773
fn test_wallet_create_funded_psbt(cl: &Client) {

json/src/lib.rs

+11-4
Original file line numberDiff line numberDiff line change
@@ -833,23 +833,30 @@ impl SignRawTransactionResult {
833833
#[derive(Clone, PartialEq, Eq, Debug, Deserialize, Serialize)]
834834
pub struct TestMempoolAcceptResult {
835835
pub txid: bitcoin::Txid,
836-
pub allowed: bool,
837-
#[serde(rename = "reject-reason")]
838-
pub reject_reason: Option<String>,
836+
pub wtxid: bitcoin::Txid,
837+
#[serde(rename = "package-error")]
838+
pub package_error: Option<String>,
839+
pub allowed: Option<bool>,
839840
/// Virtual transaction size as defined in BIP 141 (only present when 'allowed' is true)
840841
/// Added in Bitcoin Core v0.21
841842
pub vsize: Option<u64>,
842843
/// Transaction fees (only present if 'allowed' is true)
843844
/// Added in Bitcoin Core v0.21
844845
pub fees: Option<TestMempoolAcceptResultFees>,
846+
#[serde(rename = "reject-reason")]
847+
pub reject_reason: Option<String>,
845848
}
846849

847850
#[derive(Clone, PartialEq, Eq, Debug, Deserialize, Serialize)]
848851
pub struct TestMempoolAcceptResultFees {
849852
/// Transaction fee in BTC
850853
#[serde(with = "bitcoin::amount::serde::as_btc")]
851854
pub base: Amount,
852-
// unlike GetMempoolEntryResultFees, this only has the `base` fee
855+
/// The effective feerate per KvB
856+
#[serde(rename = "effective-feerate", with = "bitcoin::amount::serde::as_btc")]
857+
pub effective_feerate: Amount,
858+
#[serde(rename = "effective-includes")]
859+
pub effective_includes: Vec<String>,
853860
}
854861

855862
#[derive(Copy, Clone, PartialEq, Eq, Debug, Deserialize, Serialize)]

0 commit comments

Comments
 (0)