From cb88f6a5ad84462f25c3dd112491dadd6815a915 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Sun, 20 Jul 2025 11:20:35 +0400 Subject: [PATCH 1/4] update int --- lib/rain.interpreter.interface | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rain.interpreter.interface b/lib/rain.interpreter.interface index 70d9fae47..342fd0839 160000 --- a/lib/rain.interpreter.interface +++ b/lib/rain.interpreter.interface @@ -1 +1 @@ -Subproject commit 70d9fae479072d0dad154ba203fd9b6c17d553b2 +Subproject commit 342fd0839dbf840b8c42a5d555de4b1de3116848 From 52e19dfc8bc95ad27501ceef45dbbe6be78aa352 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Sun, 20 Jul 2025 19:39:25 +0400 Subject: [PATCH 2/4] gte and lte ops --- src/generated/Rainterpreter.pointers.sol | 4 +- ...interpreterExpressionDeployer.pointers.sol | 6 +- .../RainterpreterParser.pointers.sol | 8 +- src/lib/op/LibAllStandardOps.sol | 36 ++-- ...ToNP.sol => LibOpGreaterThanOrEqualTo.sol} | 27 ++- ...ualToNP.sol => LibOpLessThanOrEqualTo.sol} | 27 ++- .../op/logic/LibOpGreaterThanOrEqualTo.t.sol | 102 +++++++++++ .../logic/LibOpGreaterThanOrEqualToNP.t.sol | 104 ----------- .../lib/op/logic/LibOpLessThanOrEqualTo.t.sol | 170 ++++++++++++++++++ .../op/logic/LibOpLessThanOrEqualToNP.t.sol | 170 ------------------ 10 files changed, 337 insertions(+), 317 deletions(-) rename src/lib/op/logic/{LibOpGreaterThanOrEqualToNP.sol => LibOpGreaterThanOrEqualTo.sol} (53%) rename src/lib/op/logic/{LibOpLessThanOrEqualToNP.sol => LibOpLessThanOrEqualTo.sol} (53%) create mode 100644 test/src/lib/op/logic/LibOpGreaterThanOrEqualTo.t.sol delete mode 100644 test/src/lib/op/logic/LibOpGreaterThanOrEqualToNP.t.sol create mode 100644 test/src/lib/op/logic/LibOpLessThanOrEqualTo.t.sol delete mode 100644 test/src/lib/op/logic/LibOpLessThanOrEqualToNP.t.sol diff --git a/src/generated/Rainterpreter.pointers.sol b/src/generated/Rainterpreter.pointers.sol index fe340c60e..4aa034c03 100644 --- a/src/generated/Rainterpreter.pointers.sol +++ b/src/generated/Rainterpreter.pointers.sol @@ -10,11 +10,11 @@ pragma solidity =0.8.25; /// @dev Hash of the known bytecode. -bytes32 constant BYTECODE_HASH = bytes32(0x1a3fbd5bbbf67323604d9d6e171b5922ce1c661c9f890518b6d8c7c948349acb); +bytes32 constant BYTECODE_HASH = bytes32(0xef5d5c21b4a25cc7b3dfdd4402f2d8a35099c9d415c4b6a4f0f76ebfed67e0b0); /// @dev The function pointers known to the interpreter for dynamic dispatch. /// By setting these as a constant they can be inlined into the interpreter /// and loaded at eval time for very low gas (~100) due to the compiler /// optimising it to a single `codecopy` to build the in memory bytes array. bytes constant OPCODE_FUNCTION_POINTERS = - hex"07ab07dd0801098d0a560a680a7a0a930ab70aeb0afc0b0d0baf0bce0c8c0d3c0dc00f0210350c8c112e11e0128212fa130b131c131c132d137413f6140f1423143c14671480149314f51543159115df162d167b16c917171748179617e418321919"; + hex"07bd07ef0813099f0a680a7a0a8c0aa50ac90afd0b0e0b1f0bc10be00c9e0d4e0dd20f1410470c9e114011f21294130c131d132e132e133f1386140814211435144e1467149214ab14c414d71539158715d51623167116bf170d175b178c17da18281876195d"; diff --git a/src/generated/RainterpreterExpressionDeployer.pointers.sol b/src/generated/RainterpreterExpressionDeployer.pointers.sol index b8c645a8c..61dca72e7 100644 --- a/src/generated/RainterpreterExpressionDeployer.pointers.sol +++ b/src/generated/RainterpreterExpressionDeployer.pointers.sol @@ -10,11 +10,11 @@ pragma solidity =0.8.25; /// @dev Hash of the known bytecode. -bytes32 constant BYTECODE_HASH = bytes32(0xd09b4991a12ba8c2a22269ff879e110f22450dba8c3850ebdfd90d37a76936a9); +bytes32 constant BYTECODE_HASH = bytes32(0xce3a44f2ed702547f2da7cc4e7adfc9d9dd5a2bfbfd806b228db3cfcdd1da125); /// @dev The hash of the meta that describes the contract. -bytes32 constant DESCRIBED_BY_META_HASH = bytes32(0x7145a744b38f6a8a05a5a427fd2200e8c6e21c50eb3fd5642d251ecac809f67e); +bytes32 constant DESCRIBED_BY_META_HASH = bytes32(0xf8bdd3a04e26f925f45376a4f3cfe9455904c1abbbfbf60f84d982803beea817); /// @dev The function pointers for the integrity check fns. bytes constant INTEGRITY_FUNCTION_POINTERS = - hex"0e400ebe0f22109c10a610a610b010b910d4117a117a11d6124e125b10a610b0125b10a610b010a610a610a610b0109c109c109c109c1265128a10a610a610a610b010a6109c12941294129412941294129412ae1294109c129412ae12ae10b0128a"; + hex"0e500ece0f3210ac10b610b610c010c910e4118a118a11e6125e126b10b610c0126b10b610c010b610b610b610c010ac10ac10ac10ac1275129a10b610b610b610b610c010b610b610ac12a412a412a412a412a412a412be12a410ac12a412be12be10c0129a"; diff --git a/src/generated/RainterpreterParser.pointers.sol b/src/generated/RainterpreterParser.pointers.sol index 864fb65a0..a0c3704c4 100644 --- a/src/generated/RainterpreterParser.pointers.sol +++ b/src/generated/RainterpreterParser.pointers.sol @@ -10,7 +10,7 @@ pragma solidity =0.8.25; /// @dev Hash of the known bytecode. -bytes32 constant BYTECODE_HASH = bytes32(0x2e38cc130243a36a0482c2e7e70b5928cedb02e1ad0972b7bd7b232b936b7eae); +bytes32 constant BYTECODE_HASH = bytes32(0x802ffd0c76897b508453402052a3a1840b73d060ed67e227d1c874d3cff34ec4); /// @dev The parse meta that is used to lookup word definitions. /// The structure of the parse meta is: @@ -29,7 +29,7 @@ bytes32 constant BYTECODE_HASH = bytes32(0x2e38cc130243a36a0482c2e7e70b5928cedb0 /// bit count of the previous bloom filter. If we reach the end of the bloom /// filters then we have a miss. bytes constant PARSE_META = - hex"0178ac806000299010810908a00a34484001280030060100180000200cc2200408a00c95d8382f48145c3034b3f32bd587e204afc8f01e95a26007b9a51f0d5e6f2803ce312215fae0a1251233de118cfd53051c784d23a55ade1681ac9621ac6dfc2ca4e5e91f5fc32a0e92b2401dbbd837100ef76b00cd8814289714ec13313592270d473b20f880501427634f0f23b4970ac0e53d0b895f991ac908be0983724f12c080bc2d9d7b7d26757aea246f62e0295c0ab5086d2a7b19bcb24402af7d4506414b8117b04fb31cb2182f18ef532922c301e31b9314ad2efa5d8001336a592aab2461"; + hex"0178ac80600029b010810908a00a3448c001280030060100180000200cc2200408a00c95d8383148145c3234b3f32dd587e204afc8f01e95a26007b9a51f0d5e6f2803ce312215fae0a1271233de118cfd53051c784d25a55ade1681ac9622ac6dfc2ea4e5e91f5fc32a0e92b2401dbbd837100ef76b00cd8814205902e62a9714ec13313592290d473b21f880501427634f0f23b4970ac0e53d0b895f991ac908be0983724f12c080bc2f9d7b7d28757aea266f62e02b5c0ab5086d2a7b2390a6b319bcb24402af7d4506414b8117b04fb31cb2182f18ef532924c301e31b9314ad30fa5d8001336a592cab2461"; /// @dev The build depth of the parser meta. @@ -39,11 +39,11 @@ uint8 constant PARSE_META_BUILD_DEPTH = 2; /// These positional indexes all map to the same indexes looked up in the parse /// meta. bytes constant OPERAND_HANDLER_FUNCTION_POINTERS = - hex"1a231a231a231af81c0f1c0f1c0f1af81af81a231a231a231c0f1c0f1c0f1c0f1c0f1c0f1c0f1c0f1c0f1c0f1c0f1c0f1c0f1c0f1c0f1c0f1c0f1c0f1c0f1c0f1c0f1c0f1c0f1c0f1c0f1c0f1c0f1c0f1c0f1c0f1c0f1c0f1c0f1c0f1a231c0f1c0f"; + hex"1a331a331a331b081c1f1c1f1c1f1b081b081a331a331a331c1f1c1f1c1f1c1f1c1f1c1f1c1f1c1f1c1f1c1f1c1f1c1f1c1f1c1f1c1f1c1f1c1f1c1f1c1f1c1f1c1f1c1f1c1f1c1f1c1f1c1f1c1f1c1f1c1f1c1f1c1f1c1f1c1f1c1f1c1f1c1f1a331c1f1c1f"; /// @dev Every two bytes is a function pointer for a literal parser. /// Literal dispatches are determined by the first byte(s) of the literal /// rather than a full word lookup, and are done with simple conditional /// jumps as the possibilities are limited compared to the number of words we /// have. -bytes constant LITERAL_PARSER_FUNCTION_POINTERS = hex"156b179d17e0187e"; +bytes constant LITERAL_PARSER_FUNCTION_POINTERS = hex"157b17ad17f0188e"; diff --git a/src/lib/op/LibAllStandardOps.sol b/src/lib/op/LibAllStandardOps.sol index ea4c48e42..60a592616 100644 --- a/src/lib/op/LibAllStandardOps.sol +++ b/src/lib/op/LibAllStandardOps.sol @@ -53,11 +53,11 @@ import {LibOpEqualTo} from "./logic/LibOpEqualTo.sol"; import {LibOpBinaryEqualTo} from "./logic/LibOpBinaryEqualTo.sol"; import {LibOpEveryNP} from "./logic/LibOpEveryNP.sol"; import {LibOpGreaterThan} from "./logic/LibOpGreaterThan.sol"; -import {LibOpGreaterThanOrEqualToNP} from "./logic/LibOpGreaterThanOrEqualToNP.sol"; +import {LibOpGreaterThanOrEqualTo} from "./logic/LibOpGreaterThanOrEqualTo.sol"; import {LibOpIfNP} from "./logic/LibOpIfNP.sol"; import {LibOpIsZero} from "./logic/LibOpIsZero.sol"; import {LibOpLessThan} from "./logic/LibOpLessThan.sol"; -import {LibOpLessThanOrEqualToNP} from "./logic/LibOpLessThanOrEqualToNP.sol"; +import {LibOpLessThanOrEqualTo} from "./logic/LibOpLessThanOrEqualTo.sol"; // import {LibOpExponentialGrowth} from "./math/growth/LibOpExponentialGrowth.sol"; // import {LibOpLinearGrowth} from "./math/growth/LibOpLinearGrowth.sol"; @@ -108,7 +108,7 @@ import {LibParseLiteralHex} from "../parse/literal/LibParseLiteralHex.sol"; import {LibParseLiteralSubParseable} from "../parse/literal/LibParseLiteralSubParseable.sol"; /// @dev Number of ops currently provided by `AllStandardOps`. -uint256 constant ALL_STANDARD_OPS_LENGTH = 49; +uint256 constant ALL_STANDARD_OPS_LENGTH = 51; /// @title LibAllStandardOps /// @notice Every opcode available from the core repository laid out as a single @@ -219,10 +219,10 @@ library LibAllStandardOps { AuthoringMetaV2("binary-equal-to", "1 if all inputs are equal, 0 otherwise. Equality is binary."), // AuthoringMetaV2("every", "The last nonzero value out of all inputs, or 0 if any input is 0."), AuthoringMetaV2("greater-than", "true if the first input is greater than the second input, false otherwise."), - // AuthoringMetaV2( - // "greater-than-or-equal-to", - // "1 if the first input is greater than or equal to the second input, 0 otherwise." - // ), + AuthoringMetaV2( + "greater-than-or-equal-to", + "1 if the first input is greater than or equal to the second input, 0 otherwise." + ), // AuthoringMetaV2( // "if", // "If the first input is nonzero, the second input is used. Otherwise, the third input is used. If is eagerly evaluated." @@ -232,9 +232,9 @@ library LibAllStandardOps { "1 if the input is 0, 0 otherwise. The input is any numerical 0 value, not just binary 0 e.g. 0e20 is considered 0." ), AuthoringMetaV2("less-than", "true if the first input is less than the second input, false otherwise."), - // AuthoringMetaV2( - // "less-than-or-equal-to", "1 if the first input is less than or equal to the second input, 0 otherwise." - // ), + AuthoringMetaV2( + "less-than-or-equal-to", "1 if the first input is less than or equal to the second input, 0 otherwise." + ), // AuthoringMetaV2( // "exponential-growth", // "Calculates an exponential growth curve as `base(1 + rate)^t` where `base` is the initial value, `rate` is the rate of growth and `t` is units of time. Inputs in order are `base`, `rate`, and `t` respectively." @@ -444,16 +444,16 @@ library LibAllStandardOps { // LibParseOperand.handleOperandDisallowed, // greater-than LibParseOperand.handleOperandDisallowed, - // // greater-than-or-equal-to - // LibParseOperand.handleOperandDisallowed, + // greater-than-or-equal-to + LibParseOperand.handleOperandDisallowed, // // if // LibParseOperand.handleOperandDisallowed, // is-zero LibParseOperand.handleOperandDisallowed, // less-than LibParseOperand.handleOperandDisallowed, - // // less-than-or-equal-to - // LibParseOperand.handleOperandDisallowed, + // less-than-or-equal-to + LibParseOperand.handleOperandDisallowed, // // exponential-growth // LibParseOperand.handleOperandDisallowed, // // linear-growth @@ -599,11 +599,11 @@ library LibAllStandardOps { LibOpBinaryEqualTo.integrity, // LibOpEveryNP.integrity, LibOpGreaterThan.integrity, - // LibOpGreaterThanOrEqualToNP.integrity, + LibOpGreaterThanOrEqualTo.integrity, // LibOpIfNP.integrity, LibOpIsZero.integrity, LibOpLessThan.integrity, - // LibOpLessThanOrEqualToNP.integrity, + LibOpLessThanOrEqualTo.integrity, // LibOpExponentialGrowth.integrity, // LibOpLinearGrowth.integrity, LibOpMaxUint256.integrity, @@ -714,11 +714,11 @@ library LibAllStandardOps { LibOpBinaryEqualTo.run, // LibOpEveryNP.run, LibOpGreaterThan.run, - // LibOpGreaterThanOrEqualToNP.run, + LibOpGreaterThanOrEqualTo.run, // LibOpIfNP.run, LibOpIsZero.run, LibOpLessThan.run, - // LibOpLessThanOrEqualToNP.run, + LibOpLessThanOrEqualTo.run, // LibOpExponentialGrowth.run, // LibOpLinearGrowth.run, LibOpMaxUint256.run, diff --git a/src/lib/op/logic/LibOpGreaterThanOrEqualToNP.sol b/src/lib/op/logic/LibOpGreaterThanOrEqualTo.sol similarity index 53% rename from src/lib/op/logic/LibOpGreaterThanOrEqualToNP.sol rename to src/lib/op/logic/LibOpGreaterThanOrEqualTo.sol index 77c3d3ac0..ca4c55151 100644 --- a/src/lib/op/logic/LibOpGreaterThanOrEqualToNP.sol +++ b/src/lib/op/logic/LibOpGreaterThanOrEqualTo.sol @@ -5,11 +5,13 @@ import {OperandV2} from "rain.interpreter.interface/interface/unstable/IInterpre import {Pointer} from "rain.solmem/lib/LibPointer.sol"; import {InterpreterState} from "../../state/LibInterpreterState.sol"; import {IntegrityCheckState} from "../../integrity/LibIntegrityCheck.sol"; +import {StackItem} from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; +import {Float, LibDecimalFloat} from "rain.math.float/lib/LibDecimalFloat.sol"; -/// @title LibOpGreaterThanOrEqualToNP +/// @title LibOpGreaterThanOrEqualTo /// @notice Opcode to return 1 if the first item on the stack is greater than or /// equal to the second item on the stack, else 0. -library LibOpGreaterThanOrEqualToNP { +library LibOpGreaterThanOrEqualTo { function integrity(IntegrityCheckState memory, OperandV2) internal pure returns (uint256, uint256) { return (2, 1); } @@ -18,21 +20,30 @@ library LibOpGreaterThanOrEqualToNP { /// GTE is 1 if the first item is greater than or equal to the second item, /// else 0. function run(InterpreterState memory, OperandV2, Pointer stackTop) internal pure returns (Pointer) { + Float a; + Float b; assembly ("memory-safe") { - let a := mload(stackTop) + a := mload(stackTop) stackTop := add(stackTop, 0x20) - mstore(stackTop, iszero(lt(a, mload(stackTop)))) + b := mload(stackTop) + } + bool greaterThanOrEqual = LibDecimalFloat.gte(a, b); + assembly ("memory-safe") { + mstore(stackTop, greaterThanOrEqual) } return stackTop; } /// Gas intensive reference implementation of GTE for testing. - function referenceFn(InterpreterState memory, OperandV2, uint256[] memory inputs) + function referenceFn(InterpreterState memory, OperandV2, StackItem[] memory inputs) internal pure - returns (uint256[] memory outputs) + returns (StackItem[] memory outputs) { - outputs = new uint256[](1); - outputs[0] = inputs[0] >= inputs[1] ? 1 : 0; + Float a = Float.wrap(StackItem.unwrap(inputs[0])); + Float b = Float.wrap(StackItem.unwrap(inputs[1])); + bool greaterThanOrEqual = LibDecimalFloat.gte(a, b); + outputs = new StackItem[](1); + outputs[0] = StackItem.wrap(bytes32(uint256(greaterThanOrEqual ? 1 : 0))); } } diff --git a/src/lib/op/logic/LibOpLessThanOrEqualToNP.sol b/src/lib/op/logic/LibOpLessThanOrEqualTo.sol similarity index 53% rename from src/lib/op/logic/LibOpLessThanOrEqualToNP.sol rename to src/lib/op/logic/LibOpLessThanOrEqualTo.sol index 09798f4d4..c61111dbe 100644 --- a/src/lib/op/logic/LibOpLessThanOrEqualToNP.sol +++ b/src/lib/op/logic/LibOpLessThanOrEqualTo.sol @@ -5,11 +5,13 @@ import {OperandV2} from "rain.interpreter.interface/interface/unstable/IInterpre import {Pointer} from "rain.solmem/lib/LibPointer.sol"; import {IntegrityCheckState} from "../../integrity/LibIntegrityCheck.sol"; import {InterpreterState} from "../../state/LibInterpreterState.sol"; +import {StackItem} from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; +import {Float, LibDecimalFloat} from "rain.math.float/lib/LibDecimalFloat.sol"; -/// @title LibOpLessThanOrEqualToNP +/// @title LibOpLessThanOrEqualTo /// @notice Opcode to return 1 if the first item on the stack is less than or /// equal to the second item on the stack, else 0. -library LibOpLessThanOrEqualToNP { +library LibOpLessThanOrEqualTo { function integrity(IntegrityCheckState memory, OperandV2) internal pure returns (uint256, uint256) { return (2, 1); } @@ -18,21 +20,30 @@ library LibOpLessThanOrEqualToNP { /// LTE is 1 if the first item is less than or equal to the second item, /// else 0. function run(InterpreterState memory, OperandV2, Pointer stackTop) internal pure returns (Pointer) { + Float a; + Float b; assembly ("memory-safe") { - let a := mload(stackTop) + a := mload(stackTop) stackTop := add(stackTop, 0x20) - mstore(stackTop, iszero(gt(a, mload(stackTop)))) + b := mload(stackTop) + } + bool lessThanOrEqual = LibDecimalFloat.lte(a, b); + assembly ("memory-safe") { + mstore(stackTop, lessThanOrEqual) } return stackTop; } /// Gas intensive reference implementation of LTE for testing. - function referenceFn(InterpreterState memory, OperandV2, uint256[] memory inputs) + function referenceFn(InterpreterState memory, OperandV2, StackItem[] memory inputs) internal pure - returns (uint256[] memory outputs) + returns (StackItem[] memory outputs) { - outputs = new uint256[](1); - outputs[0] = inputs[0] <= inputs[1] ? 1 : 0; + Float a = Float.wrap(StackItem.unwrap(inputs[0])); + Float b = Float.wrap(StackItem.unwrap(inputs[1])); + bool lessThanOrEqual = LibDecimalFloat.lte(a, b); + outputs = new StackItem[](1); + outputs[0] = StackItem.wrap(bytes32(uint256(lessThanOrEqual ? 1 : 0))); } } diff --git a/test/src/lib/op/logic/LibOpGreaterThanOrEqualTo.t.sol b/test/src/lib/op/logic/LibOpGreaterThanOrEqualTo.t.sol new file mode 100644 index 000000000..9a235b851 --- /dev/null +++ b/test/src/lib/op/logic/LibOpGreaterThanOrEqualTo.t.sol @@ -0,0 +1,102 @@ +// SPDX-License-Identifier: CAL +pragma solidity =0.8.25; + +import {OpTest} from "test/abstract/OpTest.sol"; +// // import {LibContext} from "rain.interpreter.interface/lib/caller/LibContext.sol"; +import {LibOpGreaterThanOrEqualTo} from "src/lib/op/logic/LibOpGreaterThanOrEqualTo.sol"; +import {IntegrityCheckState, BadOpInputsLength} from "src/lib/integrity/LibIntegrityCheck.sol"; +import { + IInterpreterV4, + OperandV2, + SourceIndexV2, + FullyQualifiedNamespace +} from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; +import {InterpreterState} from "src/lib/state/LibInterpreterState.sol"; +// // import {IInterpreterStoreV2} from "rain.interpreter.interface/interface/IInterpreterStoreV2.sol"; +// // import {SignedContextV1} from "rain.interpreter.interface/interface/IInterpreterCallerV3.sol"; +import {LibOperand} from "test/lib/operand/LibOperand.sol"; +import {StackItem} from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; + +contract LibOpGreaterThanOrEqualToTest is OpTest { + /// Directly test the integrity logic of LibOpGreaterThanOrEqualTo. No matter the + /// operand inputs, the calc inputs must be 2, and the calc outputs must be + /// 1. + function testOpGreaterThanOrEqualToIntegrityHappy(IntegrityCheckState memory state, uint8 inputs) external pure { + (uint256 calcInputs, uint256 calcOutputs) = + LibOpGreaterThanOrEqualTo.integrity(state, OperandV2.wrap(bytes32(uint256(inputs) << 0x10))); + + // The inputs from the operand are ignored. The op is always 2 inputs. + assertEq(calcInputs, 2); + assertEq(calcOutputs, 1); + } + + /// Directly test the runtime logic of LibOpGreaterThanOrEqualTo. + function testOpGreaterThanOrEqualToNPRun(StackItem input1, StackItem input2) external view { + InterpreterState memory state = opTestDefaultInterpreterState(); + StackItem[] memory inputs = new StackItem[](2); + inputs[0] = input1; + inputs[1] = input2; + OperandV2 operand = LibOperand.build(uint8(inputs.length), 1, 0); + opReferenceCheck( + state, + operand, + LibOpGreaterThanOrEqualTo.referenceFn, + LibOpGreaterThanOrEqualTo.integrity, + LibOpGreaterThanOrEqualTo.run, + inputs + ); + } + + /// Test the eval of greater than or equal to opcode parsed from a string. + /// Tests 2 inputs. Both inputs are 0. + function testOpGreaterThanOrEqualToEval2ZeroInputs() external view { + checkHappy("_: greater-than-or-equal-to(0 0);", bytes32(uint256(1)), ""); + } + + /// Test the eval of greater than or equal to opcode parsed from a string. + /// Tests 2 inputs. The first input is 0, the second input is 1. + function testOpGreaterThanOrEqualToEval2InputsFirstZeroSecondOne() external view { + checkHappy("_: greater-than-or-equal-to(0 1);", 0, ""); + } + + /// Test the eval of greater than or equal to opcode parsed from a string. + /// Tests 2 inputs. The first input is 1, the second input is 0. + function testOpGreaterThanOrEqualToEval2InputsFirstOneSecondZero() external view { + checkHappy("_: greater-than-or-equal-to(1 0);", bytes32(uint256(1)), ""); + } + + /// Test the eval of greater than or equal to opcode parsed from a string. + /// Tests 2 inputs. Both inputs are 1. + function testOpGreaterThanOrEqualToEval2InputsBothOne() external view { + checkHappy("_: greater-than-or-equal-to(1 1);", bytes32(uint256(1)), ""); + } + + /// Test that a greater than or equal to without inputs fails integrity check. + function testOpGreaterThanOrEqualToEvalFail0Inputs() public { + vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 0, 2, 0)); + bytes memory bytecode = iDeployer.parse2("_: greater-than-or-equal-to();"); + (bytecode); + } + + /// Test that a greater than or equal to with 1 input fails integrity check. + function testOpGreaterThanOrEqualToEvalFail1Input() public { + vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 1, 2, 1)); + bytes memory bytecode = iDeployer.parse2("_: greater-than-or-equal-to(0x00);"); + (bytecode); + } + + /// Test that a greater than or equal to with 3 inputs fails integrity check. + function testOpGreaterThanOrEqualToEvalFail3Inputs() public { + vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 3, 2, 3)); + bytes memory bytecode = iDeployer.parse2("_: greater-than-or-equal-to(0x00 0x00 0x00);"); + (bytecode); + } + + function testOpGreaterThanOrEqualToZeroOutputs() external { + checkBadOutputs(": greater-than-or-equal-to(1 2);", 2, 1, 0); + } + + function testOpGreaterThanOrEqualToTwoOutputs() external { + checkBadOutputs("_ _: greater-than-or-equal-to(1 2);", 2, 1, 2); + } +} diff --git a/test/src/lib/op/logic/LibOpGreaterThanOrEqualToNP.t.sol b/test/src/lib/op/logic/LibOpGreaterThanOrEqualToNP.t.sol deleted file mode 100644 index 3a5ee6227..000000000 --- a/test/src/lib/op/logic/LibOpGreaterThanOrEqualToNP.t.sol +++ /dev/null @@ -1,104 +0,0 @@ -// SPDX-License-Identifier: CAL -pragma solidity =0.8.25; - -// // import {OpTest} from "test/abstract/OpTest.sol"; -// // import {LibContext} from "rain.interpreter.interface/lib/caller/LibContext.sol"; -// // import {LibOpGreaterThanOrEqualToNP} from "src/lib/op/logic/LibOpGreaterThanOrEqualToNP.sol"; -// // import {IntegrityCheckState, BadOpInputsLength} from "src/lib/integrity/LibIntegrityCheck.sol"; -// // import { -// // IInterpreterV4, -// // Operand, -// // SourceIndexV2, -// // FullyQualifiedNamespace -// // } from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; -// // import {InterpreterState} from "src/lib/state/LibInterpreterState.sol"; -// // import {IInterpreterStoreV2} from "rain.interpreter.interface/interface/IInterpreterStoreV2.sol"; -// // import {SignedContextV1} from "rain.interpreter.interface/interface/IInterpreterCallerV3.sol"; -// // import {LibOperand} from "test/lib/operand/LibOperand.sol"; - -// contract LibOpGreaterThanOrEqualToNPTest is OpTest { -// /// Directly test the integrity logic of LibOpGreaterThanOrEqualToNP. No matter the -// /// operand inputs, the calc inputs must be 2, and the calc outputs must be -// /// 1. -// function testOpGreaterThanOrEqualToNPIntegrityHappy(IntegrityCheckState memory state, uint8 inputs) -// external -// pure -// { -// (uint256 calcInputs, uint256 calcOutputs) = -// LibOpGreaterThanOrEqualToNP.integrity(state, Operand.wrap(uint256(inputs) << 0x10)); - -// // // The inputs from the operand are ignored. The op is always 2 inputs. -// // assertEq(calcInputs, 2); -// // assertEq(calcOutputs, 1); -// // } - -// /// Directly test the runtime logic of LibOpGreaterThanOrEqualToNP. -// function testOpGreaterThanOrEqualToNPRun(uint256 input1, uint256 input2) external view { -// InterpreterState memory state = opTestDefaultInterpreterState(); -// uint256[] memory inputs = new uint256[](2); -// inputs[0] = input1; -// inputs[1] = input2; -// Operand operand = LibOperand.build(uint8(inputs.length), 1, 0); -// opReferenceCheck( -// state, -// operand, -// LibOpGreaterThanOrEqualToNP.referenceFn, -// LibOpGreaterThanOrEqualToNP.integrity, -// LibOpGreaterThanOrEqualToNP.run, -// inputs -// ); -// } - -// // /// Test the eval of greater than or equal to opcode parsed from a string. -// // /// Tests 2 inputs. Both inputs are 0. -// // function testOpGreaterThanOrEqualToNPEval2ZeroInputs() external { -// // checkHappy("_: greater-than-or-equal-to(0 0);", 1, ""); -// // } - -// // /// Test the eval of greater than or equal to opcode parsed from a string. -// // /// Tests 2 inputs. The first input is 0, the second input is 1. -// // function testOpGreaterThanOrEqualToNPEval2InputsFirstZeroSecondOne() external { -// // checkHappy("_: greater-than-or-equal-to(0 1);", 0, ""); -// // } - -// // /// Test the eval of greater than or equal to opcode parsed from a string. -// // /// Tests 2 inputs. The first input is 1, the second input is 0. -// // function testOpGreaterThanOrEqualToNPEval2InputsFirstOneSecondZero() external { -// // checkHappy("_: greater-than-or-equal-to(1 0);", 1, ""); -// // } - -// // /// Test the eval of greater than or equal to opcode parsed from a string. -// // /// Tests 2 inputs. Both inputs are 1. -// // function testOpGreaterThanOrEqualToNPEval2InputsBothOne() external { -// // checkHappy("_: greater-than-or-equal-to(1 1);", 1, ""); -// // } - -// // /// Test that a greater than or equal to without inputs fails integrity check. -// // function testOpGreaterThanOrEqualToNPEvalFail0Inputs() public { -// // vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 0, 2, 0)); -// // bytes memory bytecode = iDeployer.parse2("_: greater-than-or-equal-to();"); -// // (bytecode); -// // } - -// // /// Test that a greater than or equal to with 1 input fails integrity check. -// // function testOpGreaterThanOrEqualToNPEvalFail1Input() public { -// // vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 1, 2, 1)); -// // bytes memory bytecode = iDeployer.parse2("_: greater-than-or-equal-to(0x00);"); -// // (bytecode); -// // } - -// // /// Test that a greater than or equal to with 3 inputs fails integrity check. -// // function testOpGreaterThanOrEqualToNPEvalFail3Inputs() public { -// // vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 3, 2, 3)); -// // bytes memory bytecode = iDeployer.parse2("_: greater-than-or-equal-to(0x00 0x00 0x00);"); -// // (bytecode); -// // } - -// // function testOpGreaterThanOrEqualToNPZeroOutputs() external { -// // checkBadOutputs(": greater-than-or-equal-to(1 2);", 2, 1, 0); -// // } - -// // function testOpGreaterThanOrEqualToNPTwoOutputs() external { -// // checkBadOutputs("_ _: greater-than-or-equal-to(1 2);", 2, 1, 2); -// // } -// // } diff --git a/test/src/lib/op/logic/LibOpLessThanOrEqualTo.t.sol b/test/src/lib/op/logic/LibOpLessThanOrEqualTo.t.sol new file mode 100644 index 000000000..16c4f23af --- /dev/null +++ b/test/src/lib/op/logic/LibOpLessThanOrEqualTo.t.sol @@ -0,0 +1,170 @@ +// SPDX-License-Identifier: CAL +pragma solidity =0.8.25; + +import {OpTest} from "test/abstract/OpTest.sol"; +import {LibOpLessThanOrEqualTo} from "src/lib/op/logic/LibOpLessThanOrEqualTo.sol"; +import {IntegrityCheckState, BadOpInputsLength} from "src/lib/integrity/LibIntegrityCheck.sol"; +import { + IInterpreterV4, + OperandV2, + SourceIndexV2, + FullyQualifiedNamespace, + EvalV4 +} from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; +import {InterpreterState} from "src/lib/state/LibInterpreterState.sol"; +import {SignedContextV1} from "rain.interpreter.interface/interface/IInterpreterCallerV3.sol"; +import {LibContext} from "rain.interpreter.interface/lib/caller/LibContext.sol"; +import {LibOperand} from "test/lib/operand/LibOperand.sol"; +import {StackItem} from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; + +contract LibOpLessThanOrEqualToTest is OpTest { + /// Directly test the integrity logic of LibOpLessThanOrEqualTo. No matter the + /// operand inputs, the calc inputs must be 2, and the calc outputs must be + /// 1. + function testOpLessThanOrEqualToIntegrityHappy( + IntegrityCheckState memory state, + uint8 inputs, + uint8 outputs, + uint16 operandData + ) external pure { + inputs = uint8(bound(inputs, 0, 0x0F)); + outputs = uint8(bound(outputs, 0, 0x0F)); + (uint256 calcInputs, uint256 calcOutputs) = + LibOpLessThanOrEqualTo.integrity(state, LibOperand.build(inputs, outputs, operandData)); + + // The inputs from the operand are ignored. The op is always 2 inputs. + assertEq(calcInputs, 2); + assertEq(calcOutputs, 1); + } + + /// Directly test the runtime logic of LibOpLessThanOrEqualTo. + function testOpLessThanOrEqualToRun(StackItem input1, StackItem input2) external view { + InterpreterState memory state = opTestDefaultInterpreterState(); + StackItem[] memory inputs = new StackItem[](2); + inputs[0] = input1; + inputs[1] = input2; + OperandV2 operand = LibOperand.build(uint8(inputs.length), 1, 0); + opReferenceCheck( + state, + operand, + LibOpLessThanOrEqualTo.referenceFn, + LibOpLessThanOrEqualTo.integrity, + LibOpLessThanOrEqualTo.run, + inputs + ); + } + + /// Test the eval of greater than or equal to opcode parsed from a string. + /// Tests 2 inputs. Both inputs are 0. + function testOpLessThanOrEqualToEval2ZeroInputs() external view { + bytes memory bytecode = iDeployer.parse2("_: less-than-or-equal-to(0 0);"); + (StackItem[] memory stack, bytes32[] memory kvs) = iInterpreter.eval4( + EvalV4({ + store: iStore, + namespace: FullyQualifiedNamespace.wrap(0), + bytecode: bytecode, + sourceIndex: SourceIndexV2.wrap(0), + context: LibContext.build(new bytes32[][](0), new SignedContextV1[](0)), + inputs: new StackItem[](0), + stateOverlay: new bytes32[](0) + }) + ); + + assertEq(stack.length, 1); + assertEq(StackItem.unwrap(stack[0]), bytes32(uint256(1))); + assertEq(kvs.length, 0); + } + + /// Test the eval of greater than or equal to opcode parsed from a string. + /// Tests 2 inputs. The first input is 0, the second input is 1. + function testOpLessThanOrEqualToEval2InputsFirstZeroSecondOne() external view { + bytes memory bytecode = iDeployer.parse2("_: less-than-or-equal-to(0 1);"); + (StackItem[] memory stack, bytes32[] memory kvs) = iInterpreter.eval4( + EvalV4({ + store: iStore, + namespace: FullyQualifiedNamespace.wrap(0), + bytecode: bytecode, + sourceIndex: SourceIndexV2.wrap(0), + context: LibContext.build(new bytes32[][](0), new SignedContextV1[](0)), + inputs: new StackItem[](0), + stateOverlay: new bytes32[](0) + }) + ); + + assertEq(stack.length, 1); + assertEq(StackItem.unwrap(stack[0]), bytes32(uint256(1))); + assertEq(kvs.length, 0); + } + + /// Test the eval of greater than or equal to opcode parsed from a string. + /// Tests 2 inputs. The first input is 1, the second input is 0. + function testOpLessThanOrEqualToEval2InputsFirstOneSecondZero() external view { + bytes memory bytecode = iDeployer.parse2("_: less-than-or-equal-to(1 0);"); + (StackItem[] memory stack, bytes32[] memory kvs) = iInterpreter.eval4( + EvalV4({ + store: iStore, + namespace: FullyQualifiedNamespace.wrap(0), + bytecode: bytecode, + sourceIndex: SourceIndexV2.wrap(0), + context: LibContext.build(new bytes32[][](0), new SignedContextV1[](0)), + inputs: new StackItem[](0), + stateOverlay: new bytes32[](0) + }) + ); + + assertEq(stack.length, 1); + assertEq(StackItem.unwrap(stack[0]), bytes32(0)); + assertEq(kvs.length, 0); + } + + /// Test the eval of greater than or equal to opcode parsed from a string. + /// Tests 2 inputs. Both inputs are 1. + function testOpLessThanOrEqualToEval2InputsBothOne() external view { + bytes memory bytecode = iDeployer.parse2("_: less-than-or-equal-to(1 1);"); + (StackItem[] memory stack, bytes32[] memory kvs) = iInterpreter.eval4( + EvalV4({ + store: iStore, + namespace: FullyQualifiedNamespace.wrap(0), + bytecode: bytecode, + sourceIndex: SourceIndexV2.wrap(0), + context: LibContext.build(new bytes32[][](0), new SignedContextV1[](0)), + inputs: new StackItem[](0), + stateOverlay: new bytes32[](0) + }) + ); + + assertEq(stack.length, 1); + assertEq(StackItem.unwrap(stack[0]), bytes32(uint256(1))); + assertEq(kvs.length, 0); + } + + /// Test that a less than or equal to without inputs fails integrity check. + function testOpLessThanOrEqualToEvalFail0Inputs() public { + vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 0, 2, 0)); + bytes memory bytecode = iDeployer.parse2("_: less-than-or-equal-to();"); + (bytecode); + } + + /// Test that a less than or equal to with 1 input fails integrity check. + function testOpLessThanOrEqualToEvalFail1Input() public { + vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 1, 2, 1)); + bytes memory bytecode = iDeployer.parse2("_: less-than-or-equal-to(0x00);"); + (bytecode); + } + + /// Test that a less than or equal to with 3 inputs fails integrity check. + function testOpLessThanOrEqualToEvalFail3Inputs() public { + vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 3, 2, 3)); + + bytes memory bytecode = iDeployer.parse2("_: less-than-or-equal-to(0x00 0x00 0x00);"); + (bytecode); + } + + function testOpLessThanOrEqualToZeroOutputs() external { + checkBadOutputs(": less-than-or-equal-to(1 2);", 2, 1, 0); + } + + function testOpLessThanOrEqualToTwoOutputs() external { + checkBadOutputs("_ _: less-than-or-equal-to(1 2);", 2, 1, 2); + } +} diff --git a/test/src/lib/op/logic/LibOpLessThanOrEqualToNP.t.sol b/test/src/lib/op/logic/LibOpLessThanOrEqualToNP.t.sol deleted file mode 100644 index 509195e8c..000000000 --- a/test/src/lib/op/logic/LibOpLessThanOrEqualToNP.t.sol +++ /dev/null @@ -1,170 +0,0 @@ -// SPDX-License-Identifier: CAL -pragma solidity =0.8.25; - -// // import {OpTest} from "test/abstract/OpTest.sol"; -// // import {LibOpLessThanOrEqualToNP} from "src/lib/op/logic/LibOpLessThanOrEqualToNP.sol"; -// // import {IntegrityCheckState, BadOpInputsLength} from "src/lib/integrity/LibIntegrityCheck.sol"; -// // import { -// // IInterpreterV4, -// // Operand, -// // SourceIndexV2, -// // FullyQualifiedNamespace, -// // EvalV4 -// // } from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; -// // import {InterpreterState} from "src/lib/state/LibInterpreterState.sol"; -// // import {IInterpreterStoreV2} from "rain.interpreter.interface/interface/IInterpreterStoreV2.sol"; -// // import {SignedContextV1} from "rain.interpreter.interface/interface/IInterpreterCallerV3.sol"; -// // import {LibContext} from "rain.interpreter.interface/lib/caller/LibContext.sol"; -// // import {LibOperand} from "test/lib/operand/LibOperand.sol"; - -// contract LibOpLessThanOrEqualToNPTest is OpTest { -// /// Directly test the integrity logic of LibOpLessThanOrEqualToNP. No matter the -// /// operand inputs, the calc inputs must be 2, and the calc outputs must be -// /// 1. -// function testOpLessThanOrEqualToNPIntegrityHappy( -// IntegrityCheckState memory state, -// uint8 inputs, -// uint8 outputs, -// uint16 operandData -// ) external pure { -// inputs = uint8(bound(inputs, 0, 0x0F)); -// outputs = uint8(bound(outputs, 0, 0x0F)); -// (uint256 calcInputs, uint256 calcOutputs) = -// LibOpLessThanOrEqualToNP.integrity(state, LibOperand.build(inputs, outputs, operandData)); - -// // // The inputs from the operand are ignored. The op is always 2 inputs. -// // assertEq(calcInputs, 2); -// // assertEq(calcOutputs, 1); -// // } - -// /// Directly test the runtime logic of LibOpLessThanOrEqualToNP. -// function testOpLessThanOrEqualToNPRun(uint256 input1, uint256 input2) external view { -// InterpreterState memory state = opTestDefaultInterpreterState(); -// uint256[] memory inputs = new uint256[](2); -// inputs[0] = input1; -// inputs[1] = input2; -// Operand operand = LibOperand.build(uint8(inputs.length), 1, 0); -// opReferenceCheck( -// state, -// operand, -// LibOpLessThanOrEqualToNP.referenceFn, -// LibOpLessThanOrEqualToNP.integrity, -// LibOpLessThanOrEqualToNP.run, -// inputs -// ); -// } - -// /// Test the eval of greater than or equal to opcode parsed from a string. -// /// Tests 2 inputs. Both inputs are 0. -// function testOpLessThanOrEqualToNPEval2ZeroInputs() external view { -// bytes memory bytecode = iDeployer.parse2("_: less-than-or-equal-to(0 0);"); -// (uint256[] memory stack, uint256[] memory kvs) = iInterpreter.eval4( -// EvalV4({ -// store: iStore, -// namespace: FullyQualifiedNamespace.wrap(0), -// bytecode: bytecode, -// sourceIndex: SourceIndexV2.wrap(0), -// context: LibContext.build(new uint256[][](0), new SignedContextV1[](0)), -// inputs: new uint256[](0), -// stateOverlay: new uint256[](0) -// }) -// ); - -// // assertEq(stack.length, 1); -// // assertEq(stack[0], 1); -// // assertEq(kvs.length, 0); -// // } - -// /// Test the eval of greater than or equal to opcode parsed from a string. -// /// Tests 2 inputs. The first input is 0, the second input is 1. -// function testOpLessThanOrEqualToNPEval2InputsFirstZeroSecondOne() external view { -// bytes memory bytecode = iDeployer.parse2("_: less-than-or-equal-to(0 1);"); -// (uint256[] memory stack, uint256[] memory kvs) = iInterpreter.eval4( -// EvalV4({ -// store: iStore, -// namespace: FullyQualifiedNamespace.wrap(0), -// bytecode: bytecode, -// sourceIndex: SourceIndexV2.wrap(0), -// context: LibContext.build(new uint256[][](0), new SignedContextV1[](0)), -// inputs: new uint256[](0), -// stateOverlay: new uint256[](0) -// }) -// ); - -// // assertEq(stack.length, 1); -// // assertEq(stack[0], 1); -// // assertEq(kvs.length, 0); -// // } - -// /// Test the eval of greater than or equal to opcode parsed from a string. -// /// Tests 2 inputs. The first input is 1, the second input is 0. -// function testOpLessThanOrEqualToNPEval2InputsFirstOneSecondZero() external view { -// bytes memory bytecode = iDeployer.parse2("_: less-than-or-equal-to(1 0);"); -// (uint256[] memory stack, uint256[] memory kvs) = iInterpreter.eval4( -// EvalV4({ -// store: iStore, -// namespace: FullyQualifiedNamespace.wrap(0), -// bytecode: bytecode, -// sourceIndex: SourceIndexV2.wrap(0), -// context: LibContext.build(new uint256[][](0), new SignedContextV1[](0)), -// inputs: new uint256[](0), -// stateOverlay: new uint256[](0) -// }) -// ); - -// // assertEq(stack.length, 1); -// // assertEq(stack[0], 0); -// // assertEq(kvs.length, 0); -// // } - -// /// Test the eval of greater than or equal to opcode parsed from a string. -// /// Tests 2 inputs. Both inputs are 1. -// function testOpLessThanOrEqualToNPEval2InputsBothOne() external view { -// bytes memory bytecode = iDeployer.parse2("_: less-than-or-equal-to(1 1);"); -// (uint256[] memory stack, uint256[] memory kvs) = iInterpreter.eval4( -// EvalV4({ -// store: iStore, -// namespace: FullyQualifiedNamespace.wrap(0), -// bytecode: bytecode, -// sourceIndex: SourceIndexV2.wrap(0), -// context: LibContext.build(new uint256[][](0), new SignedContextV1[](0)), -// inputs: new uint256[](0), -// stateOverlay: new uint256[](0) -// }) -// ); - -// // assertEq(stack.length, 1); -// // assertEq(stack[0], 1); -// // assertEq(kvs.length, 0); -// // } - -// // /// Test that a less than or equal to without inputs fails integrity check. -// // function testOpLessThanOrEqualToNPEvalFail0Inputs() public { -// // vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 0, 2, 0)); -// // bytes memory bytecode = iDeployer.parse2("_: less-than-or-equal-to();"); -// // (bytecode); -// // } - -// // /// Test that a less than or equal to with 1 input fails integrity check. -// // function testOpLessThanOrEqualToNPEvalFail1Input() public { -// // vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 1, 2, 1)); -// // bytes memory bytecode = iDeployer.parse2("_: less-than-or-equal-to(0x00);"); -// // (bytecode); -// // } - -// // /// Test that a less than or equal to with 3 inputs fails integrity check. -// // function testOpLessThanOrEqualToNPEvalFail3Inputs() public { -// // vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 3, 2, 3)); - -// // bytes memory bytecode = iDeployer.parse2("_: less-than-or-equal-to(0x00 0x00 0x00);"); -// // (bytecode); -// // } - -// // function testOpLessThanOrEqualToNPZeroOutputs() external { -// // checkBadOutputs(": less-than-or-equal-to(1 2);", 2, 1, 0); -// // } - -// // function testOpLessThanOrEqualToNPTwoOutputs() external { -// // checkBadOutputs("_ _: less-than-or-equal-to(1 2);", 2, 1, 2); -// // } -// // } From a10a9f8efef6096c527cc9fde370e9333d1f133f Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Sun, 20 Jul 2025 19:44:39 +0400 Subject: [PATCH 3/4] lint --- test/src/lib/op/logic/LibOpGreaterThanOrEqualTo.t.sol | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/src/lib/op/logic/LibOpGreaterThanOrEqualTo.t.sol b/test/src/lib/op/logic/LibOpGreaterThanOrEqualTo.t.sol index 9a235b851..e0c4a3028 100644 --- a/test/src/lib/op/logic/LibOpGreaterThanOrEqualTo.t.sol +++ b/test/src/lib/op/logic/LibOpGreaterThanOrEqualTo.t.sol @@ -2,7 +2,6 @@ pragma solidity =0.8.25; import {OpTest} from "test/abstract/OpTest.sol"; -// // import {LibContext} from "rain.interpreter.interface/lib/caller/LibContext.sol"; import {LibOpGreaterThanOrEqualTo} from "src/lib/op/logic/LibOpGreaterThanOrEqualTo.sol"; import {IntegrityCheckState, BadOpInputsLength} from "src/lib/integrity/LibIntegrityCheck.sol"; import { @@ -12,8 +11,6 @@ import { FullyQualifiedNamespace } from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; import {InterpreterState} from "src/lib/state/LibInterpreterState.sol"; -// // import {IInterpreterStoreV2} from "rain.interpreter.interface/interface/IInterpreterStoreV2.sol"; -// // import {SignedContextV1} from "rain.interpreter.interface/interface/IInterpreterCallerV3.sol"; import {LibOperand} from "test/lib/operand/LibOperand.sol"; import {StackItem} from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; From f1179b6501d7b9419bf43625da70869bced22d5f Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Sun, 20 Jul 2025 19:45:22 +0400 Subject: [PATCH 4/4] lint --- test/src/lib/op/logic/LibOpGreaterThanOrEqualTo.t.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/src/lib/op/logic/LibOpGreaterThanOrEqualTo.t.sol b/test/src/lib/op/logic/LibOpGreaterThanOrEqualTo.t.sol index e0c4a3028..209e8fad4 100644 --- a/test/src/lib/op/logic/LibOpGreaterThanOrEqualTo.t.sol +++ b/test/src/lib/op/logic/LibOpGreaterThanOrEqualTo.t.sol @@ -28,7 +28,7 @@ contract LibOpGreaterThanOrEqualToTest is OpTest { } /// Directly test the runtime logic of LibOpGreaterThanOrEqualTo. - function testOpGreaterThanOrEqualToNPRun(StackItem input1, StackItem input2) external view { + function testOpGreaterThanOrEqualToRun(StackItem input1, StackItem input2) external view { InterpreterState memory state = opTestDefaultInterpreterState(); StackItem[] memory inputs = new StackItem[](2); inputs[0] = input1;