Exemple #1
0
 def set_test_params(self):
     self.setup_clean_chain = True
     self.num_nodes = 1
     # Set node time to 50 days ago
     self.genesisBlock = createTestGenesisBlock(
         self.signblockpubkey, self.signblockprivkey,
         int(time.time()) - 50 * 24 * 60 * 60 - 10)
Exemple #2
0
    def set_test_params(self):
        """Tests must this method to change default values for number of nodes, topology, etc"""
        self.setup_clean_chain = True
        self.num_nodes = 1
        self.cKey = []
        self.pubkeys = []
        self.secret = [
            "aa3680d5d48a8283413f7a108367c7299ca73f553735860a87b08f39395618b7",
            "82d052c865f5763aad42add438569276c00d3d88a2d062d36b2bae914d58b8c8",
            "c88b703fb08cbea894b6aeff5a544fb92e78a18e19814cd85da83b71f772aa6c",
            "659cbb0e2411a44db63778987b1e22153c086a95eb6b18bdf89de078917abc63",
            "0dbbe8e4ae425a6d2687f1a7e3ba17bc98c673636790f1b8ad91193c05875ef1",
            "0f62d96d6675f32685bbdb8ac13cda7c23436f63efbb9d07700d8669ff12b7c4",
            "388c684f0ba1ef5017716adb5d21a053ea8e90277d0868337519f97bede61418"
        ]

        for i in range(0, len(self.secret)):
            self.cKey.append(CECKey())
            self.cKey[i].set_secretbytes(hex_str_to_bytes(self.secret[i]))
            self.cKey[i].set_compressed(True)
            self.pubkeys.append(self.cKey[i].get_pubkey())

        signblockpubkeys = []
        for i in range(0, len(self.secret)):
            signblockpubkeys.append(bytes_to_hex_str(self.pubkeys[i]))

        self.signblockpubkeys = ""
        for i in range(0, len(self.secret)):
            self.signblockpubkeys += signblockpubkeys[i]
        self.signblockthreshold = 1
        self.genesisBlock = createTestGenesisBlock(self.signblockpubkeys,
                                                   self.signblockthreshold,
                                                   self.secret,
                                                   int(time() - 10))
 def set_test_params(self):
     self.setup_clean_chain = True
     self.num_nodes = 2
     self.mocktime = int(time.time())
     self.genesisBlock = createTestGenesisBlock(self.signblockpubkeys,
                                                self.signblockthreshold,
                                                self.signblockprivkeys,
                                                self.mocktime - 100)
Exemple #4
0
 def set_test_params(self):
     self.num_nodes = 1
     self.setup_clean_chain = True
     self.extra_args = [['-whitelist=127.0.0.1']]
     self.genesisBlock = createTestGenesisBlock(
         self.signblockpubkey, self.signblockprivkey,
         int(time.time()) - 600 * 1000 -
         10)  # long_past_time - 10 for genesis block
 def set_test_params(self):
     self.num_nodes = 4
     self.setup_clean_chain = True
     self.networkid = 2
     self.extra_args = [["-networkid=2"], ["-networkid=2"],
                        ["-networkid=2"], ["-networkid=2"]]
     self.genesisBlock = createTestGenesisBlock(self.signblockpubkey,
                                                self.signblockprivkey)
 def set_test_params(self):
     self.num_nodes = 2
     self.extra_args = [['-txindex'], ['-paytxfee=0.003']]
     self.setup_clean_chain = True
     self.mocktime = 1561689492
     self.signblockpubkey = "0201c537fd7eb7928700927b48e51ceec621fc8ba1177ee2ad67336ed91e2f63a1"
     self.signblockprivkey = "aa3680d5d48a8283413f7a108367c7299ca73f553735860a87b08f39395618b7"
     self.genesisBlock = createTestGenesisBlock(self.signblockpubkey, self.signblockprivkey, self.mocktime - 10)
    def set_test_params(self):
        self.aggpubkeys = [
            "025700236c2890233592fcef262f4520d22af9160e3d9705855140eb2aa06c35d3",
            "03831a69b8009833ab5b0326012eaf489bfea35a7321b1ca15b11d88131423fafc",
            "02bf2027c8455800c7626542219e6208b5fe787483689f1391d6d443ec85673ecf",
            "03b44f1cfcf46aba8bc98e2fd39f137cc43d98ab7792e4848b09c06198b042ca8b",
            "02b9a609d6bec0fdc9ba690986013cf7bbd13c54ffc25e6cf30916b4732c4a952a",
            "02e78cafe033b22bda5d7d1c8e82ee932930bf12e08489bc19769cbec765568be9",
            "02473757a955a23f75379820f3071abf5b3343b78eb54e52373d06259ffa6c550b"
        ]

        self.aggprivkey = [
            "67ae3f5bfb3464b9704d7bd3a134401cc80c3a172240ebfca9f1e40f51bb6d37",
            "dbb9d19637018267268dfc2cc7aec07e7217c1a2d6733e1184a0909273bf078b",
            "aa2c70c4b85a09be514292d04b27bbb0cc3f86d306d58fe87743d10a095ada07",
            "3087d8decc5f951f19a442397cf1eba1e2b064e68650c346502780b56454c6e2",
            "6125c8d4330941944cc6cc3e775e8620c479a5901ad627e6e734c6a6f7377428",
            "1c3e5453c0f9aa74a8eb0216310b2b013f017813a648fce364bf41dbc0b37647",
            "ea9fe9fd2f1761fc6f1f0f23eb4d4141d7b05f2b95a1b7a9912cd97bddd9036c"
        ]

        self.aggprivkey_wif = [
            "cR4F4fGuKjDWxiYDtGtyM77WkrVhTgokVyM2ERxoxp7R4RQP9dgE",
            "cUwpWhH9CbYwjUWzfz1UVaSjSQm9ALXWRqeFFiZKnn8cV6wqNXQA",
            "cTHVmjaAwKtU75t89fg42SLx43nRxhsri6YY1Eynvs1V1tPRCfae",
            "cPD3D5AvmXhw7NGxQeaRhTVNW2UoYeibQAMhye7jzyM4ETG9d1ez",
            "cQqYVqYhK47EWvDViNwcyhc6sLS6tkuhED7T3rvumeGRtVJcEQHh",
            "cNXbwddRQrPR4k7Us7eSrRUHFBerNBKwxrExTSs4gdH1rjHdoNuL",
            "cVSnGe9DzWfEgahMjSXs5nuVqnwvyanG9aaEQF6m7M5mSY2wfZzW"
        ]

        self.blocks = []

        self.coinbase_key = CECKey()
        self.coinbase_key.set_secretbytes(
            bytes.fromhex(
                "12b004fff7f4b69ef8650e767f18f11ede158148b425660723b9f9a66e61f747"
            ))

        self.schnorr_key = Schnorr()
        self.schnorr_key.set_secretbytes(
            bytes.fromhex(
                "12b004fff7f4b69ef8650e767f18f11ede158148b425660723b9f9a66e61f747"
            ))

        self.num_nodes = 1
        self.sig_scheme = 0
        self.setup_clean_chain = True
        self.genesisBlock = createTestGenesisBlock(self.aggpubkeys[0],
                                                   self.aggprivkey[0],
                                                   int(time.time() - 100))
