-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[v11.1.0] New Transaction Format #2189
base: develop
Are you sure you want to change the base?
Conversation
ouziel-slama
commented
Sep 1, 2024
- Specification
- Implementation
- Tests
- Double-check the spelling and grammar of all strings, code comments, etc.
- Double-check that all code is deterministic that needs to be
- Add tests to cover any new or revised logic
- Ensure that the test suite passes
- Update the project release notes
- Update the project documentation, as appropriate, with a corresponding Pull Request in the Documentation repository
@@ -270,7 +270,7 @@ | |||
return source, destination, btc_amount, fee, data, outs | |||
|
|||
|
|||
def parse_transaction_vouts(decoded_tx): | |||
def parse_transaction_vouts(decoded_tx, block_index): |
Check warning
Code scanning / pylint
Too many branches (15/12). Warning
pubkeyhash_encoding = True | ||
data_chunk_length = data_pubkey[0] # No ord() necessary. | ||
data_chunk = data_pubkey[1 : data_chunk_length + 1] | ||
if data_chunk[-8:] == config.PREFIX: | ||
if data_chunk[-8:] == util.prefix(block_index): |
Check warning
Code scanning / pylint
Unnecessary "else" after "break", remove the "else" and de-indent the code inside it. Warning
@@ -12,7 +12,7 @@ | |||
import bitcoin as bitcoinlib | |||
from bitcoin.bech32 import CBech32Data | |||
|
|||
from counterpartycore.lib import arc4, backend, config, exceptions, script # noqa: F401 | |||
from counterpartycore.lib import arc4, backend, config, exceptions, script, util # noqa: F401 |
Check warning
Code scanning / pylint
Unused util imported from counterpartycore.lib. Warning
@@ -322,8 +322,9 @@ | |||
except Exception as e: | |||
capture_exception(e) | |||
logger.error("Error in API: %s", e) | |||
# import traceback | |||
# print(traceback.format_exc()) # for debugging | |||
import traceback |
Check warning
Code scanning / pylint
Import outside toplevel (traceback). Warning
The two test cases would be great: (1) XCP dex buy then named asset issuance and for (2) XCP dex buy then attach |
elif source != tx_info[0]: | ||
raise exceptions.ComposeError("All transactions must have the same source") | ||
|
||
if not len(destination) and len(tx_info[1]): |
Check warning
Code scanning / pylint
Do not use len(SEQUENCE) without comparison to determine if a sequence is empty. Warning
|
||
if not len(destination) and len(tx_info[1]): | ||
destination = tx_info[1] | ||
elif len(tx_info[1]) and len(destination) and destination != tx_info[1]: |
Check warning
Code scanning / pylint
Do not use len(SEQUENCE) without comparison to determine if a sequence is empty. Warning
""", | ||
(tx_hash,), | ||
).fetchone() | ||
if last_msg_index and last_msg_index["msg_index"] is not None: |
Check warning
Code scanning / pylint
Unnecessary "else" after "return", remove the "else" and de-indent the code inside it. Warning
…TXO, then open sell order for XCP: Success
) | ||
|
||
if util.enabled("new_prefix_xcp1") and data: | ||
flags = data[0] # noqa F841 |
Check warning
Code scanning / pylint
Unused variable 'flags'. Warning
@@ -943,6 +950,9 @@ | |||
desired_source = script.make_canonical(desired_source) | |||
|
|||
# Check desired info against parsed info. | |||
if util.enabled("new_prefix_xcp1") and desired_data: | |||
flags = desired_data[0] # noqa F841 |
Check warning
Code scanning / pylint
Unused variable 'flags'. Warning
@@ -603,3 +603,39 @@ | |||
if len(values[0]) != 64: | |||
return False | |||
return True | |||
|
|||
|
|||
def prefix(block_index): |
Check warning
Code scanning / pylint
Unused argument 'block_index'. Warning
|
||
|
||
def prefix(block_index): | ||
if config.TESTCOIN: |
Check warning
Code scanning / pylint
Unnecessary "else" after "return", remove the "else" and de-indent the code inside it. Warning