示例#1
0
    def _test_get_info(self):
        print('Test get_info')

        daemon = Daemon()
        res = daemon.get_info()

        # difficulty should be set to 1 for this test
        assert 'difficulty' in res.keys()
        assert res['difficulty'] == 1;

        # nettype should not be TESTNET
        assert 'testnet' in res.keys()
        assert res['testnet'] == False;

        # nettype should not be STAGENET
        assert 'stagenet' in res.keys()
        assert res['stagenet'] == False;

        # nettype should be FAKECHAIN
        assert 'nettype' in res.keys()
        assert res['nettype'] == "fakechain";

        # free_space should be > 0
        assert 'free_space' in res.keys()
        assert res['free_space'] > 0

        # height should be greater or equal to 1
        assert 'height' in res.keys()
        assert res['height'] >= 1
示例#2
0
    def _test_hardfork_info(self):
        print('Test hard_fork_info')

        daemon = Daemon()
        res = daemon.hard_fork_info()

        assert 'earliest_height' in res.keys()
        assert res['earliest_height'] == 1
示例#3
0
    def _test_generateblocks(self, blocks):
        print("Test generating", blocks, 'blocks')

        daemon = Daemon()
        res = daemon.get_info()
        height = res['height']
        res = daemon.generateblocks('42ey1afDFnn4886T7196doS9GPMzexD9gXpsZJDwVjeRVdFCSoHnv7KPbBeGpzJBzHRCAs9UxqeoyFQMYbqSWYTfJJQAWDm', blocks)

        assert res['height'] == height + blocks - 1
示例#4
0
    def _test_hardfork_info(self):
        print('Test hard_fork_info')

        daemon = Daemon()
        res = daemon.hard_fork_info()

        # hard_fork version should be set at height 1
        assert 'earliest_height' in res.keys()
        assert res['earliest_height'] == 1;
示例#5
0
    def _test_generateblocks(self, blocks):
        print("Test generating", blocks, 'blocks')

        daemon = Daemon()
        res = daemon.get_info()
        height = res['height']
        res = daemon.generateblocks(mainnet_address, blocks)

        assert res['height'] == height + blocks - 1
示例#6
0
    def run_test(self):
        daemon = Daemon()
        wallet = Wallet()

        destinations = wallet.make_uniform_destinations(mainnet_address_2, 1, 3)

        self._test_speed_generateblocks(daemon=daemon, blocks=70)
        for i in range(1, 10):
            while wallet.get_balance()['unlocked_balance'] == 0:
                print('Waiting for wallet to refresh...')
                sleep(1)
            self._test_speed_transfer_split(wallet=wallet)
        self._test_speed_generateblocks(daemon=daemon, blocks=10)
示例#7
0
    def run_test(self):
        daemon = Daemon()
        wallet = Wallet()

        destinations = wallet.make_uniform_destinations(
            'XCA1hVzVdYV4SSVG4nPvQY3SFBdHA2HbdGWPsTQsMfYehXVu5ESLsDtMg9WZozzBpR3pPcEnW2iMBVKRP1nkm3TD52Kkyq1Qrt',
            1, 3)

        self._test_speed_generateblocks(daemon=daemon, blocks=70)
        for i in range(1, 10):
            while wallet.get_balance()['unlocked_balance'] == 0:
                print('Waiting for wallet to refresh...')
                sleep(1)
            self._test_speed_transfer_split(wallet=wallet)
        self._test_speed_generateblocks(daemon=daemon, blocks=10)
示例#8
0
文件: speed.py 项目: stabnet/stab
    def run_test(self):
        daemon = Daemon()
        wallet = Wallet()

        destinations = wallet.make_uniform_destinations(
            'WmsuunshyHH8rDL17J7GQK8X7DCN5Pna3JccrFUAj8T33qHF3RDQFvG6XX7q3unRNUCzDpJDMjQGhRAdn3tkVVpJ121abBUCP',
            1, 3)

        self._test_speed_generateblocks(daemon=daemon, blocks=70)
        for i in range(1, 10):
            while wallet.get_balance()['unlocked_balance'] == 0:
                print('Waiting for wallet to refresh...')
                sleep(1)
            self._test_speed_transfer_split(wallet=wallet)
        self._test_speed_generateblocks(daemon=daemon, blocks=10)
示例#9
0
#
# Skip ahead to step 1 if you are reading
#

# Parse arguments
parser = argparse.ArgumentParser()
parser.add_argument("--elementsd-dir", type=str, default="./src")
parser.add_argument("--no-cleanup", default=False, action="store_true")

args = parser.parse_args()

# Setup daemons
alice = Daemon(
    "Alice",
    "elements",
    args.elementsd_dir + "/elementsd",
    "contrib/assets_tutorial/elements1.conf",
    not args.no_cleanup,
)

carol = Daemon(
    "Carol",
    "elements",
    args.elementsd_dir + "/elementsd",
    "contrib/assets_tutorial/elements2.conf",
    not args.no_cleanup,
)

## 1. Start nodes
print ("1. Start nodes and setup scenario")