-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2575 from CounterpartyXCP/fixcomposedispense
[v10.6.0] Only Require One Valid Dispenser in Validation Logic
- Loading branch information
Showing
11 changed files
with
5,212 additions
and
4,734 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
4,613 changes: 2,376 additions & 2,237 deletions
4,613
counterparty-core/counterpartycore/test/regtest/apidoc/apicache.json
Large diffs are not rendered by default.
Oops, something went wrong.
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
165 changes: 165 additions & 0 deletions
165
counterparty-core/counterpartycore/test/regtest/scenarios/scenario_17_dispenser.py
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,165 @@ | ||
SCENARIO = [ | ||
{ | ||
"title": "Create Dispenser 6", | ||
"transaction": "dispenser", | ||
"source": "$ADDRESS_1", | ||
"params": { | ||
"asset": "TESTLOCKDESC", | ||
"give_quantity": 1, | ||
"escrow_quantity": 10000, | ||
"mainchainrate": 1, # 1 BTC for 1 XCP | ||
"status": 0, | ||
}, | ||
"set_variables": { | ||
"DISPENSER_6_TX_HASH": "$TX_HASH", | ||
}, | ||
"controls": [ | ||
{ | ||
"url": "blocks/$BLOCK_INDEX/events?event_name=OPEN_DISPENSER,DEBIT", | ||
"result": [ | ||
{ | ||
"event": "OPEN_DISPENSER", | ||
"event_index": "$EVENT_INDEX_4", | ||
"params": { | ||
"asset": "TESTLOCKDESC", | ||
"block_index": "$BLOCK_INDEX", | ||
"dispense_count": 0, | ||
"escrow_quantity": 10000, | ||
"give_quantity": 1, | ||
"give_remaining": 10000, | ||
"oracle_address": None, | ||
"origin": "$ADDRESS_1", | ||
"satoshirate": 1, | ||
"source": "$ADDRESS_1", | ||
"status": 0, | ||
"tx_hash": "$TX_HASH", | ||
"tx_index": "$TX_INDEX", | ||
}, | ||
"tx_hash": "$TX_HASH", | ||
}, | ||
{ | ||
"event": "DEBIT", | ||
"event_index": "$EVENT_INDEX_3", | ||
"params": { | ||
"action": "open dispenser", | ||
"address": "$ADDRESS_1", | ||
"asset": "TESTLOCKDESC", | ||
"block_index": "$BLOCK_INDEX", | ||
"event": "$TX_HASH", | ||
"quantity": 10000, | ||
"tx_index": "$TX_INDEX", | ||
"utxo": None, | ||
"utxo_address": None, | ||
}, | ||
"tx_hash": "$TX_HASH", | ||
}, | ||
], | ||
}, | ||
{ | ||
"url": "addresses/$ADDRESS_1/dispensers", | ||
"result": [ | ||
{ | ||
"asset": "TESTLOCKDESC", | ||
"block_index": "$BLOCK_INDEX", | ||
"close_block_index": None, | ||
"confirmed": True, | ||
"dispense_count": 0, | ||
"escrow_quantity": 10000, | ||
"give_quantity": 1, | ||
"give_remaining": 10000, | ||
"last_status_tx_hash": None, | ||
"last_status_tx_source": None, | ||
"oracle_address": None, | ||
"origin": "$ADDRESS_1", | ||
"satoshirate": 1, | ||
"source": "$ADDRESS_1", | ||
"status": 0, | ||
"tx_hash": "$TX_HASH", | ||
"tx_index": 62, | ||
}, | ||
{ | ||
"asset": "XCP", | ||
"block_index": "$DISPENSER_1_LAST_UPDATE_BLOCK_INDEX", | ||
"close_block_index": None, | ||
"confirmed": True, | ||
"dispense_count": 2, | ||
"escrow_quantity": 10000, | ||
"give_quantity": 1, | ||
"give_remaining": 0, | ||
"last_status_tx_hash": None, | ||
"last_status_tx_source": None, | ||
"oracle_address": None, | ||
"origin": "$ADDRESS_1", | ||
"satoshirate": 1, | ||
"source": "$ADDRESS_1", | ||
"status": 10, | ||
"tx_hash": "$DISPENSER_1_TX_HASH", | ||
"tx_index": "$DISPENSER_1_TX_INDEX", | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
{ | ||
"title": "Dispense on address with two dispensers, one of them is closed", | ||
"transaction": "dispense", | ||
"source": "$ADDRESS_2", | ||
"params": { | ||
"dispenser": "$ADDRESS_1", | ||
"quantity": 4000, | ||
}, | ||
"controls": [ | ||
{ | ||
"url": "blocks/$BLOCK_INDEX/events?event_name=DISPENSE,DISPENSER_UPDATE,CREDIT", | ||
"result": [ | ||
{ | ||
"event": "DISPENSE", | ||
"event_index": "$EVENT_INDEX_6", | ||
"params": { | ||
"asset": "TESTLOCKDESC", | ||
"block_index": "$BLOCK_INDEX", | ||
"btc_amount": 4000, | ||
"destination": "$ADDRESS_2", | ||
"dispense_index": 0, | ||
"dispense_quantity": 4000, | ||
"dispenser_tx_hash": "$DISPENSER_6_TX_HASH", | ||
"source": "$ADDRESS_1", | ||
"tx_hash": "$TX_HASH", | ||
"tx_index": "$TX_INDEX", | ||
}, | ||
"tx_hash": "$TX_HASH", | ||
}, | ||
{ | ||
"event": "DISPENSER_UPDATE", | ||
"event_index": "$EVENT_INDEX_5", | ||
"params": { | ||
"asset": "TESTLOCKDESC", | ||
"dispense_count": 1, | ||
"give_remaining": 6000, | ||
"source": "$ADDRESS_1", | ||
"status": 0, | ||
"tx_hash": "$DISPENSER_6_TX_HASH", | ||
}, | ||
"tx_hash": "$TX_HASH", | ||
}, | ||
{ | ||
"event": "CREDIT", | ||
"event_index": "$EVENT_INDEX_4", | ||
"params": { | ||
"address": "$ADDRESS_2", | ||
"asset": "TESTLOCKDESC", | ||
"block_index": "$BLOCK_INDEX", | ||
"calling_function": "dispense", | ||
"event": "$TX_HASH", | ||
"quantity": 4000, | ||
"tx_index": "$TX_INDEX", | ||
"utxo": None, | ||
"utxo_address": None, | ||
}, | ||
"tx_hash": "$TX_HASH", | ||
}, | ||
], | ||
} | ||
], | ||
}, | ||
] |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.