예제 #1
0
def test_pending_rps_match_expiration ():
    unsigned_tx_hex = bitcoin.transaction(rps.compose(db, source_default, 5, 11021664, move_random_hash_default, 10), encoding='multisig')
    rps1 = parse_hex(unsigned_tx_hex)
    check_movment(db, 'debit', rps1['block_index'], source_default, 'XCH', 11021664, rps1['tx_hash'])

    unsigned_tx_hex = bitcoin.transaction(rps.compose(db, destination_default, 5, 11021664, move_random_hash_default, 10), encoding='multisig')
    rps2 = parse_hex(unsigned_tx_hex)
    check_movment(db, 'debit', rps2['block_index'], destination_default, 'XCH', 11021664, rps2['tx_hash'])

    block_progress(25)
    expiration_block = rps2['block_index']+21

    # re-credit expired rps
    check_movment(db, 'credit', expiration_block, source_default, 'XCH', 11021664, rps1['tx_hash'] + rps2['tx_hash'])
    check_movment(db, 'credit', expiration_block, destination_default, 'XCH', 11021664, rps1['tx_hash'] + rps2['tx_hash'])
예제 #2
0
def test_rpsresolve ():
    rps_match_id = '58f7b0780592032e4d8602a3e8690fb2c701b2e1dd546e703445aabd6469734d77adfc95029e73b173f60e556f915b0cd8850848111358b1c370fb7c154e61fd'
    unsigned_tx_hex = bitcoin.transaction(rpsresolve.compose(db, source_default, 3, rps_random_default, rps_match_id), encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #3
0
def test_btcpay ():
    order_match_id = 'dbc1b4c900ffe48d575b5da5c638040125f65db0fe3e24494b76ea986457d986084fed08b978af4d7d196a7446a86b58009e636b611db16211b65a9aadff29c5'
    unsigned_tx_hex = bitcoin.transaction(btcpay.compose(db, source_default, order_match_id), encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #4
0
def check_ouputs(tx_name, method, inputs, outputs, error, records, counterpartyd_db):
    try:
        tested_module = sys.modules['lib.{}'.format(tx_name)]
    except KeyError:    # TODO: hack
        tested_module = sys.modules['lib.messages.{}'.format(tx_name)]
    tested_method = getattr(tested_module, method)

    test_outputs = None
    if error is not None:
        with pytest.raises(getattr(exceptions, error[0])) as exception:
            test_outputs = exec_tested_method(tx_name, method, tested_method, inputs, counterpartyd_db)
    else:
        test_outputs = exec_tested_method(tx_name, method, tested_method, inputs, counterpartyd_db)
        if pytest.config.option.gentxhex and method == 'compose':
            print('')
            tx_params = {
                'encoding': 'multisig'
            }
            if tx_name == 'order' and inputs[1]=='BTC':
                print('give btc')
                tx_params['fee_provided'] = DP['fee_provided']
            unsigned_tx_hex = bitcoin.transaction(counterpartyd_db, test_outputs, **tx_params)
            print(tx_name)
            print(unsigned_tx_hex)

    if outputs is not None:
        assert outputs == test_outputs
    if error is not None:
        assert str(exception.value) == error[1]
    if records is not None:
        for record in records:
            check_record(record, counterpartyd_db)
예제 #5
0
def test_counter_rpsresolve ():
    rps_match_id = '58f7b0780592032e4d8602a3e8690fb2c701b2e1dd546e703445aabd6469734d77adfc95029e73b173f60e556f915b0cd8850848111358b1c370fb7c154e61fd'
    unsigned_tx_hex = bitcoin.transaction(rpsresolve.compose(db, destination_default, 5, 'fa765e80203cba24a298e4458f63ff6b', rps_match_id), encoding='multisig')
    
    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #6
0
파일: test_.py 프로젝트: pepeteam/kekdaqd
def test_rps():
    unsigned_tx_hex = bitcoin.transaction(rps.compose(
        db, source_default, 5, 11021663, move_random_hash_default, 100),
                                          encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #7
0
파일: test_.py 프로젝트: damoos3/kekdaqd
def test_callback():
    unsigned_tx_hex = bitcoin.transaction(callback.compose(
        db, source_default, .3, 'BBBC'),
                                          encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #8
0
파일: test_.py 프로젝트: damoos3/kekdaqd
def test_overburn():
    unsigned_tx_hex = bitcoin.transaction(
        burn.compose(db, source_default, (1 * config.UNIT), overburn=True),
        encoding='multisig')  # Try to burn a whole 'nother BTC.

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #9
0
파일: test_.py 프로젝트: damoos3/kekdaqd
def test_order_to_be_cancelled():
    unsigned_tx_hex = bitcoin.transaction(order.compose(
        db, source_default, 'BBBB', small, config.XCP, small, expiration, 0),
                                          encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #10
0
파일: test_.py 프로젝트: damoos3/kekdaqd
def test_dividend_indivisible():
    unsigned_tx_hex = bitcoin.transaction(dividend.compose(
        db, source_default, 800, 'BBBC', config.XCP),
                                          encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #11
0
파일: test_.py 프로젝트: damoos3/kekdaqd
def test_burn():
    unsigned_tx_hex = bitcoin.transaction(burn.compose(db, source_default,
                                                       int(.62 * quantity)),
                                          encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #12
0
def test_pending_and_resolved_rps_match_expiration ():
    unsigned_tx_hex = bitcoin.transaction(rps.compose(db, source_default, 5, 11021665, move_random_hash_default, 10), encoding='multisig')
    rps1 = parse_hex(unsigned_tx_hex)
    check_movment(db, 'debit', rps1['block_index'], source_default, 'XCP', 11021665, rps1['tx_hash'])

    unsigned_tx_hex = bitcoin.transaction(rps.compose(db, destination_default, 5, 11021665, move_random_hash_default, 10), encoding='multisig')
    rps2 = parse_hex(unsigned_tx_hex)
    check_movment(db, 'debit', rps2['block_index'], destination_default, 'XCP', 11021665, rps2['tx_hash'])

    rps_match_id = rps1['tx_hash'] + rps2['tx_hash']
    unsigned_tx_hex = bitcoin.transaction(rpsresolve.compose(db, source_default, 3, rps_random_default, rps_match_id), encoding='multisig')
    rps_match = parse_hex(unsigned_tx_hex)

    block_progress(25)
    expiration_block = rps_match['block_index']+20
    
    # resolved game wins
    check_movment(db, 'credit', expiration_block, source_default, 'XCP', 2 * 11021665, rps_match_id)
예제 #13
0
파일: test_.py 프로젝트: caseyparker/sacoin
def test_order_buy_xcp():
    unsigned_tx_hex = bitcoin.transaction(order.compose(
        db, source_default, 'BTC', small, 'XCP', small * 2, expiration, 0),
                                          encoding='multisig',
                                          fee_provided=fee_provided)

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #14
0
def test_bet_bearcfd_to_be_liquidated():
    unsigned_tx_hex = bitcoin.transaction(
        bet.compose(db, source_default, source_default, 1, 1388000100,
                    round(small / 2), round(small * .83), 0.0, 15120,
                    expiration), True)

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #15
0
def test_rpsresolve():
    rps_match_id = '58f7b0780592032e4d8602a3e8690fb2c701b2e1dd546e703445aabd6469734d77adfc95029e73b173f60e556f915b0cd8850848111358b1c370fb7c154e61fd'
    unsigned_tx_hex = bitcoin.transaction(rpsresolve.compose(
        db, source_default, 3, rps_random_default, rps_match_id),
                                          encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #16
0
def test_cancel():
    unsigned_tx_hex = bitcoin.transaction(cancel.compose(
        db, source_default,
        '2f0fd1e89b8de1d57292742ec380ea47066e307ad645f5bc3adad8a06ff58608'),
                                          encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #17
0
def test_issuance_divisible():
    unsigned_tx_hex = bitcoin.transaction(issuance.compose(
        db, source_default, None, 'BBBB', quantity * 10, True, False, 0, 0.0,
        ''),
                                          encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #18
0
def test_send_indivisible():
    unsigned_tx_hex = bitcoin.transaction(send.compose(
        db, source_default, destination_default, 'BBBC',
        round(quantity / 190000)),
                                          encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #19
0
def test_send_callable():
    unsigned_tx_hex = bitcoin.transaction(send.compose(db, source_default,
                                                       destination_default,
                                                       'BBBC', 10000),
                                          encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #20
0
def test_send():
    unsigned_tx_hex = bitcoin.transaction(send.compose(db, source_default,
                                                       destination_default,
                                                       config.XCP, small),
                                          encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #21
0
def test_order_sell_xcp():
    unsigned_tx_hex = bitcoin.transaction(order.compose(
        db, source_default, config.XCP, round(small * 2.1), config.BTC, small,
        expiration, fee_required),
                                          encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #22
0
def test_broadcast_liquidate():
    unsigned_tx_hex = bitcoin.transaction(broadcast.compose(
        db, source_default, 1388000050, round(100 - (.415 / 3) - .00001, 5),
        fee_multiplier_default, 'Unit Test'),
                                          encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #23
0
def test_pending_and_resolved_rps_match_expiration ():
    unsigned_tx_hex = bitcoin.transaction(rps.compose(db, source_default, 5, 11021665, move_random_hash_default, 10), encoding='multisig')
    rps1 = parse_hex(unsigned_tx_hex)
    check_movment(db, 'debit', rps1['block_index'], source_default, 'XCH', 11021665, rps1['tx_hash'])

    unsigned_tx_hex = bitcoin.transaction(rps.compose(db, destination_default, 5, 11021665, move_random_hash_default, 10), encoding='multisig')
    rps2 = parse_hex(unsigned_tx_hex)
    check_movment(db, 'debit', rps2['block_index'], destination_default, 'XCH', 11021665, rps2['tx_hash'])

    rps_match_id = rps1['tx_hash'] + rps2['tx_hash']
    unsigned_tx_hex = bitcoin.transaction(rpsresolve.compose(db, source_default, 3, rps_random_default, rps_match_id), encoding='multisig')
    rps_match = parse_hex(unsigned_tx_hex)

    block_progress(25)
    expiration_block = rps_match['block_index']+20
    
    # resolved game wins
    check_movment(db, 'credit', expiration_block, source_default, 'XCH', 2 * 11021665, rps_match_id)
예제 #24
0
def test_broadcast_equal():
    unsigned_tx_hex = bitcoin.transaction(broadcast.compose(
        db, source_default, 1388000201, 2, fee_multiplier_default,
        'Unit Test'),
                                          encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #25
0
def test_btcpay():
    order_match_id = 'dbc1b4c900ffe48d575b5da5c638040125f65db0fe3e24494b76ea986457d986084fed08b978af4d7d196a7446a86b58009e636b611db16211b65a9aadff29c5'
    unsigned_tx_hex = bitcoin.transaction(btcpay.compose(
        db, source_default, order_match_id),
                                          encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #26
0
def test_issuance_indivisible_callable():
    unsigned_tx_hex = bitcoin.transaction(issuance.compose(
        db, source_default, None, 'BBBC', round(quantity / 1000), False, True,
        17, 0.015, 'foobar'),
                                          encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #27
0
def test_cancel():
    unsigned_tx_hex = bitcoin.transaction(
        cancel.compose(
            db,
            'ab897fbdedfa502b2d839b6a56100887dccdc507555c282e59589e06300a62e2'
        ), True)

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #28
0
def test_rps_expiration ():
    unsigned_tx_hex = bitcoin.transaction(rps.compose(db, source_default, 5, 11021663, move_random_hash_default, 10), encoding='multisig')
    tx_rps = parse_hex(unsigned_tx_hex)
    check_movment(db, 'debit', tx_rps['block_index'], source_default, 'XCP', 11021663, tx_rps['tx_hash'])

    block_progress(15)
    expiration_block = tx_rps['block_index']+11

    # re-credit expired rps
    check_movment(db, 'credit', expiration_block, source_default, 'XCP', 11021663, tx_rps['tx_hash'])
예제 #29
0
def test_counter_rps():
    unsigned_tx_hex = bitcoin.transaction(rps.compose(
        db, destination_default, 5, 11021663,
        '6e8bf66cbd6636aca1802459b730a99548624e48e243b840e0b34a12bede17ec',
        100),
                                          encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #30
0
def test_rps_expiration ():
    unsigned_tx_hex = bitcoin.transaction(rps.compose(db, source_default, 5, 11021663, move_random_hash_default, 10), encoding='multisig')
    tx_rps = parse_hex(unsigned_tx_hex)
    check_movment(db, 'debit', tx_rps['block_index'], source_default, 'XCH', 11021663, tx_rps['tx_hash'])

    block_progress(15)
    expiration_block = tx_rps['block_index']+11

    # re-credit expired rps
    check_movment(db, 'credit', expiration_block, source_default, 'XCH', 11021663, tx_rps['tx_hash'])
예제 #31
0
def test_counter_rpsresolve():
    rps_match_id = '58f7b0780592032e4d8602a3e8690fb2c701b2e1dd546e703445aabd6469734d77adfc95029e73b173f60e556f915b0cd8850848111358b1c370fb7c154e61fd'
    unsigned_tx_hex = bitcoin.transaction(rpsresolve.compose(
        db, destination_default, 5, 'fa765e80203cba24a298e4458f63ff6b',
        rps_match_id),
                                          encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #32
0
def test_bet_notequal():
    unsigned_tx_hex = bitcoin.transaction(bet.compose(db, source_default,
                                                      source_default, 3,
                                                      1388000200, small * 13,
                                                      small * 15, 1, 5040,
                                                      expiration),
                                          encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #33
0
def test_bet_bearcfd_to_be_settled():
    unsigned_tx_hex = bitcoin.transaction(bet.compose(db, source_default,
                                                      source_default, 1,
                                                      1388000100, small * 7,
                                                      small * 3, 0.0, 5040,
                                                      expiration),
                                          encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #34
0
def test_bet_bullcfd_to_be_liquidated():
    unsigned_tx_hex = bitcoin.transaction(bet.compose(db, source_default,
                                                      source_default, 0,
                                                      1388000100, small,
                                                      round(small / 2), 0.0,
                                                      15120, expiration),
                                          encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #35
0
def test_pending_rps_match_expiration():
    unsigned_tx_hex = bitcoin.transaction(rps.compose(
        db, source_default, 5, 11021664, move_random_hash_default, 10),
                                          encoding='multisig')
    rps1 = parse_hex(unsigned_tx_hex)
    check_movment(db, 'debit', rps1['block_index'], source_default, 'XCH',
                  11021664, rps1['tx_hash'])

    unsigned_tx_hex = bitcoin.transaction(rps.compose(
        db, destination_default, 5, 11021664, move_random_hash_default, 10),
                                          encoding='multisig')
    rps2 = parse_hex(unsigned_tx_hex)
    check_movment(db, 'debit', rps2['block_index'], destination_default, 'XCH',
                  11021664, rps2['tx_hash'])

    block_progress(25)
    expiration_block = rps2['block_index'] + 21

    # re-credit expired rps
    check_movment(db, 'credit', expiration_block, source_default, 'XCH',
                  11021664, rps1['tx_hash'] + rps2['tx_hash'])
    check_movment(db, 'credit', expiration_block, destination_default, 'XCH',
                  11021664, rps1['tx_hash'] + rps2['tx_hash'])
예제 #36
0
def run_scenario(scenario, rawtransactions_db):
    counterpartyd.set_options(database_file=':memory:', testnet=True, **COUNTERPARTYD_OPTIONS)
    config.PREFIX = b'TESTXXXX'
    util.FIRST_MULTISIG_BLOCK_TESTNET = 1
    checkpoints = dict(check.CHECKPOINTS_TESTNET)
    check.CHECKPOINTS_TESTNET = {}
    proxy = RpcProxy()

    logger = logging.getLogger()
    logger.setLevel(logging.DEBUG)
    logger_buff = io.StringIO()
    handler = logging.StreamHandler(logger_buff)
    handler.setLevel(logging.DEBUG)
    formatter = logging.Formatter('%(message)s')
    handler.setFormatter(formatter)
    logger.addHandler(handler)
    requests_log = logging.getLogger("requests")
    requests_log.setLevel(logging.WARNING)
    asyncio_log = logging.getLogger('asyncio')
    asyncio_log.setLevel(logging.ERROR)

    db = database.get_connection(read_only=False)
    initialise_db(db)

    raw_transactions = []
    for transaction in scenario:
        if transaction[0] != 'create_next_block':
            module = sys.modules['lib.messages.{}'.format(transaction[0])]
            compose = getattr(module, 'compose')
            unsigned_tx_hex = bitcoin.transaction(db, compose(db, *transaction[1]), **transaction[2])
            raw_transactions.append({transaction[0]: unsigned_tx_hex})
            insert_raw_transaction(unsigned_tx_hex, db, rawtransactions_db)
        else:
            create_next_block(db, block_index=config.BURN_START + transaction[1], parse_block=True)

    dump = dump_database(db)
    log = logger_buff.getvalue()

    db.close()
    check.CHECKPOINTS_TESTNET = checkpoints
    return dump, log, json.dumps(raw_transactions, indent=4)
예제 #37
0
def run_scenario(scenario, rawtransactions_db):
    counterpartyd.set_options(database_file=':memory:', testnet=True, **COUNTERPARTYD_OPTIONS)
    config.PREFIX = b'TESTXXXX'
    util.FIRST_MULTISIG_BLOCK_TESTNET = 1
    checkpoints = dict(config.CHECKPOINTS_TESTNET)
    config.CHECKPOINTS_TESTNET = {}
    logger = logging.getLogger()
    logger.setLevel(logging.DEBUG)
    logger_buff = io.StringIO()
    handler = logging.StreamHandler(logger_buff)
    handler.setLevel(logging.DEBUG)
    formatter = logging.Formatter('%(message)s')
    handler.setFormatter(formatter)
    logger.addHandler(handler)
    requests_log = logging.getLogger("requests")
    requests_log.setLevel(logging.WARNING)
    asyncio_log = logging.getLogger('asyncio')
    asyncio_log.setLevel(logging.ERROR)

    db = util.connect_to_db()
    initialise_db(db)

    raw_transactions = []
    for transaction in scenario:
        if transaction[0] != 'create_next_block':
            module = sys.modules['lib.messages.{}'.format(transaction[0])]
            compose = getattr(module, 'compose')
            unsigned_tx_hex = bitcoin.transaction(db, compose(db, *transaction[1]), **transaction[2])
            raw_transactions.append({transaction[0]: unsigned_tx_hex})
            insert_raw_transaction(unsigned_tx_hex, db, rawtransactions_db)
        else:
            create_next_block(db, block_index=config.BURN_START + transaction[1], parse_block=True)

    dump = dump_database(db)
    log = logger_buff.getvalue()

    db.close()
    config.CHECKPOINTS_TESTNET = checkpoints
    return dump, log, json.dumps(raw_transactions, indent=4)
예제 #38
0
def test_notary_issuance ():
    unsigned_tx_hex = bitcoin.transaction(notary.compose(db, source_default, 0, "9123", "Test"), encoding='multisig')

    parse_hex(unsigned_tx_hex)
    print(inspect.stack())
예제 #39
0
def test_issuance_indivisible_callable ():
    unsigned_tx_hex = bitcoin.transaction(issuance.compose(db, source_default, None, 'BBBC', round(quantity / 1000), False, True, 17, 0.015, 'foobar'), encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #40
0
def test_issuance_divisible ():
    unsigned_tx_hex = bitcoin.transaction(issuance.compose(db, source_default, None, 'BBBB', quantity * 10, True, False, 0, 0.0, ''), encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #41
0
def test_rps ():
    unsigned_tx_hex = bitcoin.transaction(rps.compose(db, source_default, 5, 11021663, move_random_hash_default, 100), encoding='multisig')
    
    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #42
0
def test_send_indivisible ():
    unsigned_tx_hex = bitcoin.transaction(send.compose(db, source_default, destination_default, 'BBBC', round(quantity / 190000)), encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #43
0
def test_send ():
    unsigned_tx_hex = bitcoin.transaction(send.compose(db, source_default, destination_default, config.XCP, small), encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #44
0
def test_cancel ():
    unsigned_tx_hex = bitcoin.transaction(cancel.compose(db, 'ab897fbdedfa502b2d839b6a56100887dccdc507555c282e59589e06300a62e2'), True)

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #45
0
def test_broadcast_liquidate ():
    unsigned_tx_hex = bitcoin.transaction(broadcast.compose(db, source_default, 1388000050, round(100 - (.415/3) - .00001, 5), fee_multiplier_default, 'Unit Test'), encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #46
0
def test_bet_notequal ():
    unsigned_tx_hex = bitcoin.transaction(bet.compose(db, source_default, source_default, 3, 1388000200, small * 13, small * 15, 1, 5040, expiration), encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #47
0
def test_cancel ():
    unsigned_tx_hex = bitcoin.transaction(cancel.compose(db, source_default, '2f0fd1e89b8de1d57292742ec380ea47066e307ad645f5bc3adad8a06ff58608'), encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #48
0
def test_order_to_be_cancelled ():
    unsigned_tx_hex = bitcoin.transaction(order.compose(db, source_default, 'BBBB', small, config.XCP, small, expiration, 0), encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #49
0
def test_overburn ():
    unsigned_tx_hex = bitcoin.transaction(burn.compose(db, source_default, (1 * config.UNIT), overburn=True), encoding='multisig')  # Try to burn a whole 'nother BTC.

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #50
0
def test_send_callable ():
    unsigned_tx_hex = bitcoin.transaction(send.compose(db, source_default, destination_default, 'BBBC', 10000), encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #51
0
def test_callback ():
    unsigned_tx_hex = bitcoin.transaction(callback.compose(db, source_default, .3, 'BBBC'), encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #52
0
def test_order_sell_xcp ():
    unsigned_tx_hex = bitcoin.transaction(order.compose(db, source_default, config.XCP, round(small * 2.1), config.BTC, small, expiration, fee_required), encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #53
0
def test_bet_bearcfd_to_be_settled ():
    unsigned_tx_hex = bitcoin.transaction(bet.compose(db, source_default, source_default, 1, 1388000100, small * 7, small * 3, 0.0, 5040, expiration), encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #54
0
def test_order_buy_xcp ():
    unsigned_tx_hex = bitcoin.transaction(order.compose(db, source_default, config.BTC, small, config.XCP, small * 2, expiration, 0), encoding='multisig', fee_provided=fee_provided)

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #55
0
def test_bet_bearcfd_to_be_liquidated ():
    unsigned_tx_hex = bitcoin.transaction(bet.compose(db, source_default, source_default, 1, 1388000100, round(small / 2), round(small * .83), 0.0, 15120, expiration), encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #56
0
def test_burn ():
    unsigned_tx_hex = bitcoin.transaction(burn.compose(db, source_default, int(.62 * quantity)), encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #57
0
def test_dividend_indivisible ():
    unsigned_tx_hex = bitcoin.transaction(dividend.compose(db, source_default, 800, 'BBBC', config.XCP), encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #58
0
def test_broadcast_equal ():
    unsigned_tx_hex = bitcoin.transaction(broadcast.compose(db, source_default, 1388000201, 2, fee_multiplier_default, 'Unit Test'), encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex
예제 #59
0
def test_counter_rps ():
    unsigned_tx_hex = bitcoin.transaction(rps.compose(db, destination_default, 5, 11021663, '6e8bf66cbd6636aca1802459b730a99548624e48e243b840e0b34a12bede17ec', 100), encoding='multisig')

    parse_hex(unsigned_tx_hex)

    output_new[inspect.stack()[0][3]] = unsigned_tx_hex