mining: rename getCoinbaseTx() to ..RawTx()
This frees up the name getCoinbaseTx() for the next commit. Changing a function name does not impact IPC clients, as they only consider the function signature and sequence number.
This commit is contained in:
5 files changed
+21
-5
No files matched your search
@@ -0,0 +1,5 @@
|
|||||||
|
Mining IPC
|
||||||
|
----------
|
||||||
|
|
||||||
|
- The `getCoinbaseTx()` method is renamed to `getCoinbaseRawTx()`.
|
||||||
|
IPC clients do not use the function name, so they're not affected. (#33819)
|
||||||
+12
-1
@@ -42,8 +42,19 @@ public:
|
|||||||
// Sigop cost per transaction, not including coinbase transaction.
|
// Sigop cost per transaction, not including coinbase transaction.
|
||||||
virtual std::vector<int64_t> getTxSigops() = 0;
|
virtual std::vector<int64_t> getTxSigops() = 0;
|
||||||
|
|
||||||
virtual CTransactionRef getCoinbaseTx() = 0;
|
/**
|
||||||
|
* Return serialized dummy coinbase transaction.
|
||||||
|
*/
|
||||||
|
virtual CTransactionRef getCoinbaseRawTx() = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return scriptPubKey with SegWit OP_RETURN.
|
||||||
|
*/
|
||||||
virtual std::vector<unsigned char> getCoinbaseCommitment() = 0;
|
virtual std::vector<unsigned char> getCoinbaseCommitment() = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return which output in the dummy coinbase contains the SegWit OP_RETURN.
|
||||||
|
*/
|
||||||
virtual int getWitnessCommitmentIndex() = 0;
|
virtual int getWitnessCommitmentIndex() = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ interface BlockTemplate $Proxy.wrap("interfaces::BlockTemplate") {
|
|||||||
getBlock @2 (context: Proxy.Context) -> (result: Data);
|
getBlock @2 (context: Proxy.Context) -> (result: Data);
|
||||||
getTxFees @3 (context: Proxy.Context) -> (result: List(Int64));
|
getTxFees @3 (context: Proxy.Context) -> (result: List(Int64));
|
||||||
getTxSigops @4 (context: Proxy.Context) -> (result: List(Int64));
|
getTxSigops @4 (context: Proxy.Context) -> (result: List(Int64));
|
||||||
getCoinbaseTx @5 (context: Proxy.Context) -> (result: Data);
|
getCoinbaseRawTx @5 (context: Proxy.Context) -> (result: Data);
|
||||||
getCoinbaseCommitment @6 (context: Proxy.Context) -> (result: Data);
|
getCoinbaseCommitment @6 (context: Proxy.Context) -> (result: Data);
|
||||||
getWitnessCommitmentIndex @7 (context: Proxy.Context) -> (result: Int32);
|
getWitnessCommitmentIndex @7 (context: Proxy.Context) -> (result: Int32);
|
||||||
getCoinbaseMerklePath @8 (context: Proxy.Context) -> (result: List(Data));
|
getCoinbaseMerklePath @8 (context: Proxy.Context) -> (result: List(Data));
|
||||||
|
|||||||
@@ -888,7 +888,7 @@ public:
|
|||||||
return m_block_template->vTxSigOpsCost;
|
return m_block_template->vTxSigOpsCost;
|
||||||
}
|
}
|
||||||
|
|
||||||
CTransactionRef getCoinbaseTx() override
|
CTransactionRef getCoinbaseRawTx() override
|
||||||
{
|
{
|
||||||
return m_block_template->block.vtx[0];
|
return m_block_template->block.vtx[0];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ class IPCInterfaceTest(BitcoinTestFramework):
|
|||||||
return block
|
return block
|
||||||
|
|
||||||
async def parse_and_deserialize_coinbase_tx(self, block_template, ctx):
|
async def parse_and_deserialize_coinbase_tx(self, block_template, ctx):
|
||||||
coinbase_data = BytesIO((await block_template.getCoinbaseTx(ctx)).result)
|
coinbase_data = BytesIO((await block_template.getCoinbaseRawTx(ctx)).result)
|
||||||
tx = CTransaction()
|
tx = CTransaction()
|
||||||
tx.deserialize(coinbase_data)
|
tx.deserialize(coinbase_data)
|
||||||
return tx
|
return tx
|
||||||
@@ -191,7 +191,7 @@ class IPCInterfaceTest(BitcoinTestFramework):
|
|||||||
assert_equal(len(txfees.result), 0)
|
assert_equal(len(txfees.result), 0)
|
||||||
txsigops = await template.getTxSigops(ctx)
|
txsigops = await template.getTxSigops(ctx)
|
||||||
assert_equal(len(txsigops.result), 0)
|
assert_equal(len(txsigops.result), 0)
|
||||||
coinbase_data = BytesIO((await template.getCoinbaseTx(ctx)).result)
|
coinbase_data = BytesIO((await template.getCoinbaseRawTx(ctx)).result)
|
||||||
coinbase = CTransaction()
|
coinbase = CTransaction()
|
||||||
coinbase.deserialize(coinbase_data)
|
coinbase.deserialize(coinbase_data)
|
||||||
assert_equal(coinbase.vin[0].prevout.hash, 0)
|
assert_equal(coinbase.vin[0].prevout.hash, 0)
|
||||||
|
|||||||
Reference in new issue
Block a user