Skip to content

Commit

Permalink
Merge pull request #2760 from CounterpartyXCP/bumpversion
Browse files Browse the repository at this point in the history
v10.7.2
  • Loading branch information
ouziel-slama authored Nov 24, 2024
2 parents e5a0e74 + 0f3d94d commit b11b50f
Show file tree
Hide file tree
Showing 19 changed files with 3,741 additions and 3,667 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ruff-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
with:
version: 0.7.4
1 change: 1 addition & 0 deletions .github/workflows/ruff-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ jobs:
- uses: chartboost/ruff-action@v1
with:
args: "format --check"
version: 0.7.4
3,845 changes: 1,933 additions & 1,912 deletions apiary.apib

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions counterparty-core/counterpartycore/lib/api/api_watcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@
"BURN": ["source"],
"NEW_FAIRMINT": ["source"],
"NEW_FAIRMINTER": ["source"],
"ATTACH_TO_UTXO": ["source", "destination"],
"DETACH_FROM_UTXO": ["source", "destination"],
"UTXO_MOVE": ["source", "destination"],
}

SKIP_EVENTS = ["NEW_TRANSACTION_OUTPUT"]
Expand Down Expand Up @@ -632,6 +635,8 @@ def update_address_events(api_db, event):
event_bindings = json.loads(event["bindings"])
cursor = api_db.cursor()
for field in EVENTS_ADDRESS_FIELDS[event["event"]]:
if field not in event_bindings:
continue
sql = """
INSERT INTO address_events (address, event_index)
VALUES (:address, :event_index)
Expand Down
4 changes: 2 additions & 2 deletions counterparty-core/counterpartycore/lib/api/compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,8 +740,8 @@ def get_attach_estimate_xcp_fee(db):
def compose_movetoutxo(db, utxo: str, destination: str, **construct_args):
"""
Composes a transaction to move assets from UTXO to another UTXO.
:param utxo: The utxo from which the assets are moved
:param destination: The address to move the assets to
:param utxo: The utxo from which the assets are moved (e.g. $UTXO_WITH_BALANCE)
:param destination: The address to move the assets to (e.g. $ADDRESS_1)
"""
params = {
"source": utxo,
Expand Down
4 changes: 4 additions & 0 deletions counterparty-core/counterpartycore/lib/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,10 @@
"ledger_hash": "cffb619abf5cbf297d3bf837369cae8e80eafb047bc26db9698d2ea6fd7cb9b9",
"txlist_hash": "58786555420ed0e1aa160d572adf33bf622842069212fd3f3aaf2889ff5b968f",
},
871781: {
"ledger_hash": "f214d9ed443e0034e1d3508f016086a841fb89036baae1aae857d273ef2a0b76",
"txlist_hash": "f378bfec19139f0210808ef8d6c548452cca9e631e5742786d2af7595534106c",
},
}

CONSENSUS_HASH_VERSION_TESTNET = 7
Expand Down
2 changes: 1 addition & 1 deletion counterparty-core/counterpartycore/lib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


# Semantic Version
__version__ = "10.7.2-alpha.1" # for hatch
__version__ = "10.7.2" # for hatch
VERSION_STRING = __version__
version = VERSION_STRING.split("-")[0].split(".")
VERSION_MAJOR = int(version[0])
Expand Down
5 changes: 5 additions & 0 deletions counterparty-core/counterpartycore/lib/messages/dispense.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ def compose(db, source, destination, quantity, skip_validation: bool = False):
problems = validate(db, source, destination, quantity)
if problems and not skip_validation:
raise exceptions.ComposeError(problems)

# not in validate() to not risk a protocol change
if source == destination:
raise exceptions.ComposeError("source and destination must be different")

# create data
data = struct.pack(config.SHORT_TXTYPE_FORMAT, dispenser_module.DISPENSE_ID)
data += b"\x00"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1949,6 +1949,35 @@
"block_index": 310513,
"block_time": 310513000
},
{
"event_index": 1326,
"event": "ATTACH_TO_UTXO",
"params": {
"asset": "DIVISIBLE",
"block_index": 310508,
"destination": "74501a157028760383ae4a8f79f6bce9ef64e60e883ac3285bc239a907c2b42c:0",
"fee_paid": 0,
"msg_index": 0,
"quantity": 1,
"source": "mn6q3dS2EnDUx3bmyWc6D4szJNVGtaR7zc",
"status": "valid",
"tx_hash": "a568f169d4bb433072dd25793970d330fa51092012964a5bdc42d22835182726",
"tx_index": 509,
"block_time": 310508000,
"asset_info": {
"asset_longname": null,
"description": "Divisible asset",
"issuer": "mn6q3dS2EnDUx3bmyWc6D4szJNVGtaR7zc",
"divisible": true,
"locked": false
},
"quantity_normalized": "0.00000001",
"fee_paid_normalized": "0.00000000"
},
"tx_hash": "a568f169d4bb433072dd25793970d330fa51092012964a5bdc42d22835182726",
"block_index": 310508,
"block_time": 310508000
},
{
"event_index": 1324,
"event": "DEBIT",
Expand Down Expand Up @@ -2004,37 +2033,10 @@
"tx_hash": null,
"block_index": 310508,
"block_time": 310508000
},
{
"event_index": 1316,
"event": "DEBIT",
"params": {
"action": "attach to utxo",
"address": "mn6q3dS2EnDUx3bmyWc6D4szJNVGtaR7zc",
"asset": "XCP",
"block_index": 310507,
"event": "c1a3885eac5247f363f6adcc0fbd6576b8b98f928065185074fe75d01c91af02",
"quantity": 100,
"tx_index": 508,
"utxo": null,
"utxo_address": null,
"block_time": 310507000,
"asset_info": {
"asset_longname": null,
"description": "The Counterparty protocol native currency",
"issuer": null,
"divisible": true,
"locked": true
},
"quantity_normalized": "0.00000100"
},
"tx_hash": "c1a3885eac5247f363f6adcc0fbd6576b8b98f928065185074fe75d01c91af02",
"block_index": 310507,
"block_time": 310507000
}
],
"next_cursor": 1314,
"result_count": 173
"next_cursor": 1318,
"result_count": 175
},
"http://localhost:10009/v2/addresses/mn6q3dS2EnDUx3bmyWc6D4szJNVGtaR7zc/balances?verbose=true": {
"result": [
Expand Down Expand Up @@ -15283,13 +15285,13 @@
"name": "utxo",
"required": true,
"type": "str",
"description": "The utxo from which the assets are moved"
"description": "The utxo from which the assets are moved (e.g. $UTXO_WITH_BALANCE)"
},
{
"name": "destination",
"required": true,
"type": "str",
"description": "The address to move the assets to"
"description": "The address to move the assets to (e.g. $ADDRESS_1)"
},
{
"name": "encoding",
Expand Down
Loading

0 comments on commit b11b50f

Please sign in to comment.