Пример #1
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)
Пример #2
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
Пример #3
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
Пример #4
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
Пример #5
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
Пример #6
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)