Exemple #8
0
    def set_test_params(self):
        self.aggpubkeys = [
            "025700236c2890233592fcef262f4520d22af9160e3d9705855140eb2aa06c35d3",
            "03831a69b8009833ab5b0326012eaf489bfea35a7321b1ca15b11d88131423fafc",
            "02bf2027c8455800c7626542219e6208b5fe787483689f1391d6d443ec85673ecf",
            "03b44f1cfcf46aba8bc98e2fd39f137cc43d98ab7792e4848b09c06198b042ca8b",
            "02b9a609d6bec0fdc9ba690986013cf7bbd13c54ffc25e6cf30916b4732c4a952a",
            "02e78cafe033b22bda5d7d1c8e82ee932930bf12e08489bc19769cbec765568be9",
            "02473757a955a23f75379820f3071abf5b3343b78eb54e52373d06259ffa6c550b"
        ]

        self.aggprivkey = [
            "67ae3f5bfb3464b9704d7bd3a134401cc80c3a172240ebfca9f1e40f51bb6d37",
            "dbb9d19637018267268dfc2cc7aec07e7217c1a2d6733e1184a0909273bf078b",
            "aa2c70c4b85a09be514292d04b27bbb0cc3f86d306d58fe87743d10a095ada07",
            "3087d8decc5f951f19a442397cf1eba1e2b064e68650c346502780b56454c6e2",
            "6125c8d4330941944cc6cc3e775e8620c479a5901ad627e6e734c6a6f7377428",
            "1c3e5453c0f9aa74a8eb0216310b2b013f017813a648fce364bf41dbc0b37647",
            "ea9fe9fd2f1761fc6f1f0f23eb4d4141d7b05f2b95a1b7a9912cd97bddd9036c"
        ]

        self.blocks = []

        self.coinbase_key = CECKey()
        self.coinbase_key.set_secretbytes(
            bytes.fromhex(
                "12b004fff7f4b69ef8650e767f18f11ede158148b425660723b9f9a66e61f747"
            ))

        self.schnorr_key = Schnorr()
        self.schnorr_key.set_secretbytes(
            bytes.fromhex(
                "12b004fff7f4b69ef8650e767f18f11ede158148b425660723b9f9a66e61f747"
            ))

        self.num_nodes = 1
        self.sig_scheme = 0
        self.setup_clean_chain = True
        self.genesisBlock = createTestGenesisBlock(self.aggpubkeys[0],
                                                   self.aggprivkey[0],
                                                   int(time.time() - 100))
 def set_test_params(self):
     self.setup_clean_chain = True
     self.num_nodes = 1
     self.genesisBlock = createTestGenesisBlock(self.signblockpubkeys, self.signblockthreshold, self.signblockprivkeys)