@@ -1601,7 +1601,6 @@ async fn rpc_getblocktemplate_mining_address(use_p2pkh: bool) {
1601
1601
amount:: NonNegative ,
1602
1602
block:: { Hash , MAX_BLOCK_BYTES , ZCASH_BLOCK_VERSION } ,
1603
1603
chain_sync_status:: MockSyncStatus ,
1604
- parameters:: NetworkKind ,
1605
1604
serialization:: DateTime32 ,
1606
1605
transaction:: { zip317, VerifiedUnminedTx } ,
1607
1606
work:: difficulty:: { CompactDifficulty , ExpandedDifficulty , U256 } ,
@@ -1633,15 +1632,21 @@ async fn rpc_getblocktemplate_mining_address(use_p2pkh: bool) {
1633
1632
let mut mock_sync_status = MockSyncStatus :: default ( ) ;
1634
1633
mock_sync_status. set_is_close_to_tip ( true ) ;
1635
1634
1636
- let network = NetworkKind :: Mainnet ;
1635
+ let network = Network :: Mainnet ;
1637
1636
let miner_address = match use_p2pkh {
1638
- false => Some ( transparent:: Address :: from_script_hash ( network, [ 0x7e ; 20 ] ) ) ,
1639
- true => Some ( transparent:: Address :: from_pub_key_hash ( network, [ 0x7e ; 20 ] ) ) ,
1637
+ false => Some ( transparent:: Address :: from_script_hash (
1638
+ network. kind ( ) ,
1639
+ [ 0x7e ; 20 ] ,
1640
+ ) ) ,
1641
+ true => Some ( transparent:: Address :: from_pub_key_hash (
1642
+ network. kind ( ) ,
1643
+ [ 0x7e ; 20 ] ,
1644
+ ) ) ,
1640
1645
} ;
1641
1646
1642
1647
#[ allow( clippy:: unnecessary_struct_initialization) ]
1643
1648
let mining_config = crate :: config:: mining:: Config {
1644
- miner_address,
1649
+ miner_address : miner_address . clone ( ) ,
1645
1650
extra_coinbase_data : None ,
1646
1651
debug_like_zcashd : true ,
1647
1652
// TODO: Use default field values when optional features are enabled in tests #8183
@@ -1727,6 +1732,19 @@ async fn rpc_getblocktemplate_mining_address(use_p2pkh: bool) {
1727
1732
panic ! ( "this getblocktemplate call without parameters should return the `TemplateMode` variant of the response" )
1728
1733
} ;
1729
1734
1735
+ let coinbase_transaction =
1736
+ Transaction :: zcash_deserialize ( get_block_template. coinbase_txn . data . as_ref ( ) )
1737
+ . expect ( "coinbase transaction data should be deserializable" ) ;
1738
+
1739
+ assert_eq ! (
1740
+ coinbase_transaction
1741
+ . outputs( )
1742
+ . first( )
1743
+ . unwrap( )
1744
+ . address( & network) ,
1745
+ miner_address
1746
+ ) ;
1747
+
1730
1748
assert_eq ! (
1731
1749
get_block_template. capabilities,
1732
1750
GET_BLOCK_TEMPLATE_CAPABILITIES_FIELD . to_vec( )
0 commit comments