Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 4 Functional Tests #192

Merged
merged 2 commits into from Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()