Skip to content

Commit

Permalink
Implement OP_ADD64, OP_SUB64, OP_MUL64, OP_DIV64, OP_LESSTHAN64, OP_L…
Browse files Browse the repository at this point in the history
…ESSTHANOREQUAL64, OP_GREATERTHAN64, OP_GREATERTHANOREQUAL64, OP_SCRIPTNUMTOLE64, OP_LE64TOSCRIPTNUM, OP_LE32TOLE64

Remove liquid args

WIP

Get simple OP_1 functional test case working

Get tests for arithmetic and comparison opcodes working

Get all functional tests passing

Rename test case to Arithmetic64bitTest

Rename file to feature_64bit_arithmetic_opcodes.py, add it to test_runner.py

Get tests passing in feature_taproot.py

Remove unused push_le4

Revert test fixture setup

Cleanup

Fix linting

test: Add leaf_version parameter to taproot_tree_helper()

Fix bug

Fix bugs

Fix compile

Fix missing sigversion checks

Fix htole64 -> htole64_internal due to bitcoin#29263
  • Loading branch information
Christewart committed May 13, 2024
1 parent 1ffabfa commit 145cb91
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/functional/feature_64bit_arithmetic_opcodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
from test_framework.key import compute_xonly_pubkey, generate_privkey
from test_framework.messages import COutPoint, CTransaction, CTxIn, CTxInWitness, CTxOut, ser_uint256, sha256, tx_from_hex
from test_framework.test_framework import BitcoinTestFramework
<<<<<<< HEAD
from test_framework.script import OP_8, OP_DROP, OP_SIZE, CScript, CScriptNum, CScriptOp, OP_1, OP_ADD64, OP_SUB64, OP_MUL64, OP_DIV64, OP_LESSTHAN64, OP_LESSTHANOREQUAL64, OP_GREATERTHAN64, OP_GREATERTHANOREQUAL64, OP_NEG64, OP_SCRIPTNUMTOLE64, OP_LE64TOSCRIPTNUM, OP_LE32TOLE64, OP_DUP, OP_EQUAL, OP_EQUALVERIFY, OP_VERIFY, taproot_construct, SIGHASH_DEFAULT, SIGHASH_ALL, SIGHASH_NONE, SIGHASH_SINGLE, SIGHASH_ANYONECANPAY, LEAF_VERSION_TAPSCRIPT_64BIT
=======
from test_framework.script import CScript, CScriptNum, CScriptOp, OP_1, OP_ADD64, OP_SUB64, OP_MUL64, OP_DIV64, OP_LESSTHAN64, OP_LESSTHANOREQUAL64, OP_GREATERTHAN64, OP_GREATERTHANOREQUAL64, OP_NEG64, OP_SCRIPTNUMTOLE64, OP_LE64TOSCRIPTNUM, OP_LE32TOLE64, OP_DUP, OP_EQUAL, OP_EQUALVERIFY, OP_VERIFY, taproot_construct, SIGHASH_DEFAULT, SIGHASH_ALL, SIGHASH_NONE, SIGHASH_SINGLE, SIGHASH_ANYONECANPAY, LEAF_VERSION_TAPSCRIPT_64BIT
>>>>>>> bc772fe8f4 (Implement OP_ADD64, OP_SUB64, OP_MUL64, OP_DIV64, OP_LESSTHAN64, OP_LESSTHANOREQUAL64, OP_GREATERTHAN64, OP_GREATERTHANOREQUAL64, OP_SCRIPTNUMTOLE64, OP_LE64TOSCRIPTNUM, OP_LE32TOLE64)
from test_framework.address import output_key_to_p2tr

VALID_SIGHASHES_ECDSA = [
Expand Down Expand Up @@ -284,9 +288,5 @@ def check_neg(a, res, fail=None):
# Overflow inputs
self.tapscript_satisfy_test(CScript([le8(2**31), OP_LE64TOSCRIPTNUM, 2**31, OP_EQUAL]), fail = "Arithmetic opcode error")

x = 100000000000
y = 200000000000
self.tapscript_satisfy_test(CScript([le8(x), le8(x), OP_ADD64, OP_DROP, OP_LE64TOSCRIPTNUM, OP_SIZE, OP_8, OP_EQUALVERIFY, OP_SCRIPTNUMTOLE64 , le8(y), OP_EQUAL]), fail="Arithmetic opcode error")

if __name__ == '__main__':
Arithmetic64bitTest().main()

0 comments on commit 145cb91

Please sign in to comment.