Skip to content

Commit

Permalink
Merge pull request #192 from Jongjan88/minipr2
Browse files Browse the repository at this point in the history
Fix 4 Functional Tests
  • Loading branch information
ycagel authored Mar 11, 2024
2 parents 8a26836 + f79ce55 commit 3fd7c74
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
5 changes: 2 additions & 3 deletions test/functional/rpc_createmultisig.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import os

from test_framework.blocktools import (
COINBASE_MATURITY,
COINBASE_MATURITY_2,
)
from test_framework.authproxy import JSONRPCException
Expand Down Expand Up @@ -128,7 +127,7 @@ def checkbalances(self):

height = node0.getblockchaininfo()["blocks"]
assert 150 < height < 350
total = (height - COINBASE_MATURITY) * 72000
total = (height - COINBASE_MATURITY_2) * 72000
assert bal1 == 0
assert bal2 == self.moved
assert bal0 + bal1 + bal2 == total
Expand Down Expand Up @@ -228,4 +227,4 @@ def do_multisig(self):


if __name__ == '__main__':
RpcCreateMultiSigTest().main()
RpcCreateMultiSigTest().main()
15 changes: 8 additions & 7 deletions test/functional/wallet_coinbase_category.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Tests listtransactions, listsinceblock, and gettransaction.
"""

from test_framework.blocktools import COINBASE_MATURITY
from test_framework.blocktools import COINBASE_MATURITY_2
from test_framework.test_framework import DigiByteTestFramework
from test_framework.util import (
assert_array_result
Expand Down Expand Up @@ -37,24 +37,25 @@ def run_test(self):
self.generatetoaddress(self.nodes[0], 1, address)
hash = self.nodes[0].getbestblockhash()
txid = self.nodes[0].getblock(hash)["tx"][0]


# Coinbase transaction is immature after 1 confirmation
self.assert_category("immature", address, txid, 0)

# Mine another 8-1 blocks on top
self.generate(self.nodes[0], COINBASE_MATURITY - 1)
# Coinbase transaction is still immature after 7 confirmations
self.assert_category("immature", address, txid, 7)
# Mine another 99 blocks on top
self.generate(self.nodes[0], COINBASE_MATURITY_2 - 1)
# Coinbase transaction is still immature after 100 confirmations
self.assert_category("immature", address, txid, 99)

# Mine one more block
self.generate(self.nodes[0], 1)
# Coinbase transaction is now matured, so category is "generate"
self.assert_category("generate", address, txid, 8)
self.assert_category("generate", address, txid, 100)

# Orphan block that paid to address
self.nodes[0].invalidateblock(hash)
# Coinbase transaction is now orphaned
self.assert_category("orphan", address, txid, 8)
self.assert_category("orphan", address, txid, 100)

if __name__ == '__main__':
CoinbaseCategoryTest().main()

0 comments on commit 3fd7c74

Please sign in to comment.