-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend block merkle root by hash of account changes (#337)
Signed-off-by: Anthony Fieroni <[email protected]> Co-authored-by: monstrobishi <[email protected]>
- Loading branch information
1 parent
0eac646
commit dd89fc9
Showing
12 changed files
with
152 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/usr/bin/env python3 | ||
# Copyright (c) 2014-2019 The Bitcoin Core developers | ||
# Copyright (c) DeFi Blockchain Developers | ||
# Distributed under the MIT software license, see the accompanying | ||
# file LICENSE or http://www.opensource.org/licenses/mit-license.php. | ||
"""Test account mining behaviour""" | ||
|
||
from test_framework.test_framework import DefiTestFramework | ||
from test_framework.util import assert_equal | ||
|
||
class AccountsValidatingTest(DefiTestFramework): | ||
def set_test_params(self): | ||
self.num_nodes = 2 | ||
self.setup_clean_chain = True | ||
self.extra_args = [ | ||
['-txnotokens=0', '-amkheight=50', '-eunosheight=101'], | ||
['-txnotokens=0', '-amkheight=50', '-eunosheight=101'], | ||
] | ||
|
||
def run_test(self): | ||
node = self.nodes[0] | ||
node1 = self.nodes[1] | ||
node.generate(101) | ||
self.sync_all() | ||
|
||
assert_equal(node.getblockcount(), 101) # eunos | ||
|
||
# Get addresses and set up account | ||
account = node.getnewaddress() | ||
destination = node.getnewaddress() | ||
node.utxostoaccount({account: "10@0"}) | ||
node.generate(1) | ||
self.sync_all() | ||
|
||
# Check we have expected balance | ||
assert_equal(node1.getaccount(account)[0], "10.00000000@DFI") | ||
|
||
node.accounttoaccount(account, {destination: "1@DFI"}) | ||
node.accounttoutxos(account, {destination: "1@DFI"}) | ||
node.accounttoutxos(account, {destination: "2@DFI"}) | ||
|
||
# Store block height | ||
blockcount = node.getblockcount() | ||
|
||
# Generate a block | ||
node.generate(1) | ||
self.sync_all() | ||
|
||
# Check the blockchain has extended as expected | ||
assert_equal(node1.getblockcount(), blockcount + 1) | ||
|
||
if __name__ == '__main__': | ||
AccountsValidatingTest().main () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters