diff --git a/.gas-snapshot b/.gas-snapshot index 58b22c2a3..be5353363 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -1,1007 +1,471 @@ -BaseRainterpreterExternNPE2IERC165Test:testRainterpreterExternNPE2IERC165(bytes4) (runs: 2051, μ: 286333, ~: 286333) -BaseRainterpreterSubParserNPE2CompatibilityTest:testRainterpreterSubParserNPE2Compatibility(bytes32,bytes) (runs: 2051, μ: 679904, ~: 679856) -BaseRainterpreterSubParserNPE2IERC165Test:testRainterpreterSubParserNPE2IERC165(uint32) (runs: 2051, μ: 679191, ~: 679191) -LibAllStandardOpsNPTest:testIntegrityAndOpcodeFunctionPointersLength() (gas: 86008) -LibAllStandardOpsNPTest:testIntegrityFunctionPointersLength() (gas: 9255) -LibAllStandardOpsNPTest:testOpcodeFunctionPointersLength() (gas: 9249) -LibEvalNPFBoundsTest:testEvalNPFBoundsModConstant(uint256) (runs: 2051, μ: 58513, ~: 58513) -LibExternCodecTest:testLibExternCodecEncodeExternCall(uint256,uint256) (runs: 2051, μ: 5867, ~: 5746) -LibExternCodecTest:testLibExternCodecEncodeExternDispatch(uint256,uint256) (runs: 2051, μ: 5697, ~: 5576) -LibInterpreterStateNPStackTraceTest:testStackTraceCall(uint256,uint256,uint256[]) (runs: 2051, μ: 41313, ~: 41040) -LibOpAddTest:testOpAddEval2InputsHappy() (gas: 100503) -LibOpAddTest:testOpAddEval2InputsHappyZero() (gas: 53587) -LibOpAddTest:testOpAddEval2InputsHappyZeroMax() (gas: 96466) -LibOpAddTest:testOpAddEval2InputsHappyZeroOne() (gas: 99410) -LibOpAddTest:testOpAddEval2InputsUnhappy() (gas: 98415) -LibOpAddTest:testOpAddEval3InputsHappy() (gas: 321631) -LibOpAddTest:testOpAddEval3InputsUnhappy() (gas: 677862) -LibOpAddTest:testOpAddEvalOneInput() (gas: 35919) -LibOpAddTest:testOpAddEvalOperandDisallowed() (gas: 93475) -LibOpAddTest:testOpAddEvalTwoOutput() (gas: 42680) -LibOpAddTest:testOpAddEvalZeroInputs() (gas: 30178) -LibOpAddTest:testOpAddEvalZeroOutputs() (gas: 41679) -LibOpAddTest:testOpAddIntegrityHappy((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint16) (runs: 2051, μ: 14753, ~: 14754) -LibOpAddTest:testOpAddIntegrityUnhappyOneInput((uint256,uint256,uint256,uint256[],uint256,bytes)) (runs: 2051, μ: 10651, ~: 10498) -LibOpAddTest:testOpAddIntegrityUnhappyZeroInputs((uint256,uint256,uint256,uint256[],uint256,bytes)) (runs: 2051, μ: 10628, ~: 10475) -LibOpAddTest:testOpAddRun(uint256[]) (runs: 2049, μ: 15219, ~: 14823) -LibOpAnyNPTest:testOpAnyNPEval1FalseInput() (gas: 48078) -LibOpAnyNPTest:testOpAnyNPEval1TrueInput() (gas: 48063) -LibOpAnyNPTest:testOpAnyNPEval2FalseInputs() (gas: 53552) -LibOpAnyNPTest:testOpAnyNPEval2MixedInputs() (gas: 54320) -LibOpAnyNPTest:testOpAnyNPEval2MixedInputs2() (gas: 54424) -LibOpAnyNPTest:testOpAnyNPEval2TrueInputs() (gas: 54322) -LibOpAnyNPTest:testOpAnyNPEvalFail() (gas: 29691) -LibOpAnyNPTest:testOpAnyNPIntegrityGas0() (gas: 3279) -LibOpAnyNPTest:testOpAnyNPIntegrityHappy(uint8,uint16) (runs: 2051, μ: 5137, ~: 5264) -LibOpAnyNPTest:testOpAnyNPIntegrityUnhappyZeroInputs() (gas: 908) -LibOpAnyNPTest:testOpAnyNPRun(uint256[],uint16) (runs: 2049, μ: 13280, ~: 13272) -LibOpAnyNPTest:testOpAnyNPRunGas0() (gas: 3382) -LibOpAnyNPTest:testOpAnyNPTwoOutputs() (gas: 36001) -LibOpAnyNPTest:testOpAnyNPZeroOutputs() (gas: 34974) -LibOpAvgTest:testOpAvgEval() (gas: 405563) -LibOpAvgTest:testOpAvgEvalOneInput() (gas: 35336) -LibOpAvgTest:testOpAvgEvalOperandDisallowed() (gas: 17776) -LibOpAvgTest:testOpAvgEvalThreeInputs() (gas: 45473) -LibOpAvgTest:testOpAvgEvalTwoOutputs() (gas: 41080) -LibOpAvgTest:testOpAvgEvalZeroOutputs() (gas: 40035) -LibOpAvgTest:testOpAvgIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint256) (runs: 2051, μ: 10688, ~: 10658) -LibOpAvgTest:testOpAvgRun(uint256,uint256,uint16) (runs: 2051, μ: 13742, ~: 13445) -LibOpBitwiseAndNPTest:testOpBitwiseAndNPEvalHappy() (gas: 732519) -LibOpBitwiseAndNPTest:testOpBitwiseAndNPIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint256) (runs: 2051, μ: 10688, ~: 10658) -LibOpBitwiseAndNPTest:testOpBitwiseAndNPRun(uint256,uint256) (runs: 2051, μ: 8177, ~: 8177) -LibOpBitwiseAndNPTest:testOpBitwiseORNPEvalBadOperand() (gas: 18444) -LibOpBitwiseAndNPTest:testOpBitwiseORNPEvalOneInput() (gas: 35953) -LibOpBitwiseAndNPTest:testOpBitwiseORNPEvalThreeInputs() (gas: 46111) -LibOpBitwiseAndNPTest:testOpBitwiseORNPEvalTwoOutputs() (gas: 41761) -LibOpBitwiseAndNPTest:testOpBitwiseORNPEvalZeroInputs() (gas: 30759) -LibOpBitwiseAndNPTest:testOpBitwiseORNPEvalZeroOutputs() (gas: 40716) -LibOpBitwiseOrNPTest:testOpBitwiseORNPEval() (gas: 731225) -LibOpBitwiseOrNPTest:testOpBitwiseORNPEvalBadOperand() (gas: 18363) -LibOpBitwiseOrNPTest:testOpBitwiseORNPEvalOneInput() (gas: 35894) -LibOpBitwiseOrNPTest:testOpBitwiseORNPEvalThreeInputs() (gas: 46052) -LibOpBitwiseOrNPTest:testOpBitwiseORNPEvalTwoOutputs() (gas: 41657) -LibOpBitwiseOrNPTest:testOpBitwiseORNPEvalZeroInputs() (gas: 30700) -LibOpBitwiseOrNPTest:testOpBitwiseORNPEvalZeroOutputs() (gas: 40635) -LibOpBitwiseOrNPTest:testOpBitwiseORNPIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint256) (runs: 2051, μ: 10666, ~: 10636) -LibOpBitwiseOrNPTest:testOpBitwiseORNPRun(uint256,uint256) (runs: 2051, μ: 8153, ~: 8153) -LibOpBlockNumberNPTest:testOpBlockNumberNPEval(uint256) (runs: 2051, μ: 49578, ~: 49448) -LibOpBlockNumberNPTest:testOpBlockNumberNPEvalOneInput() (gas: 35094) -LibOpBlockNumberNPTest:testOpBlockNumberNPEvalTwoOutputs() (gas: 31448) -LibOpBlockNumberNPTest:testOpBlockNumberNPEvalZeroOutputs() (gas: 30464) -LibOpBlockNumberNPTest:testOpBlockNumberNPIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint8,uint16) (runs: 2051, μ: 16256, ~: 16360) -LibOpBlockNumberNPTest:testOpBlockNumberNPRun(uint256,uint16) (runs: 2051, μ: 14303, ~: 14163) -LibOpCallNPTest:testCallTraceInnerOnly() (gas: 62964) -LibOpCallNPTest:testCallTraceOuterAndInner() (gas: 73823) -LibOpCallNPTest:testCallTraceOuterAndTwoInner() (gas: 113845) -LibOpCallNPTest:testCallTraceOuterOnly() (gas: 45578) -LibOpCallNPTest:testOpCallNPIntegrityIO((uint256,uint256,uint256,uint256[],uint256,bytes),uint256,uint256,uint8,bytes32) (runs: 2050, μ: 38221, ~: 36743) -LibOpCallNPTest:testOpCallNPIntegritySourceIndexOutOfBounds((uint256,uint256,uint256,uint256[],uint256,bytes),uint256,uint256,uint256,uint256,bytes32) (runs: 2051, μ: 37618, ~: 35737) -LibOpCallNPTest:testOpCallNPIntegrityTooManyOutputs((uint256,uint256,uint256,uint256[],uint256,bytes),uint256,uint256,uint8,bytes32) (runs: 2048, μ: 35942, ~: 35837) -LibOpCallNPTest:testOpCallNPRunInputsMismatch() (gas: 73785) -LibOpCallNPTest:testOpCallNPRunNoIO() (gas: 693185) -LibOpCallNPTest:testOpCallNPRunOutputsMismatch() (gas: 66503) -LibOpCallNPTest:testOpCallNPRunRecursive() (gas: 304983) -LibOpCallNPTest:testOpCallNPRunSourceDoesNotExist() (gas: 351486) -LibOpCeilTest:testOpCeilEval() (gas: 201149) -LibOpCeilTest:testOpCeilEvalOperandDisallowed() (gas: 17857) -LibOpCeilTest:testOpCeilIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint256) (runs: 2051, μ: 10666, ~: 10636) -LibOpCeilTest:testOpCeilRun(uint256,uint16) (runs: 2051, μ: 12026, ~: 12236) -LibOpCeilTest:testOpCeilTwoInputs() (gas: 40475) -LibOpCeilTest:testOpCeilTwoOutputs() (gas: 36085) -LibOpCeilTest:testOpCeilZeroInputs() (gas: 30203) -LibOpCeilTest:testOpCeilZeroOutputs() (gas: 35038) -LibOpChainIdNPTest:testOpChainIDNPEval(uint64) (runs: 2051, μ: 45709, ~: 45709) -LibOpChainIdNPTest:testOpChainIDNPIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint8,uint16) (runs: 2051, μ: 16272, ~: 16333) -LibOpChainIdNPTest:testOpChainIdNPEvalFail() (gas: 34341) -LibOpChainIdNPTest:testOpChainIdNPRun(uint64,uint16) (runs: 2051, μ: 10717, ~: 10717) -LibOpChainIdNPTest:testOpChainIdNPTwoOutputs() (gas: 31173) -LibOpChainIdNPTest:testOpChainIdNPZeroOutputs() (gas: 30103) -LibOpConditionsNPTest:testOpConditionsNPEval1FalseInput1TrueInput() (gas: 68157) -LibOpConditionsNPTest:testOpConditionsNPEval1FalseInputRevert() (gas: 55539) -LibOpConditionsNPTest:testOpConditionsNPEval1TrueInput1FalseInput() (gas: 68031) -LibOpConditionsNPTest:testOpConditionsNPEval1TrueInputZeroOutput() (gas: 55150) -LibOpConditionsNPTest:testOpConditionsNPEval2MixedInputs() (gas: 55152) -LibOpConditionsNPTest:testOpConditionsNPEval2TrueInputs() (gas: 68032) -LibOpConditionsNPTest:testOpConditionsNPEvalErrorCode() (gas: 67528) -LibOpConditionsNPTest:testOpConditionsNPEvalFail0Inputs() (gas: 30360) -LibOpConditionsNPTest:testOpConditionsNPEvalFail1Inputs() (gas: 34639) -LibOpConditionsNPTest:testOpConditionsNPEvalUnhappyOperand() (gas: 18305) -LibOpConditionsNPTest:testOpConditionsNPIntegrityHappy((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint8,uint16) (runs: 2051, μ: 16496, ~: 16545) -LibOpConditionsNPTest:testOpConditionsNPRun(uint256[],uint256) (runs: 2049, μ: 13773, ~: 13876) -LibOpConditionsNPTest:testOpConditionsNPRunNoConditionsMet(uint256[],string) (runs: 2048, μ: 23258, ~: 22988) -LibOpConditionsNPTest:testOpConditionsNPTwoOutputs() (gas: 39888) -LibOpConditionsNPTest:testOpConditionsNPZeroOutputs() (gas: 38867) -LibOpConstantNPTest:testOpConstantEvalNPE2E() (gas: 50646) -LibOpConstantNPTest:testOpConstantEvalZeroConstants() (gas: 41484) -LibOpConstantNPTest:testOpConstantNPIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint256) (runs: 2051, μ: 17923, ~: 17902) -LibOpConstantNPTest:testOpConstantNPIntegrityOOBConstants((uint256,uint256,uint256,uint256[],uint256,bytes),uint256) (runs: 2051, μ: 18101, ~: 18160) -LibOpConstantNPTest:testOpConstantNPMultipleOutputErrorSugared() (gas: 31852) -LibOpConstantNPTest:testOpConstantNPMultipleOutputErrorUnsugared() (gas: 41813) -LibOpConstantNPTest:testOpConstantNPRun(uint256[],uint16) (runs: 2051, μ: 47408, ~: 47447) -LibOpConstantNPTest:testOpConstantNPZeroOutputErrorSugared() (gas: 30474) -LibOpConstantNPTest:testOpConstantNPZeroOutputErrorUnsugared() (gas: 40402) -LibOpContextNPTest:testOpContextNPEval00(uint256[][]) (runs: 2051, μ: 7242720, ~: 6132174) -LibOpContextNPTest:testOpContextNPEval01(uint256[][]) (runs: 2051, μ: 7236493, ~: 6120269) -LibOpContextNPTest:testOpContextNPEval10(uint256[][]) (runs: 2051, μ: 7282139, ~: 6195475) -LibOpContextNPTest:testOpContextNPEval11(uint256[][]) (runs: 2051, μ: 7278805, ~: 6205276) -LibOpContextNPTest:testOpContextNPEvalOOBi(uint256[]) (runs: 2051, μ: 77272, ~: 77353) -LibOpContextNPTest:testOpContextNPEvalOOBj(uint256) (runs: 2051, μ: 48259, ~: 48259) -LibOpContextNPTest:testOpContextNPIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint256) (runs: 2051, μ: 10737, ~: 10707) -LibOpContextNPTest:testOpContextNPOneInput() (gas: 41828) -LibOpContextNPTest:testOpContextNPRun(uint256[][],uint256,uint256) (runs: 2051, μ: 10533010, ~: 8960843) -LibOpContextNPTest:testOpContextNPRunOOBi(uint256[][],uint256,uint256) (runs: 2051, μ: 5495321, ~: 4781340) -LibOpContextNPTest:testOpContextNPRunOOBj(uint256[][],uint256,uint256) (runs: 2051, μ: 5523508, ~: 4832713) -LibOpContextNPTest:testOpContextNPTwoInputs() (gas: 46929) -LibOpContextNPTest:testOpContextNPTwoOutputs() (gas: 37298) -LibOpContextNPTest:testOpContextNPZeroOutputs() (gas: 36226) -LibOpCtPopNPTest:testOpCtPopNPEval(uint256) (runs: 2051, μ: 60973, ~: 57570) -LibOpCtPopNPTest:testOpCtPopNPIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint256) (runs: 2051, μ: 10709, ~: 10679) -LibOpCtPopNPTest:testOpCtPopNPRun(uint256) (runs: 2051, μ: 8312, ~: 8313) -LibOpCtPopNPTest:testOpCtPopNPTwoInputs() (gas: 41554) -LibOpCtPopNPTest:testOpCtPopNPTwoOutputs() (gas: 37207) -LibOpCtPopNPTest:testOpCtPopNPZeroInputs() (gas: 31258) -LibOpCtPopNPTest:testOpCtPopNPZeroOutputs() (gas: 36159) -LibOpDecodeBitsNPTest:testOpDecodeBitsNPEvalHappy() (gas: 817444) -LibOpDecodeBitsNPTest:testOpDecodeBitsNPEvalTwoInputs() (gas: 47409) -LibOpDecodeBitsNPTest:testOpDecodeBitsNPEvalTwoOutputs() (gas: 43064) -LibOpDecodeBitsNPTest:testOpDecodeBitsNPEvalZeroInputs() (gas: 37159) -LibOpDecodeBitsNPTest:testOpDecodeBitsNPEvalZeroOutputs() (gas: 41992) -LibOpDecodeBitsNPTest:testOpDecodeBitsNPIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint8,uint8,uint8) (runs: 2051, μ: 18893, ~: 19035) -LibOpDecodeBitsNPTest:testOpDecodeBitsNPIntegrityFail((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint8) (runs: 2051, μ: 19410, ~: 19302) +BaseRainterpreterExternNPE2IERC165Test:testRainterpreterExternNPE2IERC165(bytes4) (runs: 2051, μ: 287281, ~: 287281) +BaseRainterpreterSubParserNPE2CompatibilityTest:testRainterpreterSubParserNPE2Compatibility(bytes32,bytes) (runs: 2051, μ: 679858, ~: 679810) +BaseRainterpreterSubParserNPE2IERC165Test:testRainterpreterSubParserNPE2IERC165(uint32) (runs: 2051, μ: 680462, ~: 680462) +LibAllStandardOpsNPTest:testIntegrityAndOpcodeFunctionPointersLength() (gas: 25610) +LibAllStandardOpsNPTest:testIntegrityFunctionPointersLength() (gas: 5680) +LibAllStandardOpsNPTest:testOpcodeFunctionPointersLength() (gas: 5659) +LibEvalNPFBoundsTest:testEvalNPFBoundsModConstant(uint256) (runs: 2051, μ: 80418, ~: 80418) +LibExternCodecTest:testLibExternCodecEncodeExternCall(uint256,uint256) (runs: 2051, μ: 9644, ~: 9532) +LibExternCodecTest:testLibExternCodecEncodeExternDispatch(uint256,uint256) (runs: 2051, μ: 8812, ~: 8700) +LibInterpreterStateNPStackTraceTest:testStackTraceCall(uint256,uint256,uint256[]) (runs: 2051, μ: 43115, ~: 42781) +LibOpBitwiseAndNPTest:testOpBitwiseAndNPEvalHappy() (gas: 759493) +LibOpBitwiseAndNPTest:testOpBitwiseAndNPIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint256) (runs: 2051, μ: 13857, ~: 13827) +LibOpBitwiseAndNPTest:testOpBitwiseAndNPRun(uint256,uint256) (runs: 2051, μ: 16544, ~: 16544) +LibOpBitwiseAndNPTest:testOpBitwiseORNPEvalBadOperand() (gas: 18380) +LibOpBitwiseAndNPTest:testOpBitwiseORNPEvalOneInput() (gas: 35870) +LibOpBitwiseAndNPTest:testOpBitwiseORNPEvalThreeInputs() (gas: 46028) +LibOpBitwiseAndNPTest:testOpBitwiseORNPEvalTwoOutputs() (gas: 41678) +LibOpBitwiseAndNPTest:testOpBitwiseORNPEvalZeroInputs() (gas: 30698) +LibOpBitwiseAndNPTest:testOpBitwiseORNPEvalZeroOutputs() (gas: 40655) +LibOpBitwiseOrNPTest:testOpBitwiseORNPEval() (gas: 758177) +LibOpBitwiseOrNPTest:testOpBitwiseORNPEvalBadOperand() (gas: 18299) +LibOpBitwiseOrNPTest:testOpBitwiseORNPEvalOneInput() (gas: 35811) +LibOpBitwiseOrNPTest:testOpBitwiseORNPEvalThreeInputs() (gas: 45969) +LibOpBitwiseOrNPTest:testOpBitwiseORNPEvalTwoOutputs() (gas: 41574) +LibOpBitwiseOrNPTest:testOpBitwiseORNPEvalZeroInputs() (gas: 30573) +LibOpBitwiseOrNPTest:testOpBitwiseORNPEvalZeroOutputs() (gas: 40574) +LibOpBitwiseOrNPTest:testOpBitwiseORNPIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint256) (runs: 2051, μ: 13835, ~: 13805) +LibOpBitwiseOrNPTest:testOpBitwiseORNPRun(uint256,uint256) (runs: 2051, μ: 16520, ~: 16520) +LibOpCallNPTest:testCallTraceInnerOnly() (gas: 62861) +LibOpCallNPTest:testCallTraceOuterOnly() (gas: 45498) +LibOpCallNPTest:testOpCallNPIntegrityIO((uint256,uint256,uint256,uint256[],uint256,bytes),uint256,uint256,uint8,bytes32) (runs: 2050, μ: 39940, ~: 38376) +LibOpCallNPTest:testOpCallNPIntegritySourceIndexOutOfBounds((uint256,uint256,uint256,uint256[],uint256,bytes),uint256,uint256,uint256,uint256,bytes32) (runs: 2051, μ: 37486, ~: 35279) +LibOpCallNPTest:testOpCallNPIntegrityTooManyOutputs((uint256,uint256,uint256,uint256[],uint256,bytes),uint256,uint256,uint8,bytes32) (runs: 2049, μ: 36409, ~: 36155) +LibOpCallNPTest:testOpCallNPRunInputsMismatch() (gas: 73034) +LibOpCallNPTest:testOpCallNPRunOutputsMismatch() (gas: 66441) +LibOpCallNPTest:testOpCallNPRunSourceDoesNotExist() (gas: 350656) +LibOpConstantNPTest:testOpConstantEvalNPE2E() (gas: 55516) +LibOpConstantNPTest:testOpConstantEvalZeroConstants() (gas: 41400) +LibOpConstantNPTest:testOpConstantNPIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint256) (runs: 2051, μ: 19237, ~: 19220) +LibOpConstantNPTest:testOpConstantNPIntegrityOOBConstants((uint256,uint256,uint256,uint256[],uint256,bytes),uint256) (runs: 2051, μ: 18086, ~: 18032) +LibOpConstantNPTest:testOpConstantNPMultipleOutputErrorSugared() (gas: 31769) +LibOpConstantNPTest:testOpConstantNPMultipleOutputErrorUnsugared() (gas: 41730) +LibOpConstantNPTest:testOpConstantNPRun(uint256[],uint16) (runs: 2051, μ: 53269, ~: 53322) +LibOpConstantNPTest:testOpConstantNPZeroOutputErrorSugared() (gas: 30413) +LibOpConstantNPTest:testOpConstantNPZeroOutputErrorUnsugared() (gas: 40319) +LibOpContextNPTest:testOpContextNPEval00(uint256[][]) (runs: 2051, μ: 7235232, ~: 6121900) +LibOpContextNPTest:testOpContextNPEval01(uint256[][]) (runs: 2051, μ: 7229005, ~: 6114877) +LibOpContextNPTest:testOpContextNPEval10(uint256[][]) (runs: 2051, μ: 7274628, ~: 6173895) +LibOpContextNPTest:testOpContextNPEval11(uint256[][]) (runs: 2051, μ: 7271316, ~: 6202770) +LibOpContextNPTest:testOpContextNPEvalOOBi(uint256[]) (runs: 2051, μ: 77145, ~: 77251) +LibOpContextNPTest:testOpContextNPEvalOOBj(uint256) (runs: 2051, μ: 48158, ~: 48158) +LibOpContextNPTest:testOpContextNPIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint256) (runs: 2051, μ: 14558, ~: 14528) +LibOpContextNPTest:testOpContextNPOneInput() (gas: 41723) +LibOpContextNPTest:testOpContextNPRun(uint256[][],uint256,uint256) (runs: 2051, μ: 10519381, ~: 8954613) +LibOpContextNPTest:testOpContextNPRunOOBi(uint256[][],uint256,uint256) (runs: 2051, μ: 5490312, ~: 4779946) +LibOpContextNPTest:testOpContextNPRunOOBj(uint256[][],uint256,uint256) (runs: 2051, μ: 5513316, ~: 4812280) +LibOpContextNPTest:testOpContextNPTwoInputs() (gas: 46846) +LibOpContextNPTest:testOpContextNPTwoOutputs() (gas: 37215) +LibOpContextNPTest:testOpContextNPZeroOutputs() (gas: 36187) +LibOpCtPopNPTest:testOpCtPopNPEval(uint256) (runs: 2051, μ: 64553, ~: 60402) +LibOpCtPopNPTest:testOpCtPopNPIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint256) (runs: 2051, μ: 13878, ~: 13848) +LibOpCtPopNPTest:testOpCtPopNPRun(uint256) (runs: 2051, μ: 16679, ~: 16680) +LibOpCtPopNPTest:testOpCtPopNPTwoInputs() (gas: 41471) +LibOpCtPopNPTest:testOpCtPopNPTwoOutputs() (gas: 37124) +LibOpCtPopNPTest:testOpCtPopNPZeroInputs() (gas: 31175) +LibOpCtPopNPTest:testOpCtPopNPZeroOutputs() (gas: 36076) +LibOpDecodeBitsNPTest:testOpDecodeBitsNPEvalHappy() (gas: 850706) +LibOpDecodeBitsNPTest:testOpDecodeBitsNPEvalTwoInputs() (gas: 47326) +LibOpDecodeBitsNPTest:testOpDecodeBitsNPEvalTwoOutputs() (gas: 43003) +LibOpDecodeBitsNPTest:testOpDecodeBitsNPEvalZeroInputs() (gas: 37076) +LibOpDecodeBitsNPTest:testOpDecodeBitsNPEvalZeroOutputs() (gas: 41909) +LibOpDecodeBitsNPTest:testOpDecodeBitsNPIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint8,uint8,uint8) (runs: 2051, μ: 22088, ~: 22238) +LibOpDecodeBitsNPTest:testOpDecodeBitsNPIntegrityFail((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint8) (runs: 2051, μ: 19430, ~: 19321) LibOpDecodeBitsNPTest:testOpDecodeBitsNPIntegrityFailZeroLength((uint256,uint256,uint256,uint256[],uint256,bytes),uint8) (runs: 2051, μ: 13873, ~: 13849) -LibOpDecodeBitsNPTest:testOpDecodeBitsNPRun(uint256,uint8,uint8) (runs: 2051, μ: 12480, ~: 12301) -LibOpDivTest:testDebugOpDivRun() (gas: 9778) -LibOpDivTest:testOpDivEvalOneInput() (gas: 126834) -LibOpDivTest:testOpDivEvalOperandsDisallowed() (gas: 93429) -LibOpDivTest:testOpDivEvalThreeInputsHappy() (gas: 361633) -LibOpDivTest:testOpDivEvalThreeInputsUnhappy() (gas: 210932) -LibOpDivTest:testOpDivEvalThreeInputsUnhappyOverflow() (gas: 167722) -LibOpDivTest:testOpDivEvalTwoInputsHappy() (gas: 319321) -LibOpDivTest:testOpDivEvalTwoInputsUnhappy() (gas: 143349) -LibOpDivTest:testOpDivEvalTwoInputsUnhappyOverflow() (gas: 101268) -LibOpDivTest:testOpDivEvalTwoOutputs() (gas: 41853) -LibOpDivTest:testOpDivEvalZeroInputs() (gas: 30178) -LibOpDivTest:testOpDivEvalZeroOutputs() (gas: 40808) -LibOpDivTest:testOpDivIntegrityHappy((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint16) (runs: 2051, μ: 14802, ~: 14805) -LibOpDivTest:testOpDivIntegrityUnhappyOneInput((uint256,uint256,uint256,uint256[],uint256,bytes)) (runs: 2051, μ: 10628, ~: 10475) -LibOpDivTest:testOpDivIntegrityUnhappyZeroInputs((uint256,uint256,uint256,uint256[],uint256,bytes)) (runs: 2051, μ: 10586, ~: 10433) -LibOpDivTest:testOpDivRun(uint256[]) (runs: 2049, μ: 20272, ~: 18923) -LibOpERC20AllowanceTest:testOpERC20AllowanceNPEvalFourInputs() (gas: 55719) -LibOpERC20AllowanceTest:testOpERC20AllowanceNPEvalHappy(uint256,uint8) (runs: 2051, μ: 70039, ~: 70097) -LibOpERC20AllowanceTest:testOpERC20AllowanceNPEvalOneInput() (gas: 37065) -LibOpERC20AllowanceTest:testOpERC20AllowanceNPEvalOperandDisallowed() (gas: 18791) -LibOpERC20AllowanceTest:testOpERC20AllowanceNPEvalTwoInputs() (gas: 43543) -LibOpERC20AllowanceTest:testOpERC20AllowanceNPEvalTwoOutputs() (gas: 50587) -LibOpERC20AllowanceTest:testOpERC20AllowanceNPEvalZeroInputs() (gas: 31077) -LibOpERC20AllowanceTest:testOpERC20AllowanceNPEvalZeroOutputs() (gas: 49498) -LibOpERC20AllowanceTest:testOpERC20AllowanceNPIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint256) (runs: 2051, μ: 10688, ~: 10658) -LibOpERC20AllowanceTest:testOpERC20AllowanceNPRun(address,address,address,uint256,uint8) (runs: 2051, μ: 20997, ~: 21047) -LibOpERC20BalanceOfTest:testOpERC20BalanceOfNPEvalHappy(uint256,uint8) (runs: 2050, μ: 63755, ~: 63670) -LibOpERC20BalanceOfTest:testOpERC20BalanceOfNPEvalOneInput() (gas: 37142) -LibOpERC20BalanceOfTest:testOpERC20BalanceOfNPEvalOperandDisallowed() (gas: 18872) -LibOpERC20BalanceOfTest:testOpERC20BalanceOfNPEvalOverflow(uint256,uint8) (runs: 2049, μ: 61376, ~: 61376) -LibOpERC20BalanceOfTest:testOpERC20BalanceOfNPEvalThreeInputs() (gas: 49456) -LibOpERC20BalanceOfTest:testOpERC20BalanceOfNPEvalTwoOutputs() (gas: 44285) -LibOpERC20BalanceOfTest:testOpERC20BalanceOfNPEvalZeroInputs() (gas: 31175) -LibOpERC20BalanceOfTest:testOpERC20BalanceOfNPEvalZeroOutputs() (gas: 43283) -LibOpERC20BalanceOfTest:testOpERC20BalanceOfNPIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint256) (runs: 2051, μ: 10708, ~: 10678) -LibOpERC20BalanceOfTest:testOpERC20BalanceOfNPRun(address,address,uint256,uint16,uint8) (runs: 2051, μ: 21011, ~: 20928) -LibOpERC20TotalSupplyTest:testOpERC20TotalSupplyNPEvalHappy(uint256,uint8) (runs: 2050, μ: 56875, ~: 56794) -LibOpERC20TotalSupplyTest:testOpERC20TotalSupplyNPEvalOperandDisallowed() (gas: 19078) -LibOpERC20TotalSupplyTest:testOpERC20TotalSupplyNPEvalOverflow(uint256,uint8) (runs: 2049, μ: 54569, ~: 54569) -LibOpERC20TotalSupplyTest:testOpERC20TotalSupplyNPEvalTwoInputs() (gas: 43760) -LibOpERC20TotalSupplyTest:testOpERC20TotalSupplyNPEvalTwoOutputs() (gas: 38151) -LibOpERC20TotalSupplyTest:testOpERC20TotalSupplyNPEvalZeroInputs() (gas: 31338) -LibOpERC20TotalSupplyTest:testOpERC20TotalSupplyNPEvalZeroOutputs() (gas: 37104) -LibOpERC20TotalSupplyTest:testOpERC20TotalSupplyNPIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint256) (runs: 2051, μ: 10688, ~: 10658) -LibOpERC20TotalSupplyTest:testOpERC20TotalSupplyNPRun(address,uint256,uint16,uint8) (runs: 2049, μ: 20291, ~: 20205) -LibOpERC5313OwnerNPTest:testOpERC5313OwnerNPEvalHappy() (gas: 53518) -LibOpERC5313OwnerNPTest:testOpERC5313OwnerNPEvalOperandDisallowed() (gas: 18576) -LibOpERC5313OwnerNPTest:testOpERC5313OwnerNPEvalTwoInputs() (gas: 43323) -LibOpERC5313OwnerNPTest:testOpERC5313OwnerNPEvalTwoOutputs() (gas: 37600) -LibOpERC5313OwnerNPTest:testOpERC5313OwnerNPEvalZeroInputs() (gas: 30922) -LibOpERC5313OwnerNPTest:testOpERC5313OwnerNPEvalZeroOutputs() (gas: 36572) -LibOpERC5313OwnerNPTest:testOpERC5313OwnerOfNPIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint256) (runs: 2051, μ: 10687, ~: 10657) -LibOpERC5313OwnerNPTest:testOpERC5313OwnerOfNPRun(address,address,uint16) (runs: 2051, μ: 17310, ~: 17310) -LibOpERC721OwnerOfTest:testOpERC721OwnerOfNPEvalFail0() (gas: 30653) -LibOpERC721OwnerOfTest:testOpERC721OwnerOfNPEvalFail1() (gas: 34998) -LibOpERC721OwnerOfTest:testOpERC721OwnerOfNPEvalFail3() (gas: 44395) -LibOpERC721OwnerOfTest:testOpERC721OwnerOfNPEvalFailOperand() (gas: 18431) -LibOpERC721OwnerOfTest:testOpERC721OwnerOfNPEvalHappy(address,uint256,address) (runs: 2051, μ: 95173, ~: 91479) -LibOpERC721OwnerOfTest:testOpERC721OwnerOfNPEvalOneInput() (gas: 35383) -LibOpERC721OwnerOfTest:testOpERC721OwnerOfNPEvalThreeInputs() (gas: 44856) -LibOpERC721OwnerOfTest:testOpERC721OwnerOfNPEvalZeroInputs() (gas: 31072) -LibOpERC721OwnerOfTest:testOpERC721OwnerOfNPEvalZeroOutputs() (gas: 39683) -LibOpERC721OwnerOfTest:testOpERC721OwnerOfNPIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint8) (runs: 2051, μ: 10691, ~: 10667) -LibOpERC721OwnerOfTest:testOpERC721OwnerOfNPRun(address,uint256,address,uint16) (runs: 2051, μ: 17907, ~: 17907) -LibOpERC721OwnerOfTest:testOpERC721OwnerOfNPTwoOutputs() (gas: 40748) -LibOpETest:testOpEEval() (gas: 41098) -LibOpETest:testOpEEvalOneInput() (gas: 34226) -LibOpETest:testOpEEvalTwoOutputs() (gas: 30600) -LibOpETest:testOpEEvalZeroOutputs() (gas: 29552) -LibOpETest:testOpEIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint8,uint16) (runs: 2051, μ: 16305, ~: 16396) -LibOpETest:testOpERun(uint16) (runs: 2051, μ: 7647, ~: 7647) -LibOpEncodeBitsNPTest:testOpEncodeBitsNPEvalHappy() (gas: 821961) -LibOpEncodeBitsNPTest:testOpEncodeBitsNPEvalOneInput() (gas: 42290) -LibOpEncodeBitsNPTest:testOpEncodeBitsNPEvalThreeInputs() (gas: 52469) -LibOpEncodeBitsNPTest:testOpEncodeBitsNPEvalTwoOutputs() (gas: 48076) -LibOpEncodeBitsNPTest:testOpEncodeBitsNPEvalZeroInputs() (gas: 37073) -LibOpEncodeBitsNPTest:testOpEncodeBitsNPEvalZeroOutputs() (gas: 47053) -LibOpEncodeBitsNPTest:testOpEncodeBitsNPIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint8) (runs: 2051, μ: 14998, ~: 15033) -LibOpEncodeBitsNPTest:testOpEncodeBitsNPIntegrityFail((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint8) (runs: 2051, μ: 19507, ~: 19442) -LibOpEncodeBitsNPTest:testOpEncodeBitsNPIntegrityFailZeroLength((uint256,uint256,uint256,uint256[],uint256,bytes),uint8) (runs: 2051, μ: 14000, ~: 13976) -LibOpEncodeBitsNPTest:testOpEncodeBitsNPRun(uint256,uint256,uint8,uint8) (runs: 2051, μ: 12892, ~: 12702) -LibOpEnsureNPTest:testOpEnsureNPEvalBadOutputs() (gas: 35214) -LibOpEnsureNPTest:testOpEnsureNPEvalBadOutputs2() (gas: 34554) -LibOpEnsureNPTest:testOpEnsureNPEvalHappy() (gas: 163130) -LibOpEnsureNPTest:testOpEnsureNPEvalOne() (gas: 34824) -LibOpEnsureNPTest:testOpEnsureNPEvalThree() (gas: 46416) -LibOpEnsureNPTest:testOpEnsureNPEvalUnhappy() (gas: 113286) -LibOpEnsureNPTest:testOpEnsureNPEvalUnhappyOperand() (gas: 17317) -LibOpEnsureNPTest:testOpEnsureNPEvalZero() (gas: 29627) -LibOpEnsureNPTest:testOpEnsureNPIntegrityHappy((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint8,uint16) (runs: 2051, μ: 16294, ~: 16401) -LibOpEnsureNPTest:testOpEnsureNPIntegrityUnhappy((uint256,uint256,uint256,uint256[],uint256,bytes)) (runs: 2051, μ: 10551, ~: 10398) -LibOpEnsureNPTest:testOpEnsureNPOneOutput() (gas: 39962) -LibOpEnsureNPTest:testOpEnsureNPRun(uint256,string) (runs: 2050, μ: 11390, ~: 11418) -LibOpEqualToNPTest:testOpEqualToNPEval2InputsBothOne() (gas: 53711) -LibOpEqualToNPTest:testOpEqualToNPEval2InputsFirstOneSecondZero() (gas: 54639) -LibOpEqualToNPTest:testOpEqualToNPEval2InputsFirstZeroSecondOne() (gas: 54618) -LibOpEqualToNPTest:testOpEqualToNPEval2ZeroInputs() (gas: 53753) -LibOpEqualToNPTest:testOpEqualToNPEvalFail0Inputs() (gas: 30053) -LibOpEqualToNPTest:testOpEqualToNPEvalFail1Input() (gas: 34352) -LibOpEqualToNPTest:testOpEqualToNPEvalFail3Inputs() (gas: 42725) -LibOpEqualToNPTest:testOpEqualToNPIntegrityHappy((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint8,uint16) (runs: 2051, μ: 16271, ~: 16323) -LibOpEqualToNPTest:testOpEqualToNPRun(uint256,uint256) (runs: 2051, μ: 8204, ~: 8205) -LibOpEqualToNPTest:testOpEqualToNPTwoOutputs() (gas: 41423) -LibOpEqualToNPTest:testOpEqualToNPZeroOutputs() (gas: 40424) -LibOpEveryNPTest:testOpAnyNPEvalFail() (gas: 30560) -LibOpEveryNPTest:testOpEveryNPEval1FalseInput() (gas: 48904) -LibOpEveryNPTest:testOpEveryNPEval1TrueInput() (gas: 48965) -LibOpEveryNPTest:testOpEveryNPEval2FalseInputs() (gas: 54281) -LibOpEveryNPTest:testOpEveryNPEval2MixedInputs() (gas: 55264) -LibOpEveryNPTest:testOpEveryNPEval2MixedInputs2() (gas: 55165) -LibOpEveryNPTest:testOpEveryNPEval2TrueInputs() (gas: 55300) -LibOpEveryNPTest:testOpEveryNPIntegrityHappy((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint8,uint16) (runs: 2051, μ: 16412, ~: 16490) -LibOpEveryNPTest:testOpEveryNPIntegrityUnhappyZeroInputs((uint256,uint256,uint256,uint256[],uint256,bytes)) (runs: 2051, μ: 10578, ~: 10425) -LibOpEveryNPTest:testOpEveryNPRun(uint256[]) (runs: 2049, μ: 14612, ~: 14677) -LibOpEveryNPTest:testOpEveryNPTwoOutputs() (gas: 36847) -LibOpEveryNPTest:testOpEveryNPZeroOutputs() (gas: 35820) -LibOpExp2Test:testOpExp2Eval() (gas: 205737) -LibOpExp2Test:testOpExp2EvalBad() (gas: 67085) -LibOpExp2Test:testOpExp2EvalOperandDisallowed() (gas: 18502) -LibOpExp2Test:testOpExp2Integrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint256) (runs: 2051, μ: 10643, ~: 10613) -LibOpExp2Test:testOpExp2Run(uint256,uint16) (runs: 2051, μ: 15681, ~: 16937) -LibOpExp2Test:testOpExp2TwoOutputs() (gas: 36733) -LibOpExp2Test:testOpExp2ZeroOutputs() (gas: 35727) -LibOpExpTest:testOpExpEval() (gas: 210719) -LibOpExpTest:testOpExpEvalOperandDisallowed() (gas: 17752) -LibOpExpTest:testOpExpEvalTwoInputs() (gas: 40394) -LibOpExpTest:testOpExpEvalZeroInputs() (gas: 30121) -LibOpExpTest:testOpExpIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint256) (runs: 2051, μ: 10687, ~: 10657) -LibOpExpTest:testOpExpRun(uint256,uint16) (runs: 2051, μ: 15886, ~: 17166) -LibOpExpTest:testOpExpTwoOutputs() (gas: 36028) -LibOpExpTest:testOpExpZeroOutputs() (gas: 35000) -LibOpExponentialGrowthTest:testOpExponentialGrowthEval() (gas: 675538) -LibOpExponentialGrowthTest:testOpExponentialGrowthEvalFourInputs() (gas: 52560) -LibOpExponentialGrowthTest:testOpExponentialGrowthEvalOneInput() (gas: 36542) -LibOpExponentialGrowthTest:testOpExponentialGrowthEvalOperandDisallowed() (gas: 18981) -LibOpExponentialGrowthTest:testOpExponentialGrowthEvalTwoInputs() (gas: 42259) -LibOpExponentialGrowthTest:testOpExponentialGrowthEvalTwoOutputs() (gas: 48074) -LibOpExponentialGrowthTest:testOpExponentialGrowthEvalZeroInputs() (gas: 30917) -LibOpExponentialGrowthTest:testOpExponentialGrowthEvalZeroOutputs() (gas: 47008) -LibOpExponentialGrowthTest:testOpExponentialGrowthIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint256) (runs: 2051, μ: 10665, ~: 10635) -LibOpExponentialGrowthTest:testOpExponentialGrowthRun(uint256,uint256,uint256,uint16) (runs: 2051, μ: 30715, ~: 30820) -LibOpExternNPTest:testOpExternNPEvalHappy() (gas: 97174) -LibOpExternNPTest:testOpExternNPEvalMultipleInputsOutputsHappy() (gas: 110775) -LibOpExternNPTest:testOpExternNPIntegrityHappy((uint256,uint256,uint256,uint256[],uint256,bytes),address,uint16,uint8,uint8) (runs: 2051, μ: 33027, ~: 32871) -LibOpExternNPTest:testOpExternNPIntegrityNotAnExternContract((uint256,uint256,uint256,uint256[],uint256,bytes),address,uint16,uint8,uint8) (runs: 2051, μ: 52548, ~: 51994) -LibOpExternNPTest:testOpExternNPRunHappy(address,uint256[],uint16,uint256[],uint256[]) (runs: 2051, μ: 101710, ~: 100985) -LibOpFloorTest:testOpFloorEval() (gas: 239243) -LibOpFloorTest:testOpFloorEvalOperandDisallowed() (gas: 17894) -LibOpFloorTest:testOpFloorIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint256) (runs: 2051, μ: 10709, ~: 10679) -LibOpFloorTest:testOpFloorRun(uint256,uint16) (runs: 2051, μ: 11871, ~: 12076) -LibOpFloorTest:testOpFloorTwoInputs() (gas: 40600) -LibOpFloorTest:testOpFloorTwoOutputs() (gas: 36167) -LibOpFloorTest:testOpFloorZeroInputs() (gas: 30284) -LibOpFloorTest:testOpFloorZeroOutputs() (gas: 35163) -LibOpFracTest:testOpFracEval() (gas: 238658) -LibOpFracTest:testOpFracEvalOperandDisallowed() (gas: 17857) -LibOpFracTest:testOpFracIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint256) (runs: 2051, μ: 10665, ~: 10635) -LibOpFracTest:testOpFracRun(uint256,uint16) (runs: 2051, μ: 11877, ~: 12080) -LibOpFracTest:testOpFracTwoInputs() (gas: 40465) -LibOpFracTest:testOpFracTwoOutputs() (gas: 36097) -LibOpFracTest:testOpFracZeroInputs() (gas: 30191) -LibOpFracTest:testOpFracZeroOutputs() (gas: 35070) -LibOpGetNPTest:testLibOpGetNPEvalKeyNotSet() (gas: 283251) -LibOpGetNPTest:testLibOpGetNPEvalOperandDisallowed() (gas: 58601) -LibOpGetNPTest:testLibOpGetNPEvalSetThenGet() (gas: 488654) -LibOpGetNPTest:testLibOpGetNPEvalStoreAndSetAndGet() (gas: 240368) -LibOpGetNPTest:testLibOpGetNPEvalStoreThenGet() (gas: 446610) -LibOpGetNPTest:testLibOpGetNPEvalThreeInputs() (gas: 44966) -LibOpGetNPTest:testLibOpGetNPEvalTwoInputs() (gas: 39739) -LibOpGetNPTest:testLibOpGetNPEvalTwoOutputs() (gas: 35306) -LibOpGetNPTest:testLibOpGetNPEvalZeroInputs() (gas: 29769) -LibOpGetNPTest:testLibOpGetNPEvalZeroOutputs() (gas: 34212) -LibOpGetNPTest:testLibOpGetNPIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint8,uint16) (runs: 2051, μ: 16511, ~: 16612) -LibOpGetNPTest:testLibOpGetNPRunState(uint256,uint256,uint16) (runs: 2051, μ: 7884, ~: 7888) -LibOpGetNPTest:testLibOpGetNPRunStateAndStore(uint256,uint256,uint256,uint16) (runs: 2051, μ: 35689, ~: 35907) -LibOpGetNPTest:testLibOpGetNPRunStore(uint256,uint256,uint16) (runs: 2051, μ: 37568, ~: 37776) -LibOpGetNPTest:testLibOpGetNPRunStoreDifferentNamespace(uint256,uint256,uint16) (runs: 2051, μ: 39429, ~: 39637) -LibOpGetNPTest:testLibOpGetNPRunUnset(uint256,uint16) (runs: 2051, μ: 13875, ~: 13880) -LibOpGmTest:testOpGmEval() (gas: 409894) -LibOpGmTest:testOpGmEvalOperandDisallowed() (gas: 17672) -LibOpGmTest:testOpGmIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint256) (runs: 2051, μ: 10665, ~: 10635) -LibOpGmTest:testOpGmOneInput() (gas: 36097) -LibOpGmTest:testOpGmRun(uint256,uint256,uint16) (runs: 2051, μ: 15194, ~: 15103) -LibOpGmTest:testOpGmThreeInputs() (gas: 45382) -LibOpGmTest:testOpGmTwoOutputs() (gas: 41031) -LibOpGmTest:testOpGmZeroOutputs() (gas: 39966) -LibOpGreaterThanNPTest:testOpGreaterThanNPEval2InputsBothOne() (gas: 54077) -LibOpGreaterThanNPTest:testOpGreaterThanNPEval2InputsFirstOneSecondZero() (gas: 54942) -LibOpGreaterThanNPTest:testOpGreaterThanNPEval2InputsFirstZeroSecondOne() (gas: 54941) -LibOpGreaterThanNPTest:testOpGreaterThanNPEval2ZeroInputs() (gas: 54054) -LibOpGreaterThanNPTest:testOpGreaterThanNPEvalFail0Inputs() (gas: 30388) -LibOpGreaterThanNPTest:testOpGreaterThanNPEvalFail1Input() (gas: 34700) -LibOpGreaterThanNPTest:testOpGreaterThanNPEvalFail3Inputs() (gas: 43020) -LibOpGreaterThanNPTest:testOpGreaterThanNPIntegrityHappy((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint8,uint16) (runs: 2051, μ: 16250, ~: 16312) -LibOpGreaterThanNPTest:testOpGreaterThanNPRun(uint256,uint256) (runs: 2051, μ: 8222, ~: 8218) -LibOpGreaterThanNPTest:testOpGreaterThanNPTwoOutputs() (gas: 42410) -LibOpGreaterThanNPTest:testOpGreaterThanNPZeroOutputs() (gas: 41409) -LibOpGreaterThanOrEqualToNPTest:testOpGreaterThanOrEqualToNPEval2InputsBothOne() (gas: 55182) -LibOpGreaterThanOrEqualToNPTest:testOpGreaterThanOrEqualToNPEval2InputsFirstOneSecondZero() (gas: 56045) -LibOpGreaterThanOrEqualToNPTest:testOpGreaterThanOrEqualToNPEval2InputsFirstZeroSecondOne() (gas: 56067) -LibOpGreaterThanOrEqualToNPTest:testOpGreaterThanOrEqualToNPEval2ZeroInputs() (gas: 55162) -LibOpGreaterThanOrEqualToNPTest:testOpGreaterThanOrEqualToNPEvalFail0Inputs() (gas: 31371) -LibOpGreaterThanOrEqualToNPTest:testOpGreaterThanOrEqualToNPEvalFail1Input() (gas: 35765) -LibOpGreaterThanOrEqualToNPTest:testOpGreaterThanOrEqualToNPEvalFail3Inputs() (gas: 44106) -LibOpGreaterThanOrEqualToNPTest:testOpGreaterThanOrEqualToNPIntegrityHappy((uint256,uint256,uint256,uint256[],uint256,bytes),uint8) (runs: 2051, μ: 10670, ~: 10646) -LibOpGreaterThanOrEqualToNPTest:testOpGreaterThanOrEqualToNPRun(uint256,uint256) (runs: 2051, μ: 8207, ~: 8203) -LibOpGreaterThanOrEqualToNPTest:testOpGreaterThanOrEqualToNPTwoOutputs() (gas: 43581) -LibOpGreaterThanOrEqualToNPTest:testOpGreaterThanOrEqualToNPZeroOutputs() (gas: 42357) -LibOpHashNPTest:testOpHashNPEval0Inputs() (gas: 42344) -LibOpHashNPTest:testOpHashNPEval1Input() (gas: 50894) -LibOpHashNPTest:testOpHashNPEval2Inputs() (gas: 59136) -LibOpHashNPTest:testOpHashNPEval2InputsDifferent() (gas: 59829) -LibOpHashNPTest:testOpHashNPEval2InputsOtherStack() (gas: 74552) -LibOpHashNPTest:testOpHashNPIntegrityHappy((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint8,uint16) (runs: 2051, μ: 16311, ~: 16358) -LibOpHashNPTest:testOpHashNPRun(uint256[]) (runs: 2049, μ: 13453, ~: 13562) -LibOpHashNPTest:testOpHashNPTwoOutputs() (gas: 30856) -LibOpHashNPTest:testOpHashNPZeroOutputs() (gas: 29423) -LibOpHeadroomTest:testOpHeadroomEval() (gas: 240503) -LibOpHeadroomTest:testOpHeadroomEvalOperandDisallowed() (gas: 18158) -LibOpHeadroomTest:testOpHeadroomIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint256) (runs: 2051, μ: 10665, ~: 10635) -LibOpHeadroomTest:testOpHeadroomRun(uint256,uint16) (runs: 2051, μ: 11920, ~: 12123) -LibOpHeadroomTest:testOpHeadroomTwoInputs() (gas: 40822) -LibOpHeadroomTest:testOpHeadroomTwoOutputs() (gas: 36454) -LibOpHeadroomTest:testOpHeadroomZeroInputs() (gas: 30526) -LibOpHeadroomTest:testOpHeadroomZeroOutputs() (gas: 35404) -LibOpIfNPTest:testOpIfNPEval3InputsFirstOneSecondTwoThirdThree() (gas: 60582) -LibOpIfNPTest:testOpIfNPEval3InputsFirstOneSecondZeroThirdThree() (gas: 60539) -LibOpIfNPTest:testOpIfNPEval3InputsFirstTwoSecondThreeThirdFour() (gas: 60538) -LibOpIfNPTest:testOpIfNPEval3InputsFirstTwoSecondZeroThirdFour() (gas: 60559) -LibOpIfNPTest:testOpIfNPEval3InputsFirstZeroSecondOneThirdTwo() (gas: 60581) -LibOpIfNPTest:testOpIfNPEval3InputsFirstZeroSecondOneThirdZero() (gas: 59629) -LibOpIfNPTest:testOpIfNPEval3InputsFirstZeroSecondZeroThirdOne() (gas: 59540) -LibOpIfNPTest:testOpIfNPEval3InputsFirstZeroSecondZeroThirdThree() (gas: 59562) -LibOpIfNPTest:testOpIfNPEvalEmptyStringTruthy() (gas: 59528) -LibOpIfNPTest:testOpIfNPEvalFail0Inputs() (gas: 29547) -LibOpIfNPTest:testOpIfNPEvalFail1Input() (gas: 33910) -LibOpIfNPTest:testOpIfNPEvalFail2Inputs() (gas: 38088) -LibOpIfNPTest:testOpIfNPEvalFail4Inputs() (gas: 46390) -LibOpIfNPTest:testOpIfNPEvalTwoOutputs() (gas: 46706) -LibOpIfNPTest:testOpIfNPEvalZeroOutputs() (gas: 45641) -LibOpIfNPTest:testOpIfNPIntegrityHappy((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint8,uint16) (runs: 2051, μ: 16257, ~: 16318) -LibOpIfNPTest:testOpIfNPRun(uint256,uint256,uint256) (runs: 2051, μ: 8436, ~: 8436) -LibOpInvTest:testOpExpEvalOperandDisallowed() (gas: 17774) -LibOpInvTest:testOpInvEval() (gas: 162143) -LibOpInvTest:testOpInvIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint256) (runs: 2051, μ: 10665, ~: 10635) -LibOpInvTest:testOpInvRun(uint256,uint16) (runs: 2051, μ: 11947, ~: 12154) -LibOpInvTest:testOpInvTwoInputs() (gas: 40438) -LibOpInvTest:testOpInvTwoOutputs() (gas: 36027) -LibOpInvTest:testOpInvZeroInputs() (gas: 30122) -LibOpInvTest:testOpInvZeroOutputs() (gas: 34957) -LibOpIsZeroNPTest:testOpIsZeroNPEval1NonZeroInput() (gas: 48512) -LibOpIsZeroNPTest:testOpIsZeroNPEval1ZeroInput() (gas: 48208) -LibOpIsZeroNPTest:testOpIsZeroNPEvalFail0Inputs() (gas: 29960) -LibOpIsZeroNPTest:testOpIsZeroNPEvalFail2Inputs() (gas: 38459) -LibOpIsZeroNPTest:testOpIsZeroNPIntegrityHappy((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint8,uint16) (runs: 2051, μ: 16348, ~: 16449) -LibOpIsZeroNPTest:testOpIsZeroNPRun(uint256) (runs: 2051, μ: 7878, ~: 7879) -LibOpIsZeroNPTest:testOpIsZeroNPTwoOutputs() (gas: 36595) -LibOpIsZeroNPTest:testOpIsZeroNPZeroOutputs() (gas: 35263) -LibOpLessThanNPTest:testOpLessThanNPEval2InputsBothOne() (gas: 52889) -LibOpLessThanNPTest:testOpLessThanNPEval2InputsFirstOneSecondZero() (gas: 53773) -LibOpLessThanNPTest:testOpLessThanNPEval2InputsFirstZeroSecondOne() (gas: 53772) -LibOpLessThanNPTest:testOpLessThanNPEval2ZeroInputs() (gas: 52909) -LibOpLessThanNPTest:testOpLessThanNPIntegrityHappy((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint8,uint16) (runs: 2051, μ: 16304, ~: 16371) -LibOpLessThanNPTest:testOpLessThanNPRun(uint256,uint256) (runs: 2051, μ: 8186, ~: 8191) -LibOpLessThanNPTest:testOpLessThanNPTwoOutputs() (gas: 42448) -LibOpLessThanNPTest:testOpLessThanNPZeroOutputs() (gas: 40504) -LibOpLessThanNPTest:testOpLessThanToNPEvalFail0Inputs() (gas: 30168) -LibOpLessThanNPTest:testOpLessThanToNPEvalFail1Input() (gas: 34425) -LibOpLessThanNPTest:testOpLessThanToNPEvalFail3Inputs() (gas: 42829) -LibOpLessThanOrEqualToNPTest:testOpLessThanOrEqualToNPEval2InputsBothOne() (gas: 53840) -LibOpLessThanOrEqualToNPTest:testOpLessThanOrEqualToNPEval2InputsFirstOneSecondZero() (gas: 54748) -LibOpLessThanOrEqualToNPTest:testOpLessThanOrEqualToNPEval2InputsFirstZeroSecondOne() (gas: 54749) -LibOpLessThanOrEqualToNPTest:testOpLessThanOrEqualToNPEval2ZeroInputs() (gas: 53884) -LibOpLessThanOrEqualToNPTest:testOpLessThanOrEqualToNPEvalFail0Inputs() (gas: 31139) -LibOpLessThanOrEqualToNPTest:testOpLessThanOrEqualToNPEvalFail1Input() (gas: 35449) -LibOpLessThanOrEqualToNPTest:testOpLessThanOrEqualToNPEvalFail3Inputs() (gas: 43829) -LibOpLessThanOrEqualToNPTest:testOpLessThanOrEqualToNPIntegrityHappy((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint8,uint16) (runs: 2051, μ: 16310, ~: 16363) -LibOpLessThanOrEqualToNPTest:testOpLessThanOrEqualToNPRun(uint256,uint256) (runs: 2051, μ: 8215, ~: 8220) -LibOpLessThanOrEqualToNPTest:testOpLessThanOrEqualToNPTwoOutputs() (gas: 43181) -LibOpLessThanOrEqualToNPTest:testOpLessThanOrEqualToNPZeroOutputs() (gas: 42094) -LibOpLinearGrowthTest:testOpLinearGrowthEval() (gas: 633199) -LibOpLinearGrowthTest:testOpLinearGrowthEvalFourInputs() (gas: 52188) -LibOpLinearGrowthTest:testOpLinearGrowthEvalOneInput() (gas: 36169) -LibOpLinearGrowthTest:testOpLinearGrowthEvalOperandDisallowed() (gas: 18562) -LibOpLinearGrowthTest:testOpLinearGrowthEvalTwoInputs() (gas: 41887) -LibOpLinearGrowthTest:testOpLinearGrowthEvalTwoOutputs() (gas: 47661) -LibOpLinearGrowthTest:testOpLinearGrowthEvalZeroInputs() (gas: 30524) -LibOpLinearGrowthTest:testOpLinearGrowthEvalZeroOutputs() (gas: 46593) -LibOpLinearGrowthTest:testOpLinearGrowthIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint256) (runs: 2051, μ: 10667, ~: 10637) -LibOpLinearGrowthTest:testOpLinearGrowthRun(uint256,uint256,uint256,uint16) (runs: 2051, μ: 15326, ~: 15229) -LibOpLnTest:testOpLnEval() (gas: 223996) -LibOpLnTest:testOpLnEvalOperandDisallowed() (gas: 17716) -LibOpLnTest:testOpLnIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint256) (runs: 2051, μ: 10665, ~: 10635) -LibOpLnTest:testOpLnRun(uint256,uint16) (runs: 2051, μ: 24912, ~: 24935) -LibOpLnTest:testOpLnTwoInputs() (gas: 40336) -LibOpLnTest:testOpLnTwoOutputs() (gas: 35968) -LibOpLnTest:testOpLnZeroInputs() (gas: 30042) -LibOpLnTest:testOpLnZeroOutputs() (gas: 34876) -LibOpLog10Test:testOpLog10Eval() (gas: 272639) -LibOpLog10Test:testOpLog10EvalOperandDisallowed() (gas: 17937) -LibOpLog10Test:testOpLog10Integrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint256) (runs: 2051, μ: 10666, ~: 10636) -LibOpLog10Test:testOpLog10Run(uint256,uint16) (runs: 2051, μ: 28512, ~: 28532) -LibOpLog10Test:testOpLog10TwoInputs() (gas: 40600) -LibOpLog10Test:testOpLog10TwoOutputs() (gas: 36190) -LibOpLog10Test:testOpLog10ZeroInputs() (gas: 30261) -LibOpLog10Test:testOpLog10ZeroOutputs() (gas: 35118) -LibOpLog2Test:testOpLog2Eval() (gas: 262552) -LibOpLog2Test:testOpLog2EvalOperandDisallowed() (gas: 17856) -LibOpLog2Test:testOpLog2Integrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint256) (runs: 2051, μ: 10665, ~: 10635) -LibOpLog2Test:testOpLog2Run(uint256) (runs: 2051, μ: 24607, ~: 24646) -LibOpLog2Test:testOpLog2TwoInputs() (gas: 40465) -LibOpLog2Test:testOpLog2TwoOutputs() (gas: 36097) -LibOpLog2Test:testOpLog2ZeroInputs() (gas: 30215) -LibOpLog2Test:testOpLog2ZeroOutputs() (gas: 35091) -LibOpMaxTest:testOpMaxEval2InputsHappy() (gas: 536871) -LibOpMaxTest:testOpMaxEval3InputsHappy() (gas: 1830093) -LibOpMaxTest:testOpMaxEvalOneInput() (gas: 127927) -LibOpMaxTest:testOpMaxEvalOperandDisallowed() (gas: 59987) -LibOpMaxTest:testOpMaxEvalTwoOutputs() (gas: 41170) -LibOpMaxTest:testOpMaxEvalZeroInputs() (gas: 30158) -LibOpMaxTest:testOpMaxIntegrityHappy((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint16) (runs: 2051, μ: 14760, ~: 14755) -LibOpMaxTest:testOpMaxIntegrityUnhappyOneInput((uint256,uint256,uint256,uint256[],uint256,bytes)) (runs: 2051, μ: 10609, ~: 10456) -LibOpMaxTest:testOpMaxIntegrityUnhappyZeroInputs((uint256,uint256,uint256,uint256[],uint256,bytes)) (runs: 2051, μ: 10629, ~: 10476) -LibOpMaxTest:testOpMaxRun(uint256[]) (runs: 2049, μ: 15008, ~: 15156) -LibOpMaxUint256NPTest:testOpMaxUint256NPEval() (gas: 42628) -LibOpMaxUint256NPTest:testOpMaxUint256NPEvalFail() (gas: 34422) -LibOpMaxUint256NPTest:testOpMaxUint256NPIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint8,uint16) (runs: 2051, μ: 16292, ~: 16365) -LibOpMaxUint256NPTest:testOpMaxUint256NPRun() (gas: 7498) -LibOpMaxUint256NPTest:testOpMaxUint256NPTwoOutputs() (gas: 31254) -LibOpMaxUint256NPTest:testOpMaxUint256NPZeroOutputs() (gas: 30140) -LibOpMinTest:testOpMinEval2InputsHappy() (gas: 536832) -LibOpMinTest:testOpMinEval3InputsHappy() (gas: 3222017) -LibOpMinTest:testOpMinEvalOneInput() (gas: 127863) -LibOpMinTest:testOpMinEvalOperandDisallowed() (gas: 59966) -LibOpMinTest:testOpMinEvalZeroInputs() (gas: 30163) -LibOpMinTest:testOpMinIntegrityHappy((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint16) (runs: 2051, μ: 14814, ~: 14807) -LibOpMinTest:testOpMinIntegrityUnhappyOneInput((uint256,uint256,uint256,uint256[],uint256,bytes)) (runs: 2051, μ: 10606, ~: 10453) -LibOpMinTest:testOpMinIntegrityUnhappyZeroInputs((uint256,uint256,uint256,uint256[],uint256,bytes)) (runs: 2051, μ: 10607, ~: 10454) -LibOpMinTest:testOpMinRun(uint256[],uint16) (runs: 2049, μ: 15042, ~: 14896) -LibOpModTest:testOpModEval2InputsHappy() (gas: 767923) -LibOpModTest:testOpModEval2InputsUnhappy() (gas: 143072) -LibOpModTest:testOpModEval3InputsHappy() (gas: 1496037) -LibOpModTest:testOpModEval3InputsUnhappy() (gas: 471567) -LibOpModTest:testOpModEvalOneInput() (gas: 127905) -LibOpModTest:testOpModEvalOperandDisallowed() (gas: 60011) -LibOpModTest:testOpModEvalTwoOutputs() (gas: 41146) -LibOpModTest:testOpModEvalZeroInputs() (gas: 30156) -LibOpModTest:testOpModEvalZeroOutputs() (gas: 40103) -LibOpModTest:testOpModIntegrityHappy((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint16) (runs: 2051, μ: 14774, ~: 14771) -LibOpModTest:testOpModIntegrityUnhappyOneInput((uint256,uint256,uint256,uint256[],uint256,bytes)) (runs: 2051, μ: 10608, ~: 10455) -LibOpModTest:testOpModIntegrityUnhappyZeroInputs((uint256,uint256,uint256,uint256[],uint256,bytes)) (runs: 2051, μ: 10586, ~: 10433) -LibOpModTest:testOpModRun(uint256[]) (runs: 2049, μ: 15739, ~: 15777) -LibOpMulTest:testOpDecimal18MulNPIntegrityUnhappyOneInput((uint256,uint256,uint256,uint256[],uint256,bytes)) (runs: 2051, μ: 10630, ~: 10477) -LibOpMulTest:testOpMulEvalOneInput() (gas: 126835) -LibOpMulTest:testOpMulEvalOperandsDisallowed() (gas: 93451) -LibOpMulTest:testOpMulEvalThreeInputsHappy() (gas: 714621) -LibOpMulTest:testOpMulEvalThreeInputsUnhappyOverflow() (gas: 167593) -LibOpMulTest:testOpMulEvalTwoInputsHappy() (gas: 499519) -LibOpMulTest:testOpMulEvalTwoInputsUnhappyOverflow() (gas: 101073) -LibOpMulTest:testOpMulEvalZeroInputs() (gas: 30179) -LibOpMulTest:testOpMulIntegrityHappy((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint16) (runs: 2051, μ: 14758, ~: 14765) -LibOpMulTest:testOpMulIntegrityUnhappyZeroInputs((uint256,uint256,uint256,uint256[],uint256,bytes)) (runs: 2051, μ: 10629, ~: 10476) -LibOpMulTest:testOpMulRun(uint256[]) (runs: 2049, μ: 16841, ~: 14414) -LibOpMulTest:testOpMulTwoOutputs() (gas: 41169) -LibOpMulTest:testOpMulZeroOutputs() (gas: 40126) -LibOpPowTest:testOpPowEval() (gas: 411743) -LibOpPowTest:testOpPowEvalOneInput() (gas: 35522) -LibOpPowTest:testOpPowEvalOperandDisallowed() (gas: 17937) -LibOpPowTest:testOpPowIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint256) (runs: 2051, μ: 10709, ~: 10679) -LibOpPowTest:testOpPowRun(uint256,uint256) (runs: 2051, μ: 26880, ~: 28728) -LibOpPowTest:testOpPowThreeInputs() (gas: 45657) -LibOpPowTest:testOpPowTwoOutputs() (gas: 41220) -LibOpPowTest:testOpPowZeroOutputs() (gas: 40196) -LibOpScale18DynamicTest:testOpScale18DynamicEval() (gas: 1629199) -LibOpScale18DynamicTest:testOpScale18DynamicEvalOneInput() (gas: 132052) -LibOpScale18DynamicTest:testOpScale18DynamicEvalThreeInputs() (gas: 349692) -LibOpScale18DynamicTest:testOpScale18DynamicEvalZeroInputs() (gas: 31437) -LibOpScale18DynamicTest:testOpScale18DynamicIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint16) (runs: 2051, μ: 14730, ~: 14726) -LibOpScale18DynamicTest:testOpScale18DynamicRun(uint256,uint256,uint256,uint256) (runs: 2051, μ: 16242, ~: 16090) -LibOpScale18DynamicTest:testOpScale18DynamicTwoOutputs() (gas: 42373) -LibOpScale18DynamicTest:testOpScale18DynamicZeroOutputs() (gas: 41371) -LibOpScale18Test:testOpScale18Eval() (gas: 1530078) -LibOpScale18Test:testOpScale18EvalOneInput() (gas: 166669) -LibOpScale18Test:testOpScale18EvalZeroInputs() (gas: 34595) -LibOpScale18Test:testOpScale18Integrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint16) (runs: 2051, μ: 14697, ~: 14670) -LibOpScale18Test:testOpScale18Run(uint256,uint256,uint256,uint256) (runs: 2051, μ: 15867, ~: 15892) -LibOpScale18Test:testOpScale18TwoOutputs() (gas: 40458) -LibOpScale18Test:testOpScale18ZeroOutputs() (gas: 39452) -LibOpScale18Test:testOpUint256ToDecimal18Eval() (gas: 171747) -LibOpScaleNDynamicTest:testOpScaleNDynamicEval() (gas: 1626868) -LibOpScaleNDynamicTest:testOpScaleNDynamicEvalOneInput() (gas: 131545) -LibOpScaleNDynamicTest:testOpScaleNDynamicEvalThreeInputs() (gas: 348956) -LibOpScaleNDynamicTest:testOpScaleNDynamicEvalZeroInputs() (gas: 31345) -LibOpScaleNDynamicTest:testOpScaleNDynamicIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint16) (runs: 2051, μ: 14756, ~: 14700) -LibOpScaleNDynamicTest:testOpScaleNDynamicRun(uint256,uint256,uint256,uint256) (runs: 2051, μ: 16836, ~: 16908) -LibOpScaleNDynamicTest:testOpScaleNDynamicTwoOutputs() (gas: 42368) -LibOpScaleNDynamicTest:testOpScaleNDynamicZeroOutputs() (gas: 41302) -LibOpScaleNTest:testOpDecimal18ToIntNPEval() (gas: 288476) -LibOpScaleNTest:testOpScaleNEval() (gas: 1506546) -LibOpScaleNTest:testOpScaleNEvalOneInput() (gas: 163607) -LibOpScaleNTest:testOpScaleNEvalZeroInputs() (gas: 33793) -LibOpScaleNTest:testOpScaleNEvalZeroOutputs() (gas: 38715) -LibOpScaleNTest:testOpScaleNIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint16) (runs: 2051, μ: 14700, ~: 14674) -LibOpScaleNTest:testOpScaleNRun(uint256,uint256,uint256,uint256) (runs: 2051, μ: 15986, ~: 15994) -LibOpScaleNTest:testOpScaleNTwoOutputs() (gas: 39741) -LibOpSetNPTest:testLibOpSetNP(uint256,uint256) (runs: 2051, μ: 6936, ~: 6941) -LibOpSetNPTest:testLibOpSetNPEvalOneInput() (gas: 34177) -LibOpSetNPTest:testLibOpSetNPEvalOneOutput() (gas: 39732) -LibOpSetNPTest:testLibOpSetNPEvalOperandsDisallowed() (gas: 57116) -LibOpSetNPTest:testLibOpSetNPEvalSetTwice() (gas: 72111) -LibOpSetNPTest:testLibOpSetNPEvalThreeInputs() (gas: 44594) -LibOpSetNPTest:testLibOpSetNPEvalTwoInputs() (gas: 245355) -LibOpSetNPTest:testLibOpSetNPEvalTwoOutputs() (gas: 40392) -LibOpSetNPTest:testLibOpSetNPEvalZeroInputs() (gas: 29416) -LibOpSetNPTest:testLibOpSetNPIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint8,uint16) (runs: 2051, μ: 16395, ~: 16463) -LibOpShiftBitsLeftNPTest:testOpShiftBitsLeftNPEval() (gas: 861413) -LibOpShiftBitsLeftNPTest:testOpShiftBitsLeftNPIntegrityFailBadShiftAmount() (gas: 128918) -LibOpShiftBitsLeftNPTest:testOpShiftBitsLeftNPIntegrityFailTwoInputs() (gas: 44838) -LibOpShiftBitsLeftNPTest:testOpShiftBitsLeftNPIntegrityFailTwoOutputs() (gas: 40482) -LibOpShiftBitsLeftNPTest:testOpShiftBitsLeftNPIntegrityFailZeroInputs() (gas: 34587) -LibOpShiftBitsLeftNPTest:testOpShiftBitsLeftNPIntegrityFailZeroOutputs() (gas: 39431) -LibOpShiftBitsLeftNPTest:testOpShiftBitsLeftNPIntegrityHappy((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint8,uint8) (runs: 2051, μ: 19312, ~: 19378) +LibOpDecodeBitsNPTest:testOpDecodeBitsNPRun(uint256,uint8,uint8) (runs: 2051, μ: 20862, ~: 20668) +LibOpERC5313OwnerNPTest:testOpERC5313OwnerNPEvalHappy() (gas: 55091) +LibOpERC5313OwnerNPTest:testOpERC5313OwnerNPEvalOperandDisallowed() (gas: 18512) +LibOpERC5313OwnerNPTest:testOpERC5313OwnerNPEvalTwoInputs() (gas: 43263) +LibOpERC5313OwnerNPTest:testOpERC5313OwnerNPEvalTwoOutputs() (gas: 37540) +LibOpERC5313OwnerNPTest:testOpERC5313OwnerNPEvalZeroInputs() (gas: 30817) +LibOpERC5313OwnerNPTest:testOpERC5313OwnerNPEvalZeroOutputs() (gas: 36489) +LibOpERC5313OwnerNPTest:testOpERC5313OwnerOfNPIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint256) (runs: 2051, μ: 13836, ~: 13806) +LibOpERC5313OwnerNPTest:testOpERC5313OwnerOfNPRun(address,address,uint16) (runs: 2051, μ: 23167, ~: 23167) +LibOpERC721OwnerOfTest:testOpERC721OwnerOfNPEvalFail0() (gas: 30570) +LibOpERC721OwnerOfTest:testOpERC721OwnerOfNPEvalFail1() (gas: 34893) +LibOpERC721OwnerOfTest:testOpERC721OwnerOfNPEvalFail3() (gas: 44311) +LibOpERC721OwnerOfTest:testOpERC721OwnerOfNPEvalFailOperand() (gas: 18346) +LibOpERC721OwnerOfTest:testOpERC721OwnerOfNPEvalHappy(address,uint256,address) (runs: 2051, μ: 96083, ~: 91965) +LibOpERC721OwnerOfTest:testOpERC721OwnerOfNPEvalOneInput() (gas: 35345) +LibOpERC721OwnerOfTest:testOpERC721OwnerOfNPEvalThreeInputs() (gas: 44815) +LibOpERC721OwnerOfTest:testOpERC721OwnerOfNPEvalZeroInputs() (gas: 31034) +LibOpERC721OwnerOfTest:testOpERC721OwnerOfNPEvalZeroOutputs() (gas: 39599) +LibOpERC721OwnerOfTest:testOpERC721OwnerOfNPIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint8) (runs: 2051, μ: 13861, ~: 13838) +LibOpERC721OwnerOfTest:testOpERC721OwnerOfNPRun(address,uint256,address,uint16) (runs: 2051, μ: 23764, ~: 23764) +LibOpERC721OwnerOfTest:testOpERC721OwnerOfNPTwoOutputs() (gas: 40642) +LibOpEncodeBitsNPTest:testOpEncodeBitsNPEvalHappy() (gas: 855413) +LibOpEncodeBitsNPTest:testOpEncodeBitsNPEvalOneInput() (gas: 42207) +LibOpEncodeBitsNPTest:testOpEncodeBitsNPEvalThreeInputs() (gas: 52364) +LibOpEncodeBitsNPTest:testOpEncodeBitsNPEvalTwoOutputs() (gas: 47971) +LibOpEncodeBitsNPTest:testOpEncodeBitsNPEvalZeroInputs() (gas: 36990) +LibOpEncodeBitsNPTest:testOpEncodeBitsNPEvalZeroOutputs() (gas: 46970) +LibOpEncodeBitsNPTest:testOpEncodeBitsNPIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint8) (runs: 2051, μ: 18160, ~: 18227) +LibOpEncodeBitsNPTest:testOpEncodeBitsNPIntegrityFail((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint8) (runs: 2051, μ: 19536, ~: 19440) +LibOpEncodeBitsNPTest:testOpEncodeBitsNPIntegrityFailZeroLength((uint256,uint256,uint256,uint256[],uint256,bytes),uint8) (runs: 2051, μ: 14045, ~: 14021) +LibOpEncodeBitsNPTest:testOpEncodeBitsNPRun(uint256,uint256,uint8,uint8) (runs: 2051, μ: 21264, ~: 21069) +LibOpExternNPTest:testOpExternNPEvalHappy() (gas: 100019) +LibOpExternNPTest:testOpExternNPEvalMultipleInputsOutputsHappy() (gas: 114942) +LibOpExternNPTest:testOpExternNPIntegrityHappy((uint256,uint256,uint256,uint256[],uint256,bytes),address,uint16,uint8,uint8) (runs: 2051, μ: 34376, ~: 34279) +LibOpExternNPTest:testOpExternNPIntegrityNotAnExternContract((uint256,uint256,uint256,uint256[],uint256,bytes),address,uint16,uint8,uint8) (runs: 2051, μ: 52574, ~: 52148) +LibOpExternNPTest:testOpExternNPRunHappy(address,uint256[],uint16,uint256[],uint256[]) (runs: 2051, μ: 116377, ~: 115645) +LibOpGetNPTest:testLibOpGetNPEvalKeyNotSet() (gas: 307874) +LibOpGetNPTest:testLibOpGetNPEvalOperandDisallowed() (gas: 58390) +LibOpGetNPTest:testLibOpGetNPEvalSetThenGet() (gas: 521039) +LibOpGetNPTest:testLibOpGetNPEvalStoreAndSetAndGet() (gas: 254920) +LibOpGetNPTest:testLibOpGetNPEvalStoreThenGet() (gas: 475544) +LibOpGetNPTest:testLibOpGetNPEvalThreeInputs() (gas: 44883) +LibOpGetNPTest:testLibOpGetNPEvalTwoInputs() (gas: 39655) +LibOpGetNPTest:testLibOpGetNPEvalTwoOutputs() (gas: 35201) +LibOpGetNPTest:testLibOpGetNPEvalZeroInputs() (gas: 29686) +LibOpGetNPTest:testLibOpGetNPEvalZeroOutputs() (gas: 34174) +LibOpGetNPTest:testLibOpGetNPIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint8,uint16) (runs: 2051, μ: 20325, ~: 20426) +LibOpGetNPTest:testLibOpGetNPRunState(uint256,uint256,uint16) (runs: 2051, μ: 19501, ~: 19505) +LibOpGetNPTest:testLibOpGetNPRunStateAndStore(uint256,uint256,uint256,uint16) (runs: 2051, μ: 47306, ~: 47524) +LibOpGetNPTest:testLibOpGetNPRunStore(uint256,uint256,uint16) (runs: 2051, μ: 49516, ~: 49724) +LibOpGetNPTest:testLibOpGetNPRunStoreDifferentNamespace(uint256,uint256,uint16) (runs: 2051, μ: 51046, ~: 51254) +LibOpGetNPTest:testLibOpGetNPRunUnset(uint256,uint16) (runs: 2051, μ: 24523, ~: 24528) +LibOpHashNPTest:testOpHashNPEval0Inputs() (gas: 46240) +LibOpHashNPTest:testOpHashNPEval1Input() (gas: 54811) +LibOpHashNPTest:testOpHashNPEval2Inputs() (gas: 63032) +LibOpHashNPTest:testOpHashNPEval2InputsDifferent() (gas: 63724) +LibOpHashNPTest:testOpHashNPEval2InputsOtherStack() (gas: 78604) +LibOpHashNPTest:testOpHashNPIntegrityHappy((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint8,uint16) (runs: 2051, μ: 19499, ~: 19547) +LibOpHashNPTest:testOpHashNPRun(uint256[]) (runs: 2048, μ: 19321, ~: 19429) +LibOpHashNPTest:testOpHashNPTwoOutputs() (gas: 30773) +LibOpHashNPTest:testOpHashNPZeroOutputs() (gas: 29340) +LibOpSetNPTest:testLibOpSetNP(uint256,uint256) (runs: 2051, μ: 17584, ~: 17589) +LibOpSetNPTest:testLibOpSetNPEvalOneInput() (gas: 34094) +LibOpSetNPTest:testLibOpSetNPEvalOneOutput() (gas: 39648) +LibOpSetNPTest:testLibOpSetNPEvalOperandsDisallowed() (gas: 56860) +LibOpSetNPTest:testLibOpSetNPEvalSetTwice() (gas: 78077) +LibOpSetNPTest:testLibOpSetNPEvalThreeInputs() (gas: 44511) +LibOpSetNPTest:testLibOpSetNPEvalTwoInputs() (gas: 258754) +LibOpSetNPTest:testLibOpSetNPEvalTwoOutputs() (gas: 40308) +LibOpSetNPTest:testLibOpSetNPEvalZeroInputs() (gas: 29311) +LibOpSetNPTest:testLibOpSetNPIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint8,uint16) (runs: 2051, μ: 20234, ~: 20320) +LibOpShiftBitsLeftNPTest:testOpShiftBitsLeftNPEval() (gas: 897130) +LibOpShiftBitsLeftNPTest:testOpShiftBitsLeftNPIntegrityFailBadShiftAmount() (gas: 128580) +LibOpShiftBitsLeftNPTest:testOpShiftBitsLeftNPIntegrityFailTwoInputs() (gas: 44755) +LibOpShiftBitsLeftNPTest:testOpShiftBitsLeftNPIntegrityFailTwoOutputs() (gas: 40377) +LibOpShiftBitsLeftNPTest:testOpShiftBitsLeftNPIntegrityFailZeroInputs() (gas: 34504) +LibOpShiftBitsLeftNPTest:testOpShiftBitsLeftNPIntegrityFailZeroOutputs() (gas: 39348) +LibOpShiftBitsLeftNPTest:testOpShiftBitsLeftNPIntegrityHappy((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint8,uint8) (runs: 2051, μ: 19942, ~: 19935) LibOpShiftBitsLeftNPTest:testOpShiftBitsLeftNPIntegrityNoop((uint256,uint256,uint256,uint256[],uint256,bytes),uint8) (runs: 2051, μ: 14033, ~: 14009) -LibOpShiftBitsLeftNPTest:testOpShiftBitsLeftNPIntegrityZero((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint16) (runs: 2051, μ: 19174, ~: 19116) -LibOpShiftBitsLeftNPTest:testOpShiftBitsLeftNPRun(uint256,uint8) (runs: 2051, μ: 10830, ~: 10830) -LibOpShiftBitsRightNPTest:testOpShiftBitsRightNPEval() (gas: 1037432) -LibOpShiftBitsRightNPTest:testOpShiftBitsRightNPIntegrityFailBadShiftAmount() (gas: 129462) -LibOpShiftBitsRightNPTest:testOpShiftBitsRightNPIntegrityHappy((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint8,uint8) (runs: 2051, μ: 19307, ~: 19359) +LibOpShiftBitsLeftNPTest:testOpShiftBitsLeftNPIntegrityZero((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint16) (runs: 2051, μ: 19175, ~: 19187) +LibOpShiftBitsLeftNPTest:testOpShiftBitsLeftNPRun(uint256,uint8) (runs: 2051, μ: 16675, ~: 16675) +LibOpShiftBitsRightNPTest:testOpShiftBitsRightNPEval() (gas: 1079220) +LibOpShiftBitsRightNPTest:testOpShiftBitsRightNPIntegrityFailBadShiftAmount() (gas: 129125) +LibOpShiftBitsRightNPTest:testOpShiftBitsRightNPIntegrityHappy((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint8,uint8) (runs: 2051, μ: 19925, ~: 19840) LibOpShiftBitsRightNPTest:testOpShiftBitsRightNPIntegrityNoop((uint256,uint256,uint256,uint256[],uint256,bytes),uint8) (runs: 2051, μ: 14001, ~: 13977) -LibOpShiftBitsRightNPTest:testOpShiftBitsRightNPIntegrityZero((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint16) (runs: 2051, μ: 17697, ~: 17677) -LibOpShiftBitsRightNPTest:testOpShiftBitsRightNPRun(uint256,uint8) (runs: 2051, μ: 10855, ~: 10855) -LibOpShiftBitsRightNPTest:testOpShiftBitsRightNPTwoInputs() (gas: 44917) -LibOpShiftBitsRightNPTest:testOpShiftBitsRightNPTwoOutputs() (gas: 40563) -LibOpShiftBitsRightNPTest:testOpShiftBitsRightNPZeroInputs() (gas: 34646) -LibOpShiftBitsRightNPTest:testOpShiftBitsRightNPZeroOutputs() (gas: 39515) -LibOpSnapToUnitTest:testOpSnapToUnitEval() (gas: 603177) -LibOpSnapToUnitTest:testOpSnapToUnitEvalBad() (gas: 103480) -LibOpSnapToUnitTest:testOpSnapToUnitEvalOperandDisallowed() (gas: 18460) -LibOpSnapToUnitTest:testOpSnapToUnitEvalTwoOutputs() (gas: 41819) -LibOpSnapToUnitTest:testOpSnapToUnitEvalZeroOutputs() (gas: 40797) -LibOpSnapToUnitTest:testOpSnapToUnitIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint256) (runs: 2051, μ: 10686, ~: 10656) -LibOpSnapToUnitTest:testOpSnapToUnitRun(uint256,uint256) (runs: 2051, μ: 12281, ~: 11964) -LibOpSqrtTest:testOpSqrtEval() (gas: 204163) -LibOpSqrtTest:testOpSqrtEvalBad() (gas: 65750) -LibOpSqrtTest:testOpSqrtEvalOperandDisallowed() (gas: 17834) -LibOpSqrtTest:testOpSqrtEvalTwoOutputs() (gas: 36108) -LibOpSqrtTest:testOpSqrtEvalZeroOutputs() (gas: 35058) -LibOpSqrtTest:testOpSqrtIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint256) (runs: 2051, μ: 10688, ~: 10658) -LibOpSqrtTest:testOpSqrtRun(uint256) (runs: 2051, μ: 13312, ~: 13609) -LibOpStackNPTest:testOpStackEval() (gas: 52525) -LibOpStackNPTest:testOpStackEvalSeveral() (gas: 84069) -LibOpStackNPTest:testOpStackNPIntegrity(bytes,uint256,uint256[],uint256) (runs: 2051, μ: 15521, ~: 15388) -LibOpStackNPTest:testOpStackNPIntegrityOOBStack(bytes,uint16,uint256[],uint16,uint256) (runs: 2051, μ: 19215, ~: 19230) -LibOpStackNPTest:testOpStackNPMultipleOutputErrorSugared() (gas: 40192) -LibOpStackNPTest:testOpStackNPMultipleOutputErrorUnsugared() (gas: 43193) -LibOpStackNPTest:testOpStackNPRun(uint256[][],uint256) (runs: 2051, μ: 2038485, ~: 1869043) -LibOpStackNPTest:testOpStackNPZeroOutputErrorSugared() (gas: 38786) -LibOpStackNPTest:testOpStackNPZeroOutputErrorUnsugared() (gas: 41709) -LibOpSubTest:testOpSubEval2InputsSaturatingUnderflow() (gas: 292188) -LibOpSubTest:testOpSubEval2InputsUnhappyUnderflow() (gas: 147120) -LibOpSubTest:testOpSubEval3InputsSaturatingUnderflow() (gas: 758019) -LibOpSubTest:testOpSubEval3InputsUnhappyUnderflow() (gas: 378113) -LibOpSubTest:testOpSubEvalOneInput() (gas: 127814) -LibOpSubTest:testOpSubEvalOneInputSaturating() (gas: 270688) -LibOpSubTest:testOpSubEvalThreeInputs() (gas: 213431) -LibOpSubTest:testOpSubEvalThreeInputsSaturating() (gas: 432475) -LibOpSubTest:testOpSubEvalTwoInputs() (gas: 318456) -LibOpSubTest:testOpSubEvalTwoInputsSaturating() (gas: 654800) -LibOpSubTest:testOpSubEvalZeroInputs() (gas: 30130) -LibOpSubTest:testOpSubEvalZeroInputsSaturating() (gas: 59323) -LibOpSubTest:testOpSubIntegrityHappy((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint16) (runs: 2051, μ: 14751, ~: 14755) -LibOpSubTest:testOpSubIntegrityUnhappyOneInput((uint256,uint256,uint256,uint256[],uint256,bytes)) (runs: 2051, μ: 10585, ~: 10432) -LibOpSubTest:testOpSubIntegrityUnhappyZeroInputs((uint256,uint256,uint256,uint256[],uint256,bytes)) (runs: 2051, μ: 10630, ~: 10477) -LibOpSubTest:testOpSubRun(uint256[]) (runs: 2049, μ: 13200, ~: 13163) -LibOpTimestampNPTest:testOpBlockTimestampNPEvalFail() (gas: 65776) -LibOpTimestampNPTest:testOpBlockTimestampNPTwoOutputs() (gas: 58664) -LibOpTimestampNPTest:testOpBlockTimestampNPZeroOutputs() (gas: 56588) -LibOpTimestampNPTest:testOpTimestampNPEval(uint256) (runs: 2051, μ: 83120, ~: 82991) -LibOpTimestampNPTest:testOpTimestampNPIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint8,uint16) (runs: 2051, μ: 16267, ~: 16394) -LibOpTimestampNPTest:testOpTimestampNPRun(uint256) (runs: 2051, μ: 14173, ~: 14044) -LibOpUint256DivTest:testOpUint256DivEval2InputsHappy() (gas: 779407) -LibOpUint256DivTest:testOpUint256DivEval2InputsUnhappy() (gas: 145016) -LibOpUint256DivTest:testOpUint256DivEval3InputsHappy() (gas: 1465582) -LibOpUint256DivTest:testOpUint256DivEval3InputsUnhappy() (gas: 477526) -LibOpUint256DivTest:testOpUint256DivEvalOneInput() (gas: 131000) -LibOpUint256DivTest:testOpUint256DivEvalOperandDisallowed() (gas: 62603) -LibOpUint256DivTest:testOpUint256DivEvalTwoOutputs() (gas: 41796) -LibOpUint256DivTest:testOpUint256DivEvalZeroInputs() (gas: 30806) -LibOpUint256DivTest:testOpUint256DivEvalZeroOutputs() (gas: 40774) -LibOpUint256DivTest:testOpUint256DivIntegrityHappy((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint16) (runs: 2051, μ: 14775, ~: 14786) -LibOpUint256DivTest:testOpUint256DivIntegrityUnhappyOneInput((uint256,uint256,uint256,uint256[],uint256,bytes)) (runs: 2051, μ: 10628, ~: 10475) -LibOpUint256DivTest:testOpUint256DivIntegrityUnhappyZeroInputs((uint256,uint256,uint256,uint256[],uint256,bytes)) (runs: 2051, μ: 10584, ~: 10431) -LibOpUint256DivTest:testOpUint256DivRun(uint256[]) (runs: 2049, μ: 15720, ~: 15757) -LibOpUint256ERC20AllowanceTest:testOpERC20AllowanceNPEvalFourInputs() (gas: 56538) -LibOpUint256ERC20AllowanceTest:testOpERC20AllowanceNPEvalHappy(uint256) (runs: 2051, μ: 68507, ~: 68507) -LibOpUint256ERC20AllowanceTest:testOpERC20AllowanceNPEvalOneInput() (gas: 37856) -LibOpUint256ERC20AllowanceTest:testOpERC20AllowanceNPEvalOperandDisallowed() (gas: 19439) -LibOpUint256ERC20AllowanceTest:testOpERC20AllowanceNPEvalTwoInputs() (gas: 44187) -LibOpUint256ERC20AllowanceTest:testOpERC20AllowanceNPEvalTwoOutputs() (gas: 51209) -LibOpUint256ERC20AllowanceTest:testOpERC20AllowanceNPEvalZeroInputs() (gas: 31765) -LibOpUint256ERC20AllowanceTest:testOpERC20AllowanceNPEvalZeroOutputs() (gas: 50164) -LibOpUint256ERC20AllowanceTest:testOpERC20AllowanceNPIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint256) (runs: 2051, μ: 10666, ~: 10636) -LibOpUint256ERC20AllowanceTest:testOpERC20AllowanceNPRun(address,address,address,uint256) (runs: 2051, μ: 18363, ~: 18363) -LibOpUint256ERC20BalanceOfTest:testOpERC20BalanceOfNPEvalHappy(uint256) (runs: 2051, μ: 61601, ~: 61601) -LibOpUint256ERC20BalanceOfTest:testOpERC20BalanceOfNPEvalOneInput() (gas: 37960) -LibOpUint256ERC20BalanceOfTest:testOpERC20BalanceOfNPEvalOperandDisallowed() (gas: 19520) -LibOpUint256ERC20BalanceOfTest:testOpERC20BalanceOfNPEvalThreeInputs() (gas: 50082) -LibOpUint256ERC20BalanceOfTest:testOpERC20BalanceOfNPEvalTwoOutputs() (gas: 44933) -LibOpUint256ERC20BalanceOfTest:testOpERC20BalanceOfNPEvalZeroInputs() (gas: 31801) -LibOpUint256ERC20BalanceOfTest:testOpERC20BalanceOfNPEvalZeroOutputs() (gas: 43909) -LibOpUint256ERC20BalanceOfTest:testOpERC20BalanceOfNPIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint256) (runs: 2051, μ: 10708, ~: 10678) -LibOpUint256ERC20BalanceOfTest:testOpERC20BalanceOfNPRun(address,address,uint256,uint16) (runs: 2051, μ: 17848, ~: 17848) -LibOpUint256ERC20TotalSupplyTest:testOpERC20TotalSupplyNPEvalHappy(uint256) (runs: 2051, μ: 54735, ~: 54735) -LibOpUint256ERC20TotalSupplyTest:testOpERC20TotalSupplyNPEvalOperandDisallowed() (gas: 19726) -LibOpUint256ERC20TotalSupplyTest:testOpERC20TotalSupplyNPEvalTwoInputs() (gas: 44430) -LibOpUint256ERC20TotalSupplyTest:testOpERC20TotalSupplyNPEvalTwoOutputs() (gas: 38833) -LibOpUint256ERC20TotalSupplyTest:testOpERC20TotalSupplyNPEvalZeroInputs() (gas: 31963) -LibOpUint256ERC20TotalSupplyTest:testOpERC20TotalSupplyNPEvalZeroOutputs() (gas: 37719) -LibOpUint256ERC20TotalSupplyTest:testOpERC20TotalSupplyNPIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint256) (runs: 2051, μ: 10710, ~: 10680) -LibOpUint256ERC20TotalSupplyTest:testOpERC20TotalSupplyNPRun(address,uint256,uint16) (runs: 2051, μ: 17088, ~: 17088) -LibOpUint256ERC721BalanceOfTest:testOpERC721BalanceOfEvalHappy(address,address,uint256) (runs: 2051, μ: 103194, ~: 103347) -LibOpUint256ERC721BalanceOfTest:testOpERC721BalanceOfIntegrity((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint8,uint16) (runs: 2051, μ: 16266, ~: 16298) -LibOpUint256ERC721BalanceOfTest:testOpERC721BalanceOfIntegrityFail0() (gas: 31441) -LibOpUint256ERC721BalanceOfTest:testOpERC721BalanceOfIntegrityFail1() (gas: 35815) -LibOpUint256ERC721BalanceOfTest:testOpERC721BalanceOfIntegrityFail3() (gas: 45152) -LibOpUint256ERC721BalanceOfTest:testOpERC721BalanceOfIntegrityFailOperand() (gas: 22392) -LibOpUint256ERC721BalanceOfTest:testOpERC721BalanceOfOneInput() (gas: 36294) -LibOpUint256ERC721BalanceOfTest:testOpERC721BalanceOfRun(address,address,uint256,uint16) (runs: 2051, μ: 17846, ~: 17846) -LibOpUint256ERC721BalanceOfTest:testOpERC721BalanceOfThreeInputs() (gas: 45600) -LibOpUint256ERC721BalanceOfTest:testOpERC721BalanceOfTwoOutputs() (gas: 41671) -LibOpUint256ERC721BalanceOfTest:testOpERC721BalanceOfZeroInputs() (gas: 31869) -LibOpUint256ERC721BalanceOfTest:testOpERC721BalanceOfZeroOutputs() (gas: 40649) -LibOpUint256MulTest:testOpUint256MulEvalOneInput() (gas: 130541) -LibOpUint256MulTest:testOpUint256MulEvalOperandsDisallowed() (gas: 97362) -LibOpUint256MulTest:testOpUint256MulEvalThreeInputsHappy() (gas: 1034853) -LibOpUint256MulTest:testOpUint256MulEvalThreeInputsUnhappy() (gas: 660015) -LibOpUint256MulTest:testOpUint256MulEvalTwoInputsHappy() (gas: 414973) -LibOpUint256MulTest:testOpUint256MulEvalTwoInputsUnhappy() (gas: 144014) -LibOpUint256MulTest:testOpUint256MulEvalTwoOutputs() (gas: 41784) -LibOpUint256MulTest:testOpUint256MulEvalZeroInputs() (gas: 30815) -LibOpUint256MulTest:testOpUint256MulEvalZeroOutputs() (gas: 40786) -LibOpUint256MulTest:testOpUint256MulIntegrityHappy((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint16) (runs: 2051, μ: 14801, ~: 14804) -LibOpUint256MulTest:testOpUint256MulIntegrityUnhappyOneInput((uint256,uint256,uint256,uint256[],uint256,bytes)) (runs: 2051, μ: 10584, ~: 10431) -LibOpUint256MulTest:testOpUint256MulIntegrityUnhappyZeroInputs((uint256,uint256,uint256,uint256[],uint256,bytes)) (runs: 2051, μ: 10630, ~: 10477) -LibOpUint256MulTest:testOpUint256MulRun(uint256[]) (runs: 2049, μ: 13606, ~: 13406) -LibOpUint256PowTest:testOpUint256ExpIntegrityHappy((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint16) (runs: 2051, μ: 14809, ~: 14805) -LibOpUint256PowTest:testOpUint256PowEval2InputsHappy() (gas: 874226) -LibOpUint256PowTest:testOpUint256PowEval2InputsUnhappy() (gas: 145970) -LibOpUint256PowTest:testOpUint256PowEval3InputsHappy() (gas: 2041397) -LibOpUint256PowTest:testOpUint256PowEval3InputsUnhappy() (gas: 647670) -LibOpUint256PowTest:testOpUint256PowEvalOneInput() (gas: 131211) -LibOpUint256PowTest:testOpUint256PowEvalOperandDisallowed() (gas: 63205) -LibOpUint256PowTest:testOpUint256PowEvalTwoOutputs() (gas: 41991) -LibOpUint256PowTest:testOpUint256PowEvalZeroInputs() (gas: 30998) -LibOpUint256PowTest:testOpUint256PowEvalZeroOutputs() (gas: 40904) -LibOpUint256PowTest:testOpUint256PowIntegrityUnhappyOneInput((uint256,uint256,uint256,uint256[],uint256,bytes)) (runs: 2051, μ: 10608, ~: 10455) -LibOpUint256PowTest:testOpUint256PowIntegrityUnhappyZeroInputs((uint256,uint256,uint256,uint256[],uint256,bytes)) (runs: 2051, μ: 10586, ~: 10433) -LibOpUint256PowTest:testOpUint256PowRun(uint256[]) (runs: 2049, μ: 15578, ~: 15063) -LibParseCommentsTest:testParseCommentAfterSources() (gas: 65923) -LibParseCommentsTest:testParseCommentBetweenSources() (gas: 66046) +LibOpShiftBitsRightNPTest:testOpShiftBitsRightNPIntegrityZero((uint256,uint256,uint256,uint256[],uint256,bytes),uint8,uint16) (runs: 2051, μ: 17737, ~: 17729) +LibOpShiftBitsRightNPTest:testOpShiftBitsRightNPRun(uint256,uint8) (runs: 2051, μ: 16722, ~: 16722) +LibOpShiftBitsRightNPTest:testOpShiftBitsRightNPTwoInputs() (gas: 44834) +LibOpShiftBitsRightNPTest:testOpShiftBitsRightNPTwoOutputs() (gas: 40480) +LibOpShiftBitsRightNPTest:testOpShiftBitsRightNPZeroInputs() (gas: 34541) +LibOpShiftBitsRightNPTest:testOpShiftBitsRightNPZeroOutputs() (gas: 39432) +LibOpStackNPTest:testOpStackEval() (gas: 55579) +LibOpStackNPTest:testOpStackEvalSeveral() (gas: 85777) +LibOpStackNPTest:testOpStackNPIntegrity(bytes,uint256,uint256[],uint256) (runs: 2051, μ: 18673, ~: 18558) +LibOpStackNPTest:testOpStackNPIntegrityOOBStack(bytes,uint16,uint256[],uint16,uint256) (runs: 2051, μ: 19246, ~: 19193) +LibOpStackNPTest:testOpStackNPMultipleOutputErrorSugared() (gas: 39441) +LibOpStackNPTest:testOpStackNPMultipleOutputErrorUnsugared() (gas: 43066) +LibOpStackNPTest:testOpStackNPRun(uint256[][],uint256) (runs: 2051, μ: 2039470, ~: 1872230) +LibOpStackNPTest:testOpStackNPZeroOutputErrorSugared() (gas: 38035) +LibOpStackNPTest:testOpStackNPZeroOutputErrorUnsugared() (gas: 41626) +LibParseCommentsTest:testParseCommentAfterSources() (gas: 69470) +LibParseCommentsTest:testParseCommentBetweenSources() (gas: 69548) LibParseCommentsTest:testParseCommentInIgnoredLHS() (gas: 42114) -LibParseCommentsTest:testParseCommentInLHSWhitespace() (gas: 42417) +LibParseCommentsTest:testParseCommentInLHSWhitespace() (gas: 42395) LibParseCommentsTest:testParseCommentInNamedLHS() (gas: 42264) -LibParseCommentsTest:testParseCommentInRHS() (gas: 42496) +LibParseCommentsTest:testParseCommentInRHS() (gas: 42561) LibParseCommentsTest:testParseCommentInRHS2() (gas: 45415) LibParseCommentsTest:testParseCommentInRHS3() (gas: 45425) -LibParseCommentsTest:testParseCommentLong() (gas: 59172) -LibParseCommentsTest:testParseCommentManyAstericks() (gas: 52349) -LibParseCommentsTest:testParseCommentManyAstericksTrailing() (gas: 52285) -LibParseCommentsTest:testParseCommentMultiple() (gas: 70730) -LibParseCommentsTest:testParseCommentNoTrailingWhitespace() (gas: 42997) -LibParseCommentsTest:testParseCommentNoWords() (gas: 48072) -LibParseCommentsTest:testParseCommentSingleWord() (gas: 52811) -LibParseCommentsTest:testParseCommentSingleWordSameLine() (gas: 53648) +LibParseCommentsTest:testParseCommentLong() (gas: 62861) +LibParseCommentsTest:testParseCommentManyAstericks() (gas: 55971) +LibParseCommentsTest:testParseCommentManyAstericksTrailing() (gas: 55907) +LibParseCommentsTest:testParseCommentMultiple() (gas: 74232) +LibParseCommentsTest:testParseCommentNoTrailingWhitespace() (gas: 42975) +LibParseCommentsTest:testParseCommentNoWords() (gas: 52406) +LibParseCommentsTest:testParseCommentSingleWord() (gas: 56433) +LibParseCommentsTest:testParseCommentSingleWordSameLine() (gas: 57270) LibParseCommentsTest:testParseCommentUnclosed() (gas: 42647) LibParseCommentsTest:testParseCommentUnclosed2() (gas: 42825) LibParseEmptyGasTest:testParseGasEmpty00() (gas: 38090) LibParseEmptyGasTest:testParseGasEmpty01() (gas: 42935) LibParseEmptyGasTest:testParseGasEmpty02() (gas: 47171) -LibParseEmptyGasTest:testParseGasEmpty03() (gas: 51428) +LibParseEmptyGasTest:testParseGasEmpty03() (gas: 51384) LibParseEmptyGasTest:testParseGasEmpty04() (gas: 55597) -LibParseEmptyTest:testParseEmpty00() (gas: 38769) -LibParseEmptyTest:testParseEmpty01() (gas: 46318) -LibParseEmptyTest:testParseEmpty02() (gas: 53615) -LibParseEmptyTest:testParseEmpty03() (gas: 60667) -LibParseEmptyTest:testParseEmpty04() (gas: 67718) -LibParseEmptyTest:testParseEmpty08() (gas: 96030) -LibParseEmptyTest:testParseEmpty15() (gas: 145562) -LibParseEmptyTest:testParseEmptyError16() (gas: 86224) -LibParseIgnoredLHSTest:testParseIgnoredLHSAlphaTooLong() (gas: 48427) -LibParseIgnoredLHSTest:testParseIgnoredLHSLoneUnderscore() (gas: 47026) -LibParseIgnoredLHSTest:testParseIgnoredLHSMultipleLines() (gas: 50305) -LibParseIgnoredLHSTest:testParseIgnoredLHSTwoAlphas() (gas: 48136) -LibParseIgnoredLHSTest:testParseIgnoredLHSTwoUnderscores() (gas: 47925) -LibParseIgnoredLHSTest:testParseIgnoredLHSUnderscoreAlpha() (gas: 47079) -LibParseIgnoredLHSTest:testParseIgnoredLHSUnderscoreNotInput() (gas: 52777) -LibParseIgnoredLHSTest:testParseIgnoredWordTooLong() (gas: 49737) +LibParseEmptyTest:testParseEmpty00() (gas: 42493) +LibParseEmptyTest:testParseEmpty01() (gas: 50675) +LibParseEmptyTest:testParseEmpty02() (gas: 58519) +LibParseEmptyTest:testParseEmpty03() (gas: 66163) +LibParseEmptyTest:testParseEmpty04() (gas: 73828) +LibParseEmptyTest:testParseEmpty08() (gas: 104673) +LibParseEmptyTest:testParseEmpty15() (gas: 158493) +LibParseEmptyTest:testParseEmptyError16() (gas: 86202) +LibParseIgnoredLHSTest:testParseIgnoredLHSAlphaTooLong() (gas: 52762) +LibParseIgnoredLHSTest:testParseIgnoredLHSLoneUnderscore() (gas: 51361) +LibParseIgnoredLHSTest:testParseIgnoredLHSMultipleLines() (gas: 54618) +LibParseIgnoredLHSTest:testParseIgnoredLHSTwoAlphas() (gas: 52471) +LibParseIgnoredLHSTest:testParseIgnoredLHSTwoUnderscores() (gas: 52304) +LibParseIgnoredLHSTest:testParseIgnoredLHSUnderscoreAlpha() (gas: 51437) +LibParseIgnoredLHSTest:testParseIgnoredLHSUnderscoreNotInput() (gas: 56424) +LibParseIgnoredLHSTest:testParseIgnoredWordTooLong() (gas: 54050) LibParseInputsOnlyGasTest:testParseGasInputsOnly00() (gas: 43633) LibParseInputsOnlyGasTest:testParseGasInputsOnly01() (gas: 44565) LibParseInputsOnlyGasTest:testParseGasInputsOnly02() (gas: 45470) -LibParseInputsOnlyGasTest:testParseGasInputsOnly03() (gas: 46423) +LibParseInputsOnlyGasTest:testParseGasInputsOnly03() (gas: 46401) LibParseInputsOnlyGasTest:testParseGasInputsOnly04() (gas: 47332) LibParseInputsOnlyGasTest:testParseGasInputsOnly05() (gas: 48263) LibParseInputsOnlyGasTest:testParseGasInputsOnly06() (gas: 49192) LibParseInputsOnlyGasTest:testParseGasInputsOnly07() (gas: 50153) -LibParseInputsOnlyGasTest:testParseGasInputsOnly08() (gas: 51073) -LibParseInputsOnlyGasTest:testParseGasInputsOnly09() (gas: 52004) -LibParseInputsOnlyTest:testParseInputsOnlyMultiple() (gas: 47946) -LibParseInputsOnlyTest:testParseInputsOnlySingle() (gas: 47017) -LibParseIsMaskTest:testIsMaskPastEnd(uint256,uint256,uint256) (runs: 2051, μ: 14273, ~: 16044) -LibParseIsMaskTest:testIsMaskReference(string,uint256,uint256) (runs: 2051, μ: 8031, ~: 8081) -LibParseLiteralBoundLiteralHexTest:testParseLiteralBoundLiteralHexBounds() (gas: 8440) -LibParseLiteralBoundLiteralHexTest:testParseLiteralBoundLiteralHexFuzz(string,bytes1,string) (runs: 2051, μ: 39970, ~: 38768) -LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatDecimals() (gas: 371558) +LibParseInputsOnlyGasTest:testParseGasInputsOnly08() (gas: 51051) +LibParseInputsOnlyGasTest:testParseGasInputsOnly09() (gas: 51982) +LibParseInputsOnlyTest:testParseInputsOnlyMultiple() (gas: 52259) +LibParseInputsOnlyTest:testParseInputsOnlySingle() (gas: 51352) +LibParseIsMaskTest:testIsMaskPastEnd(uint256,uint256,uint256) (runs: 2051, μ: 17087, ~: 18994) +LibParseIsMaskTest:testIsMaskReference(string,uint256,uint256) (runs: 2051, μ: 8346, ~: 8396) +LibParseLiteralBoundLiteralHexTest:testParseLiteralBoundLiteralHexBounds() (gas: 18768) +LibParseLiteralBoundLiteralHexTest:testParseLiteralBoundLiteralHexFuzz(string,bytes1,string) (runs: 2051, μ: 45045, ~: 43698) +LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatDecimals() (gas: 411326) LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatDotE() (gas: 5430) -LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatDotE0() (gas: 5430) -LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatDotRevert() (gas: 5431) +LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatDotE0() (gas: 5408) +LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatDotRevert() (gas: 5409) LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatDotRevert2() (gas: 5408) -LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatDotRevert3() (gas: 6281) +LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatDotRevert3() (gas: 6259) LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatEDot() (gas: 5432) -LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatEmpty() (gas: 5419) +LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatEmpty() (gas: 5397) LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatExponentRevert() (gas: 5377) -LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatExponentRevert2() (gas: 6435) -LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatExponentRevert3() (gas: 6519) +LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatExponentRevert2() (gas: 6479) +LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatExponentRevert3() (gas: 6497) LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatExponentRevert4() (gas: 5430) LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatExponentRevert5() (gas: 5451) -LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatExponentRevert6() (gas: 5387) -LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatExponents() (gas: 388612) -LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatFuzz(uint256,uint8,bool) (runs: 2051, μ: 43121, ~: 34571) -LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatLeadingZeros() (gas: 55680) +LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatExponentRevert6() (gas: 5452) +LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatExponents() (gas: 448597) +LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatFuzz(uint256,uint8,bool) (runs: 2051, μ: 46691, ~: 38133) +LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatLeadingZeros() (gas: 65265) LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatNegativeE() (gas: 7499) LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatNegativeFrac() (gas: 6230) LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatNonDecimal() (gas: 5408) -LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatPrecisionRevert0() (gas: 28683) -LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatPrecisionRevert1() (gas: 28606) -LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatSpecific() (gas: 19052) -LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatUnrelated() (gas: 28295) -LibParseLiteralDecimalTest:testParseLiteralDecimalDecimals() (gas: 147501) -LibParseLiteralDecimalTest:testParseLiteralDecimalDotError() (gas: 5329) -LibParseLiteralDecimalTest:testParseLiteralDecimalDotError2() (gas: 5351) -LibParseLiteralDecimalTest:testParseLiteralDecimalDotError3() (gas: 5964) -LibParseLiteralDecimalTest:testParseLiteralDecimalDotError4() (gas: 5331) -LibParseLiteralDecimalTest:testParseLiteralDecimalDotError5() (gas: 5352) -LibParseLiteralDecimalTest:testParseLiteralDecimalDotError6() (gas: 5309) -LibParseLiteralDecimalTest:testParseLiteralDecimalEmpty() (gas: 5238) -LibParseLiteralDecimalTest:testParseLiteralDecimalExponents() (gas: 143640) -LibParseLiteralDecimalTest:testParseLiteralDecimalExponents2() (gas: 206172) -LibParseLiteralDecimalTest:testParseLiteralDecimalExponents2Capital() (gas: 147944) -LibParseLiteralDecimalTest:testParseLiteralDecimalExponents3() (gas: 227774) -LibParseLiteralDecimalTest:testParseLiteralDecimalExponents4() (gas: 119695) -LibParseLiteralDecimalTest:testParseLiteralDecimalExponentsError() (gas: 5350) -LibParseLiteralDecimalTest:testParseLiteralDecimalExponentsError3() (gas: 6093) -LibParseLiteralDecimalTest:testParseLiteralDecimalExponentsError4() (gas: 5330) -LibParseLiteralDecimalTest:testParseLiteralDecimalExponentsError5() (gas: 5352) -LibParseLiteralDecimalTest:testParseLiteralDecimalNegativeExponents() (gas: 194202) -LibParseLiteralDecimalTest:testParseLiteralDecimalNegativeExponentsError() (gas: 6720) -LibParseLiteralDecimalTest:testParseLiteralDecimalNonDecimal() (gas: 5278) -LibParseLiteralDecimalTest:testParseLiteralDecimalOverflow() (gas: 7756) -LibParseLiteralDecimalTest:testParseLiteralDecimalPrecisionLossDecimal() (gas: 7568) -LibParseLiteralDecimalTest:testParseLiteralDecimalPrecisionLossDecimalMax() (gas: 12117) -LibParseLiteralDecimalTest:testParseLiteralDecimalPrecisionLossDecimalSmall() (gas: 11731) -LibParseLiteralDecimalTest:testParseLiteralDecimalPrecisionLossInteger() (gas: 7430) -LibParseLiteralDecimalTest:testParseLiteralDecimalRoundTrip(uint256) (runs: 2051, μ: 18813, ~: 18006) -LibParseLiteralDecimalTest:testParseLiteralDecimalSpecific() (gas: 40177) -LibParseLiteralDecimalTest:testParseLiteralDecimalTrailingZeros() (gas: 183085) -LibParseLiteralDecimalTest:testParseLiteralDecimalUnrelated() (gas: 60594) -LibParseLiteralHexBoundHexTest:testParseLiteralHexRoundTrip(uint256) (runs: 2051, μ: 15565, ~: 11221) -LibParseLiteralIntegerDecimalTest:testParseIntegerLiteralDecimal00() (gas: 52559) -LibParseLiteralIntegerDecimalTest:testParseIntegerLiteralDecimal01() (gas: 60248) -LibParseLiteralIntegerDecimalTest:testParseIntegerLiteralDecimal02() (gas: 67422) -LibParseLiteralIntegerDecimalTest:testParseIntegerLiteralDecimalENotation() (gas: 86532) -LibParseLiteralIntegerDecimalTest:testParseIntegerLiteralDecimalParensBoth() (gas: 46318) -LibParseLiteralIntegerDecimalTest:testParseIntegerLiteralDecimalParensLeft() (gas: 46360) -LibParseLiteralIntegerDecimalTest:testParseIntegerLiteralDecimalParensRight() (gas: 46222) -LibParseLiteralIntegerDecimalTest:testParseIntegerLiteralDecimalUint256Max() (gas: 74961) -LibParseLiteralIntegerDecimalTest:testParseIntegerLiteralDecimalUint256MaxLeadingZeros() (gas: 75470) +LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatPrecisionRevert0() (gas: 28706) +LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatPrecisionRevert1() (gas: 28584) +LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatSpecific() (gas: 27606) +LibParseLiteralDecimalParseDecimalFloatTest:testParseLiteralDecimalFloatUnrelated() (gas: 36849) +LibParseLiteralDecimalTest:testParseLiteralDecimalDecimals() (gas: 171897) +LibParseLiteralDecimalTest:testParseLiteralDecimalDotError() (gas: 5341) +LibParseLiteralDecimalTest:testParseLiteralDecimalDotError2() (gas: 5341) +LibParseLiteralDecimalTest:testParseLiteralDecimalDotError3() (gas: 5976) +LibParseLiteralDecimalTest:testParseLiteralDecimalDotError4() (gas: 5321) +LibParseLiteralDecimalTest:testParseLiteralDecimalDotError5() (gas: 5298) +LibParseLiteralDecimalTest:testParseLiteralDecimalDotError6() (gas: 5299) +LibParseLiteralDecimalTest:testParseLiteralDecimalEmpty() (gas: 5250) +LibParseLiteralDecimalTest:testParseLiteralDecimalExponents() (gas: 168036) +LibParseLiteralDecimalTest:testParseLiteralDecimalExponents2() (gas: 237834) +LibParseLiteralDecimalTest:testParseLiteralDecimalExponents2Capital() (gas: 171655) +LibParseLiteralDecimalTest:testParseLiteralDecimalExponents3() (gas: 259413) +LibParseLiteralDecimalTest:testParseLiteralDecimalExponents4() (gas: 138106) +LibParseLiteralDecimalTest:testParseLiteralDecimalExponentsError() (gas: 5340) +LibParseLiteralDecimalTest:testParseLiteralDecimalExponentsError3() (gas: 6083) +LibParseLiteralDecimalTest:testParseLiteralDecimalExponentsError4() (gas: 5342) +LibParseLiteralDecimalTest:testParseLiteralDecimalExponentsError5() (gas: 5342) +LibParseLiteralDecimalTest:testParseLiteralDecimalNegativeExponents() (gas: 221911) +LibParseLiteralDecimalTest:testParseLiteralDecimalNegativeExponentsError() (gas: 6710) +LibParseLiteralDecimalTest:testParseLiteralDecimalNonDecimal() (gas: 5245) +LibParseLiteralDecimalTest:testParseLiteralDecimalOverflow() (gas: 7703) +LibParseLiteralDecimalTest:testParseLiteralDecimalPrecisionLossDecimal() (gas: 7558) +LibParseLiteralDecimalTest:testParseLiteralDecimalPrecisionLossDecimalMax() (gas: 12063) +LibParseLiteralDecimalTest:testParseLiteralDecimalPrecisionLossDecimalSmall() (gas: 11721) +LibParseLiteralDecimalTest:testParseLiteralDecimalPrecisionLossInteger() (gas: 7420) +LibParseLiteralDecimalTest:testParseLiteralDecimalRoundTrip(uint256) (runs: 2051, μ: 21975, ~: 21156) +LibParseLiteralDecimalTest:testParseLiteralDecimalSpecific() (gas: 49997) +LibParseLiteralDecimalTest:testParseLiteralDecimalTrailingZeros() (gas: 201496) +LibParseLiteralDecimalTest:testParseLiteralDecimalUnrelated() (gas: 71717) +LibParseLiteralHexBoundHexTest:testParseLiteralHexRoundTrip(uint256) (runs: 2051, μ: 18396, ~: 14263) +LibParseLiteralIntegerDecimalTest:testParseIntegerLiteralDecimal00() (gas: 56515) +LibParseLiteralIntegerDecimalTest:testParseIntegerLiteralDecimal01() (gas: 63825) +LibParseLiteralIntegerDecimalTest:testParseIntegerLiteralDecimal02() (gas: 70353) +LibParseLiteralIntegerDecimalTest:testParseIntegerLiteralDecimalENotation() (gas: 88972) +LibParseLiteralIntegerDecimalTest:testParseIntegerLiteralDecimalParensBoth() (gas: 46319) +LibParseLiteralIntegerDecimalTest:testParseIntegerLiteralDecimalParensLeft() (gas: 46361) +LibParseLiteralIntegerDecimalTest:testParseIntegerLiteralDecimalParensRight() (gas: 46223) +LibParseLiteralIntegerDecimalTest:testParseIntegerLiteralDecimalUint256Max() (gas: 78917) +LibParseLiteralIntegerDecimalTest:testParseIntegerLiteralDecimalUint256MaxLeadingZeros() (gas: 79426) LibParseLiteralIntegerDecimalTest:testParseIntegerLiteralDecimalUint256OverflowLeadingDigit() (gas: 65262) LibParseLiteralIntegerDecimalTest:testParseIntegerLiteralDecimalUint256OverflowLeadingDigitLeadingZeros() (gas: 65386) LibParseLiteralIntegerDecimalTest:testParseIntegerLiteralDecimalUint256OverflowLeadingZeros() (gas: 65549) LibParseLiteralIntegerDecimalTest:testParseIntegerLiteralDecimalUint256OverflowSimple() (gas: 65372) -LibParseLiteralIntegerDecimalTest:testParseIntegerLiteralDecimalYang() (gas: 46759) -LibParseLiteralIntegerHexTest:testParseIntegerLiteralHex00() (gas: 51704) -LibParseLiteralIntegerHexTest:testParseIntegerLiteralHex01() (gas: 57679) -LibParseLiteralIntegerHexTest:testParseIntegerLiteralHex02() (gas: 63495) -LibParseLiteralIntegerHexTest:testParseIntegerLiteralHexUint256Max() (gas: 68528) -LibParseLiteralStringBoundTest:testParseStringLiteralBounds(string) (runs: 2049, μ: 14769, ~: 14830) -LibParseLiteralStringBoundTest:testParseStringLiteralBoundsInvalidCharBefore(string,uint256) (runs: 2051, μ: 28403, ~: 28292) -LibParseLiteralStringBoundTest:testParseStringLiteralBoundsParserOutOfBounds(string,uint256) (runs: 2049, μ: 18785, ~: 18586) -LibParseLiteralStringBoundTest:testParseStringLiteralBoundsTooLong(string) (runs: 2050, μ: 29868, ~: 29408) -LibParseLiteralStringTest:testParseStringLiteralAny(bytes) (runs: 2049, μ: 12712, ~: 12618) -LibParseLiteralStringTest:testParseStringLiteralCorrupt(bytes,uint256) (runs: 2049, μ: 18597, ~: 18526) -LibParseLiteralStringTest:testParseStringLiteralEmpty() (gas: 2413) -LibParseLiteralStringTest:testParseStringLiteralEmpty() (gas: 49176) -LibParseLiteralStringTest:testParseStringLiteralInvalidCharAfter(string,string) (runs: 2050, μ: 69544, ~: 69142) -LibParseLiteralStringTest:testParseStringLiteralInvalidCharWithin(string,uint256) (runs: 2051, μ: 67380, ~: 67238) -LibParseLiteralStringTest:testParseStringLiteralLongASCII(string) (runs: 2050, μ: 68830, ~: 68362) -LibParseLiteralStringTest:testParseStringLiteralShortASCII(string) (runs: 2049, μ: 59571, ~: 59634) -LibParseLiteralStringTest:testParseStringLiteralSimple() (gas: 49251) -LibParseLiteralStringTest:testParseStringLiteralTwo(string,string) (runs: 2048, μ: 72487, ~: 72434) -LibParseLiteralSubParseableTest:testParseLiteralSubParseableBody() (gas: 60385) -LibParseLiteralSubParseableTest:testParseLiteralSubParseableEmptyBody() (gas: 18384) -LibParseLiteralSubParseableTest:testParseLiteralSubParseableHappyFuzz(string,string,string) (runs: 2050, μ: 89138, ~: 88647) -LibParseLiteralSubParseableTest:testParseLiteralSubParseableMissingDispatchEmpty() (gas: 9178) +LibParseLiteralIntegerDecimalTest:testParseIntegerLiteralDecimalYang() (gas: 46805) +LibParseLiteralIntegerHexTest:testParseIntegerLiteralHex00() (gas: 55638) +LibParseLiteralIntegerHexTest:testParseIntegerLiteralHex01() (gas: 61322) +LibParseLiteralIntegerHexTest:testParseIntegerLiteralHex02() (gas: 66361) +LibParseLiteralIntegerHexTest:testParseIntegerLiteralHexUint256Max() (gas: 72462) +LibParseLiteralStringBoundTest:testParseStringLiteralBounds(string) (runs: 2051, μ: 16695, ~: 16752) +LibParseLiteralStringBoundTest:testParseStringLiteralBoundsInvalidCharBefore(string,uint256) (runs: 2051, μ: 30332, ~: 30218) +LibParseLiteralStringBoundTest:testParseStringLiteralBoundsParserOutOfBounds(string,uint256) (runs: 2051, μ: 18751, ~: 18603) +LibParseLiteralStringBoundTest:testParseStringLiteralBoundsTooLong(string) (runs: 2048, μ: 31812, ~: 31361) +LibParseLiteralStringTest:testParseStringLiteralAny(bytes) (runs: 2049, μ: 13388, ~: 13290) +LibParseLiteralStringTest:testParseStringLiteralCorrupt(bytes,uint256) (runs: 2049, μ: 18614, ~: 18542) +LibParseLiteralStringTest:testParseStringLiteralEmpty() (gas: 54332) +LibParseLiteralStringTest:testParseStringLiteralEmpty() (gas: 5585) +LibParseLiteralStringTest:testParseStringLiteralInvalidCharAfter(string,string) (runs: 2048, μ: 69516, ~: 69114) +LibParseLiteralStringTest:testParseStringLiteralInvalidCharWithin(string,uint256) (runs: 2051, μ: 67294, ~: 67199) +LibParseLiteralStringTest:testParseStringLiteralLongASCII(string) (runs: 2048, μ: 68846, ~: 68385) +LibParseLiteralStringTest:testParseStringLiteralShortASCII(string) (runs: 2051, μ: 62233, ~: 62294) +LibParseLiteralStringTest:testParseStringLiteralSimple() (gas: 54434) +LibParseLiteralStringTest:testParseStringLiteralTwo(string,string) (runs: 2049, μ: 75497, ~: 75448) +LibParseLiteralSubParseableTest:testParseLiteralSubParseableBody() (gas: 64781) +LibParseLiteralSubParseableTest:testParseLiteralSubParseableEmptyBody() (gas: 19685) +LibParseLiteralSubParseableTest:testParseLiteralSubParseableHappyFuzz(string,string,string) (runs: 2051, μ: 89709, ~: 89242) +LibParseLiteralSubParseableTest:testParseLiteralSubParseableMissingDispatchEmpty() (gas: 9223) LibParseLiteralSubParseableTest:testParseLiteralSubParseableMissingDispatchUnclosed() (gas: 9228) LibParseLiteralSubParseableTest:testParseLiteralSubParseableMissingDispatchUnclosedWhitespace0() (gas: 9221) LibParseLiteralSubParseableTest:testParseLiteralSubParseableMissingDispatchUnclosedWhitespace1() (gas: 9178) -LibParseLiteralSubParseableTest:testParseLiteralSubParseableUnclosedDispatch0() (gas: 9668) +LibParseLiteralSubParseableTest:testParseLiteralSubParseableUnclosedDispatch0() (gas: 9646) LibParseLiteralSubParseableTest:testParseLiteralSubParseableUnclosedDispatchBody() (gas: 9812) LibParseLiteralSubParseableTest:testParseLiteralSubParseableUnclosedDispatchWhitespace0() (gas: 9742) -LibParseLiteralSubParseableTest:testParseLiteralSubParseableUnclosedDispatchWhitespace1() (gas: 9223) -LibParseLiteralSubParseableTest:testParseLiteralSubParseableUnclosedDoubleOpen() (gas: 9690) +LibParseLiteralSubParseableTest:testParseLiteralSubParseableUnclosedDispatchWhitespace1() (gas: 9201) +LibParseLiteralSubParseableTest:testParseLiteralSubParseableUnclosedDoubleOpen() (gas: 9668) LibParseMissingFinalSemiTest:testParseMissingFinalSemiRevertsEmptySource() (gas: 44895) LibParseMissingFinalSemiTest:testParseMissingFinalSemiRevertsLHSItems() (gas: 42838) LibParseMissingFinalSemiTest:testParseMissingFinalSemiRevertsLoneColon() (gas: 41943) LibParseMissingFinalSemiTest:testParseMissingFinalSemiRevertsSingleWord() (gas: 44890) LibParseMissingFinalSemiTest:testParseMissingFinalSemiRevertsTrailingComma() (gas: 43111) -LibParseNOutputTest:testParseBalanceStackOffsetsInputs() (gas: 58621) -LibParseNOutputTest:testParseNOutputExcessRHS0() (gas: 48956) +LibParseNOutputTest:testParseBalanceStackOffsetsInputs() (gas: 61554) +LibParseNOutputTest:testParseNOutputExcessRHS0() (gas: 50564) LibParseNOutputTest:testParseNOutputExcessRHS1() (gas: 48694) LibParseNOutputTest:testParseNOutputExcessRHS2() (gas: 49097) LibParseNOutputTest:testParseNOutputExcessRHS3() (gas: 50446) -LibParseNOutputTest:testParseNOutputNestedRHS() (gas: 55842) -LibParseNamedLHSTest:testParseNamedDuplicateDifferentSource() (gas: 56888) +LibParseNOutputTest:testParseNOutputNestedRHS() (gas: 56760) +LibParseNamedLHSTest:testParseNamedDuplicateDifferentSource() (gas: 55410) LibParseNamedLHSTest:testParseNamedError32() (gas: 44980) LibParseNamedLHSTest:testParseNamedError33() (gas: 44957) LibParseNamedLHSTest:testParseNamedErrorDuplicateSameSource() (gas: 45201) -LibParseNamedLHSTest:testParseNamedLHSEmptySourceExamples() (gas: 143795) -LibParseNamedLHSTest:testParseNamedLHSStackIndex() (gas: 58885) -LibParseNamedLHSTest:testParseNamedLHSTwoInputs() (gas: 56054) -LibParseNamedRHSTest:testParseSingleLHSNestingAndSequential00() (gas: 77858) -LibParseNamedRHSTest:testParseSingleLHSNestingAndSequential01() (gas: 95767) -LibParseNamedRHSTest:testParseSingleLHSNestingAndSequential02() (gas: 89628) -LibParseNamedRHSTest:testParseSingleLHSNestingAndSequential03() (gas: 210561) -LibParseNamedRHSTest:testParseSingleWord() (gas: 50750) -LibParseNamedRHSTest:testParseTwoFullLinesSingleRHSEach() (gas: 73643) -LibParseNamedRHSTest:testParseTwoFullSourcesSingleRHSEach() (gas: 62488) -LibParseNamedRHSTest:testParseTwoNested() (gas: 54902) -LibParseNamedRHSTest:testParseTwoNestedAsThirdInput() (gas: 65506) -LibParseNamedRHSTest:testParseTwoSequential() (gas: 56551) -LibParseNamedRHSTest:testParseTwoSequentialWithInputs() (gas: 71008) +LibParseNamedLHSTest:testParseNamedLHSEmptySourceExamples() (gas: 153516) +LibParseNamedLHSTest:testParseNamedLHSStackIndex() (gas: 57996) +LibParseNamedLHSTest:testParseNamedLHSTwoInputs() (gas: 61112) +LibParseNamedRHSTest:testParseSingleLHSNestingAndSequential00() (gas: 78612) +LibParseNamedRHSTest:testParseSingleLHSNestingAndSequential01() (gas: 93835) +LibParseNamedRHSTest:testParseSingleLHSNestingAndSequential02() (gas: 89122) +LibParseNamedRHSTest:testParseSingleLHSNestingAndSequential03() (gas: 192678) +LibParseNamedRHSTest:testParseSingleWord() (gas: 54374) +LibParseNamedRHSTest:testParseTwoFullLinesSingleRHSEach() (gas: 75133) +LibParseNamedRHSTest:testParseTwoFullSourcesSingleRHSEach() (gas: 65993) +LibParseNamedRHSTest:testParseTwoNested() (gas: 57814) +LibParseNamedRHSTest:testParseTwoNestedAsThirdInput() (gas: 67706) +LibParseNamedRHSTest:testParseTwoSequential() (gas: 59464) +LibParseNamedRHSTest:testParseTwoSequentialWithInputs() (gas: 72497) LibParseOperand8M1M1Test:testOperand8M1M1Elided() (gas: 92668) -LibParseOperand8M1M1Test:testOperand8M1M1Single() (gas: 274835) -LibParseOperand8M1M1Test:testOperand8M1M1SingleBit() (gas: 564244) -LibParseOperand8M1M1Test:testOperand8M1M1SingleBitsPart1() (gas: 1596197) +LibParseOperand8M1M1Test:testOperand8M1M1Single() (gas: 271311) +LibParseOperand8M1M1Test:testOperand8M1M1SingleBit() (gas: 558958) +LibParseOperand8M1M1Test:testOperand8M1M1SingleBitsPart1() (gas: 1585625) LibParseOperand8M1M1Test:testOperand8M1M1Unclosed() (gas: 306844) LibParseOperand8M1M1Test:testOperand8M1M1Unopened() (gas: 47361) LibParseOperandDisallowedTest:testOperandDisallowed() (gas: 44015) -LibParseOperandDisallowedTest:testOperandDisallowed1() (gas: 44508) -LibParseOperandDisallowedTest:testOperandDisallowed3() (gas: 46372) -LibParseOperandDisallowedTest:testOperandDisallowed4() (gas: 46394) +LibParseOperandDisallowedTest:testOperandDisallowed1() (gas: 44486) +LibParseOperandDisallowedTest:testOperandDisallowed3() (gas: 46350) +LibParseOperandDisallowedTest:testOperandDisallowed4() (gas: 46372) LibParseOperandDoublePerByteNoDefaultTest:testOperandDoublePerByteNoDefaultElided() (gas: 43433) LibParseOperandDoublePerByteNoDefaultTest:testOperandDoublePerByteNoDefaultEmpty() (gas: 43827) LibParseOperandDoublePerByteNoDefaultTest:testOperandDoublePerByteNoDefaultFirst() (gas: 46423) -LibParseOperandDoublePerByteNoDefaultTest:testOperandDoublePerByteNoDefaultMultipleWhitespace() (gas: 56861) -LibParseOperandDoublePerByteNoDefaultTest:testOperandDoublePerByteNoDefaultPostfixWhitespace() (gas: 56038) -LibParseOperandDoublePerByteNoDefaultTest:testOperandDoublePerByteNoDefaultPrefixWhitespace() (gas: 56059) -LibParseOperandDoublePerByteNoDefaultTest:testOperandDoublePerByteNoDefaultSecond() (gas: 55691) -LibParseOperandDoublePerByteNoDefaultTest:testOperandDoublePerByteNoDefaultSecondMax() (gas: 56844) -LibParseOperandDoublePerByteNoDefaultTest:testOperandDoublePerByteNoDefaultSecondMaxZero() (gas: 56198) -LibParseOperandDoublePerByteNoDefaultTest:testOperandDoublePerByteNoDefaultSecondOverflow() (gas: 50951) -LibParseOperandDoublePerByteNoDefaultTest:testOperandDoublePerByteNoDefaultSecondOverflowFirst() (gas: 50952) -LibParseOperandDoublePerByteNoDefaultTest:testOperandDoublePerByteNoDefaultSecondZero() (gas: 55509) -LibParseOperandDoublePerByteNoDefaultTest:testOperandDoublePerByteNoDefaultSecondZeroMax() (gas: 56220) -LibParseOperandDoublePerByteNoDefaultTest:testOperandDoublePerByteNoDefaultThird() (gas: 52424) -LibParseOperandDoublePerByteNoDefaultTest:testOperandDoublePerByteNoDefaultUnclosed() (gas: 49196) +LibParseOperandDoublePerByteNoDefaultTest:testOperandDoublePerByteNoDefaultMultipleWhitespace() (gas: 58502) +LibParseOperandDoublePerByteNoDefaultTest:testOperandDoublePerByteNoDefaultPostfixWhitespace() (gas: 57724) +LibParseOperandDoublePerByteNoDefaultTest:testOperandDoublePerByteNoDefaultPrefixWhitespace() (gas: 57700) +LibParseOperandDoublePerByteNoDefaultTest:testOperandDoublePerByteNoDefaultSecond() (gas: 57332) +LibParseOperandDoublePerByteNoDefaultTest:testOperandDoublePerByteNoDefaultSecondMax() (gas: 58463) +LibParseOperandDoublePerByteNoDefaultTest:testOperandDoublePerByteNoDefaultSecondMaxZero() (gas: 57817) +LibParseOperandDoublePerByteNoDefaultTest:testOperandDoublePerByteNoDefaultSecondOverflow() (gas: 50929) +LibParseOperandDoublePerByteNoDefaultTest:testOperandDoublePerByteNoDefaultSecondOverflowFirst() (gas: 50930) +LibParseOperandDoublePerByteNoDefaultTest:testOperandDoublePerByteNoDefaultSecondZero() (gas: 57195) +LibParseOperandDoublePerByteNoDefaultTest:testOperandDoublePerByteNoDefaultSecondZeroMax() (gas: 57839) +LibParseOperandDoublePerByteNoDefaultTest:testOperandDoublePerByteNoDefaultThird() (gas: 52402) +LibParseOperandDoublePerByteNoDefaultTest:testOperandDoublePerByteNoDefaultUnclosed() (gas: 49261) LibParseOperandDoublePerByteNoDefaultTest:testOperandDoublePerByteNoDefaultUnopened() (gas: 43434) -LibParseOperandHandleOperand8M1M1Test:testHandleOperand8M1M1AllValues(uint256,uint256,uint256) (runs: 2051, μ: 8431, ~: 8516) -LibParseOperandHandleOperand8M1M1Test:testHandleOperand8M1M1AllValuesThirdValueTooLarge(uint256,uint256,uint256) (runs: 2051, μ: 11511, ~: 11326) -LibParseOperandHandleOperand8M1M1Test:testHandleOperand8M1M1FirstAndSecondValue(uint256,uint256) (runs: 2051, μ: 6767, ~: 6760) -LibParseOperandHandleOperand8M1M1Test:testHandleOperand8M1M1FirstAndSecondValueSecondValueTooLarge(uint256,uint256) (runs: 2051, μ: 9800, ~: 9523) -LibParseOperandHandleOperand8M1M1Test:testHandleOperand8M1M1FirstValueOnly(uint256) (runs: 2051, μ: 5142, ~: 5201) -LibParseOperandHandleOperand8M1M1Test:testHandleOperand8M1M1FirstValueTooLarge(uint256) (runs: 2051, μ: 8161, ~: 8363) -LibParseOperandHandleOperand8M1M1Test:testHandleOperand8M1M1ManyValues(uint256[]) (runs: 2051, μ: 14159, ~: 14167) -LibParseOperandHandleOperand8M1M1Test:testHandleOperand8M1M1NoValues() (gas: 3623) -LibParseOperandHandleOperandDisallowedTest:testHandleOperandDisallowedAnyValues(uint256[]) (runs: 2051, μ: 13947, ~: 13993) -LibParseOperandHandleOperandDisallowedTest:testHandleOperandDisallowedNoValues() (gas: 379) -LibParseOperandHandleOperandDoublePerByteNoDefaultTest:testHandleOperandDoublePerByteNoDefaultBothValuesWithinOneByte(uint256,uint256) (runs: 2051, μ: 6528, ~: 6642) -LibParseOperandHandleOperandDoublePerByteNoDefaultTest:testHandleOperandDoublePerByteNoDefaultFirstValueTooLarge(uint256,uint256) (runs: 2051, μ: 9697, ~: 9674) -LibParseOperandHandleOperandDoublePerByteNoDefaultTest:testHandleOperandDoublePerByteNoDefaultManyValues(uint256[]) (runs: 2051, μ: 14032, ~: 14006) -LibParseOperandHandleOperandDoublePerByteNoDefaultTest:testHandleOperandDoublePerByteNoDefaultNoValues() (gas: 3621) -LibParseOperandHandleOperandDoublePerByteNoDefaultTest:testHandleOperandDoublePerByteNoDefaultOneValue(uint256) (runs: 2051, μ: 7622, ~: 7892) -LibParseOperandHandleOperandDoublePerByteNoDefaultTest:testHandleOperandDoublePerByteNoDefaultSecondValueTooLarge(uint256,uint256) (runs: 2051, μ: 9777, ~: 9755) -LibParseOperandHandleOperandM1M1Test:testHandleOperandM1M1ManyValues(uint256[]) (runs: 2051, μ: 14034, ~: 14008) -LibParseOperandHandleOperandM1M1Test:testHandleOperandM1M1NoValues() (gas: 648) -LibParseOperandHandleOperandM1M1Test:testHandleOperandM1M1OneValue(uint256) (runs: 2051, μ: 4923, ~: 4873) -LibParseOperandHandleOperandM1M1Test:testHandleOperandM1M1OneValueTooLarge(uint256) (runs: 2051, μ: 8067, ~: 8013) -LibParseOperandHandleOperandM1M1Test:testHandleOperandM1M1TwoValues(uint256,uint256) (runs: 2051, μ: 6557, ~: 6585) -LibParseOperandHandleOperandM1M1Test:testHandleOperandM1M1TwoValuesSecondValueTooLarge(uint256,uint256) (runs: 2051, μ: 9755, ~: 9516) -LibParseOperandHandleOperandSingleFullTest:testHandleOperandSingleFullManyValues(uint256[]) (runs: 2051, μ: 13984, ~: 14005) -LibParseOperandHandleOperandSingleFullTest:testHandleOperandSingleFullNoDefaultManyValues(uint256[]) (runs: 2051, μ: 13961, ~: 13982) -LibParseOperandHandleOperandSingleFullTest:testHandleOperandSingleFullNoDefaultNoValues() (gas: 3639) -LibParseOperandHandleOperandSingleFullTest:testHandleOperandSingleFullNoDefaultSingleValue(uint256) (runs: 2051, μ: 4484, ~: 4754) -LibParseOperandHandleOperandSingleFullTest:testHandleOperandSingleFullNoValues() (gas: 426) -LibParseOperandHandleOperandSingleFullTest:testHandleOperandSingleFullSingleValue(uint256) (runs: 2051, μ: 4715, ~: 4989) -LibParseOperandHandleOperandSingleFullTest:testHandleOperandSingleFullSingleValueDisallowed(uint256) (runs: 2051, μ: 8469, ~: 8575) -LibParseOperandHandleOperandSingleFullTest:testHandleOperandSingleFullSingleValueNoDefaultDisallowed(uint256) (runs: 2051, μ: 9598, ~: 9705) -LibParseOperandM1M1Test:testOperandM1M1Both() (gas: 55760) -LibParseOperandM1M1Test:testOperandM1M1BothZero() (gas: 56287) -LibParseOperandM1M1Test:testOperandM1M1Elided() (gas: 49627) -LibParseOperandM1M1Test:testOperandM1M1Empty() (gas: 49956) -LibParseOperandM1M1Test:testOperandM1M1First() (gas: 52695) +LibParseOperandHandleOperand8M1M1Test:testHandleOperand8M1M1AllValues(uint256,uint256,uint256) (runs: 2051, μ: 11205, ~: 11288) +LibParseOperandHandleOperand8M1M1Test:testHandleOperand8M1M1AllValuesThirdValueTooLarge(uint256,uint256,uint256) (runs: 2051, μ: 11468, ~: 11285) +LibParseOperandHandleOperand8M1M1Test:testHandleOperand8M1M1FirstAndSecondValue(uint256,uint256) (runs: 2051, μ: 9538, ~: 9532) +LibParseOperandHandleOperand8M1M1Test:testHandleOperand8M1M1FirstAndSecondValueSecondValueTooLarge(uint256,uint256) (runs: 2051, μ: 9791, ~: 9525) +LibParseOperandHandleOperand8M1M1Test:testHandleOperand8M1M1FirstValueOnly(uint256) (runs: 2051, μ: 7933, ~: 7994) +LibParseOperandHandleOperand8M1M1Test:testHandleOperand8M1M1FirstValueTooLarge(uint256) (runs: 2051, μ: 8115, ~: 8321) +LibParseOperandHandleOperand8M1M1Test:testHandleOperand8M1M1ManyValues(uint256[]) (runs: 2051, μ: 14107, ~: 14123) +LibParseOperandHandleOperand8M1M1Test:testHandleOperand8M1M1NoValues() (gas: 3601) +LibParseOperandHandleOperandDisallowedTest:testHandleOperandDisallowedAnyValues(uint256[]) (runs: 2051, μ: 13895, ~: 13949) +LibParseOperandHandleOperandDisallowedTest:testHandleOperandDisallowedNoValues() (gas: 3219) +LibParseOperandHandleOperandDoublePerByteNoDefaultTest:testHandleOperandDoublePerByteNoDefaultBothValuesWithinOneByte(uint256,uint256) (runs: 2051, μ: 9294, ~: 9414) +LibParseOperandHandleOperandDoublePerByteNoDefaultTest:testHandleOperandDoublePerByteNoDefaultFirstValueTooLarge(uint256,uint256) (runs: 2051, μ: 9619, ~: 9329) +LibParseOperandHandleOperandDoublePerByteNoDefaultTest:testHandleOperandDoublePerByteNoDefaultManyValues(uint256[]) (runs: 2051, μ: 14002, ~: 13984) +LibParseOperandHandleOperandDoublePerByteNoDefaultTest:testHandleOperandDoublePerByteNoDefaultNoValues() (gas: 3599) +LibParseOperandHandleOperandDoublePerByteNoDefaultTest:testHandleOperandDoublePerByteNoDefaultOneValue(uint256) (runs: 2051, μ: 7573, ~: 7848) +LibParseOperandHandleOperandDoublePerByteNoDefaultTest:testHandleOperandDoublePerByteNoDefaultSecondValueTooLarge(uint256,uint256) (runs: 2051, μ: 9739, ~: 9713) +LibParseOperandHandleOperandM1M1Test:testHandleOperandM1M1ManyValues(uint256[]) (runs: 2051, μ: 14004, ~: 13986) +LibParseOperandHandleOperandM1M1Test:testHandleOperandM1M1NoValues() (gas: 3554) +LibParseOperandHandleOperandM1M1Test:testHandleOperandM1M1OneValue(uint256) (runs: 2051, μ: 7740, ~: 7704) +LibParseOperandHandleOperandM1M1Test:testHandleOperandM1M1OneValueTooLarge(uint256) (runs: 2051, μ: 8041, ~: 7712) +LibParseOperandHandleOperandM1M1Test:testHandleOperandM1M1TwoValues(uint256,uint256) (runs: 2051, μ: 9376, ~: 9402) +LibParseOperandHandleOperandM1M1Test:testHandleOperandM1M1TwoValuesSecondValueTooLarge(uint256,uint256) (runs: 2051, μ: 9712, ~: 9474) +LibParseOperandHandleOperandSingleFullTest:testHandleOperandSingleFullManyValues(uint256[]) (runs: 2051, μ: 13954, ~: 13983) +LibParseOperandHandleOperandSingleFullTest:testHandleOperandSingleFullNoDefaultManyValues(uint256[]) (runs: 2051, μ: 13998, ~: 14027) +LibParseOperandHandleOperandSingleFullTest:testHandleOperandSingleFullNoDefaultNoValues() (gas: 3595) +LibParseOperandHandleOperandSingleFullTest:testHandleOperandSingleFullNoDefaultSingleValue(uint256) (runs: 2051, μ: 7293, ~: 7569) +LibParseOperandHandleOperandSingleFullTest:testHandleOperandSingleFullNoValues() (gas: 3244) +LibParseOperandHandleOperandSingleFullTest:testHandleOperandSingleFullSingleValue(uint256) (runs: 2051, μ: 7506, ~: 7782) +LibParseOperandHandleOperandSingleFullTest:testHandleOperandSingleFullSingleValueDisallowed(uint256) (runs: 2051, μ: 8442, ~: 8555) +LibParseOperandHandleOperandSingleFullTest:testHandleOperandSingleFullSingleValueNoDefaultDisallowed(uint256) (runs: 2051, μ: 9552, ~: 9663) +LibParseOperandM1M1Test:testOperandM1M1Both() (gas: 57445) +LibParseOperandM1M1Test:testOperandM1M1BothZero() (gas: 56265) +LibParseOperandM1M1Test:testOperandM1M1Elided() (gas: 51246) +LibParseOperandM1M1Test:testOperandM1M1Empty() (gas: 51642) +LibParseOperandM1M1Test:testOperandM1M1First() (gas: 54314) LibParseOperandM1M1Test:testOperandM1M1FirstOverflow() (gas: 46881) -LibParseOperandM1M1Test:testOperandM1M1Second() (gas: 55724) +LibParseOperandM1M1Test:testOperandM1M1Second() (gas: 57365) LibParseOperandM1M1Test:testOperandM1M1SecondOverflow() (gas: 50011) -LibParseOperandM1M1Test:testOperandM1M1SecondZero() (gas: 55624) -LibParseOperandM1M1Test:testOperandM1M1Unclosed() (gas: 252097) -LibParseOperandM1M1Test:testOperandM1M1Unopened() (gas: 48738) -LibParseOperandParseOperandTest:testParseOperandEmptyOperand(string) (runs: 2051, μ: 41726, ~: 41730) -LibParseOperandParseOperandTest:testParseOperandFourDecimalLiterals(bool[4],uint256[4],string[5],string) (runs: 2051, μ: 349735, ~: 349714) -LibParseOperandParseOperandTest:testParseOperandNoOpeningCharacter(string) (runs: 2051, μ: 41674, ~: 41678) -LibParseOperandParseOperandTest:testParseOperandSingleDecimalLiteral(bool,uint256,string,string,string) (runs: 2051, μ: 149722, ~: 149880) -LibParseOperandParseOperandTest:testParseOperandThreeDecimalLiterals(bool,bool,bool,uint256,uint256,uint256,string,string,string,string,string) (runs: 2051, μ: 281173, ~: 281470) -LibParseOperandParseOperandTest:testParseOperandTooManyValues() (gas: 53446) -LibParseOperandParseOperandTest:testParseOperandTwoDecimalLiterals(bool,bool,uint256,uint256,string,string,string,string) (runs: 2051, μ: 217866, ~: 217662) -LibParseOperandParseOperandTest:testParseOperandUnclosed() (gas: 52951) -LibParseOperandParseOperandTest:testParseOperandUnexpectedChars() (gas: 50023) -LibParseOperandSingleFullTest:testOperandSingleFullElided() (gas: 49367) -LibParseOperandSingleFullTest:testOperandSingleFullEmpty() (gas: 49696) -LibParseOperandSingleFullTest:testOperandSingleFullHexOne() (gas: 51512) -LibParseOperandSingleFullTest:testOperandSingleFullHexUint16Max() (gas: 52128) +LibParseOperandM1M1Test:testOperandM1M1SecondZero() (gas: 57243) +LibParseOperandM1M1Test:testOperandM1M1Unclosed() (gas: 252075) +LibParseOperandM1M1Test:testOperandM1M1Unopened() (gas: 48781) +LibParseOperandParseOperandTest:testParseOperandEmptyOperand(string) (runs: 2051, μ: 42731, ~: 42735) +LibParseOperandParseOperandTest:testParseOperandFourDecimalLiterals(bool[4],uint256[4],string[5],string) (runs: 2050, μ: 351833, ~: 351379) +LibParseOperandParseOperandTest:testParseOperandNoOpeningCharacter(string) (runs: 2051, μ: 42679, ~: 42676) +LibParseOperandParseOperandTest:testParseOperandSingleDecimalLiteral(bool,uint256,string,string,string) (runs: 2051, μ: 153459, ~: 153730) +LibParseOperandParseOperandTest:testParseOperandThreeDecimalLiterals(bool,bool,bool,uint256,uint256,uint256,string,string,string,string,string) (runs: 2051, μ: 283282, ~: 283990) +LibParseOperandParseOperandTest:testParseOperandTooManyValues() (gas: 53781) +LibParseOperandParseOperandTest:testParseOperandTwoDecimalLiterals(bool,bool,uint256,uint256,string,string,string,string) (runs: 2051, μ: 219596, ~: 219340) +LibParseOperandParseOperandTest:testParseOperandUnclosed() (gas: 53286) +LibParseOperandParseOperandTest:testParseOperandUnexpectedChars() (gas: 50358) +LibParseOperandSingleFullTest:testOperandSingleFullElided() (gas: 50986) +LibParseOperandSingleFullTest:testOperandSingleFullEmpty() (gas: 51315) +LibParseOperandSingleFullTest:testOperandSingleFullHexOne() (gas: 53153) +LibParseOperandSingleFullTest:testOperandSingleFullHexUint16Max() (gas: 53769) LibParseOperandSingleFullTest:testOperandSingleFullHexUint16MaxOverflow() (gas: 46827) -LibParseOperandSingleFullTest:testOperandSingleFullHexZero() (gas: 51468) -LibParseOperandSingleFullTest:testOperandSingleFullLeadingAndTrailingWhitespace() (gas: 52233) -LibParseOperandSingleFullTest:testOperandSingleFullLeadingWhitespace() (gas: 52845) -LibParseOperandSingleFullTest:testOperandSingleFullMultiple() (gas: 47625) -LibParseOperandSingleFullTest:testOperandSingleFullOne() (gas: 52496) -LibParseOperandSingleFullTest:testOperandSingleFullTrailingWhitespace() (gas: 52867) -LibParseOperandSingleFullTest:testOperandSingleFullUint16Max() (gas: 53584) +LibParseOperandSingleFullTest:testOperandSingleFullHexZero() (gas: 53154) +LibParseOperandSingleFullTest:testOperandSingleFullLeadingAndTrailingWhitespace() (gas: 53852) +LibParseOperandSingleFullTest:testOperandSingleFullLeadingWhitespace() (gas: 54464) +LibParseOperandSingleFullTest:testOperandSingleFullMultiple() (gas: 47603) +LibParseOperandSingleFullTest:testOperandSingleFullOne() (gas: 54115) +LibParseOperandSingleFullTest:testOperandSingleFullTrailingWhitespace() (gas: 54508) +LibParseOperandSingleFullTest:testOperandSingleFullUint16Max() (gas: 55225) LibParseOperandSingleFullTest:testOperandSingleFullUint16MaxOverflow() (gas: 47929) -LibParseOperandSingleFullTest:testOperandSingleFullUnclosed() (gas: 46301) -LibParseOperandSingleFullTest:testOperandSingleFullUnopened() (gas: 44555) -LibParseOperandSingleFullTest:testOperandSingleFullZero() (gas: 52418) -LibParseParseWordTest:testLibParseParseWordEnd(uint256) (runs: 2051, μ: 6260, ~: 6277) -LibParseParseWordTest:testLibParseParseWordExamples() (gas: 20077) -LibParseParseWordTest:testLibParseParseWordReferenceImplementation(bytes,uint256) (runs: 2049, μ: 5463, ~: 5243) -LibParseParseWordTest:testLibParseParseWordTooLong(bytes) (runs: 2050, μ: 9739, ~: 9682) +LibParseOperandSingleFullTest:testOperandSingleFullUnclosed() (gas: 46366) +LibParseOperandSingleFullTest:testOperandSingleFullUnopened() (gas: 44533) +LibParseOperandSingleFullTest:testOperandSingleFullZero() (gas: 54059) +LibParseParseWordTest:testLibParseParseWordEnd(uint256) (runs: 2051, μ: 9470, ~: 9471) +LibParseParseWordTest:testLibParseParseWordExamples() (gas: 26926) +LibParseParseWordTest:testLibParseParseWordReferenceImplementation(bytes,uint256) (runs: 2049, μ: 6474, ~: 6254) +LibParseParseWordTest:testLibParseParseWordTooLong(bytes) (runs: 2050, μ: 9694, ~: 9627) LibParsePragmaKeywordTest:testPragmaKeywordNoWhitespace(uint256,string) (runs: 2051, μ: 8923, ~: 8888) -LibParsePragmaKeywordTest:testPragmaKeywordNoop((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes,uint256[],uint256,bytes,bytes),string) (runs: 2051, μ: 13715, ~: 13577) -LibParsePragmaKeywordTest:testPragmaKeywordParseSubParser(string,address,uint256,string) (runs: 2051, μ: 185162, ~: 180097) -LibParsePragmaKeywordTest:testPragmaKeywordParseSubParserCoupleOfAddresses(string,string,address,address,uint256,string) (runs: 2050, μ: 367258, ~: 365937) -LibParsePragmaKeywordTest:testPragmaKeywordParseSubParserSpecificStrings() (gas: 232449) -LibParsePragmaKeywordTest:testPragmaKeywordWhitespaceNoHex(uint256,string) (runs: 2051, μ: 19941, ~: 17167) +LibParsePragmaKeywordTest:testPragmaKeywordNoop((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes,uint256[],uint256,bytes,bytes),string) (runs: 2051, μ: 16580, ~: 16443) +LibParsePragmaKeywordTest:testPragmaKeywordParseSubParser(string,address,uint256,string) (runs: 2051, μ: 185994, ~: 180846) +LibParsePragmaKeywordTest:testPragmaKeywordParseSubParserCoupleOfAddresses(string,string,address,address,uint256,string) (runs: 2051, μ: 368977, ~: 366881) +LibParsePragmaKeywordTest:testPragmaKeywordParseSubParserSpecificStrings() (gas: 252034) +LibParsePragmaKeywordTest:testPragmaKeywordWhitespaceNoHex(uint256,string) (runs: 2051, μ: 20261, ~: 17493) LibParseSingleLHSIgnoredGasTest:testParseGasSingleLHSIgnored00() (gas: 8317) -LibParseSingleLHSIgnoredGasTest:testParseGasSingleLHSIgnored01() (gas: 8401) +LibParseSingleLHSIgnoredGasTest:testParseGasSingleLHSIgnored01() (gas: 8379) LibParseSingleLHSIgnoredGasTest:testParseGasSingleLHSIgnored02() (gas: 8465) LibParseSingleLHSIgnoredGasTest:testParseGasSingleLHSIgnored03() (gas: 8548) -LibParseSingleLHSIgnoredGasTest:testParseGasSingleLHSIgnored04() (gas: 8610) +LibParseSingleLHSIgnoredGasTest:testParseGasSingleLHSIgnored04() (gas: 8653) LibParseSingleLHSIgnoredGasTest:testParseGasSingleLHSIgnored05() (gas: 8694) LibParseSingleLHSIgnoredGasTest:testParseGasSingleLHSIgnored06() (gas: 8822) LibParseSingleLHSIgnoredGasTest:testParseGasSingleLHSIgnored07() (gas: 8863) LibParseSingleLHSIgnoredGasTest:testParseGasSingleLHSIgnored08() (gas: 8944) -LibParseSingleLHSIgnoredGasTest:testParseGasSingleLHSIgnored09() (gas: 9029) +LibParseSingleLHSIgnoredGasTest:testParseGasSingleLHSIgnored09() (gas: 9052) LibParseSingleLHSNamedGasTest:testParseGasSingleLHSNamed00() (gas: 9018) LibParseSingleLHSNamedGasTest:testParseGasSingleLHSNamed01() (gas: 9119) LibParseSingleLHSNamedGasTest:testParseGasSingleLHSNamed02() (gas: 9157) @@ -1016,7 +480,7 @@ LibParseSingleLHSNamedGasTest:testParseGasSingleLHSNamed10() (gas: 9826) LibParseSingleLHSNamedGasTest:testParseGasSingleLHSNamed11() (gas: 9886) LibParseSingleLHSNamedGasTest:testParseGasSingleLHSNamed12() (gas: 10010) LibParseSingleLHSNamedGasTest:testParseGasSingleLHSNamed13() (gas: 10071) -LibParseSingleLHSNamedGasTest:testParseGasSingleLHSNamed14() (gas: 10129) +LibParseSingleLHSNamedGasTest:testParseGasSingleLHSNamed14() (gas: 10151) LibParseSingleLHSNamedGasTest:testParseGasSingleLHSNamed15() (gas: 10209) LibParseSingleLHSNamedGasTest:testParseGasSingleLHSNamed16() (gas: 10335) LibParseSingleLHSNamedGasTest:testParseGasSingleLHSNamed17() (gas: 10394) @@ -1064,88 +528,88 @@ LibParseSingleRHSNamedGasTest:testParseGasRHS27() (gas: 119391) LibParseSingleRHSNamedGasTest:testParseGasRHS28() (gas: 119495) LibParseSingleRHSNamedGasTest:testParseGasRHS29() (gas: 119586) LibParseSingleRHSNamedGasTest:testParseGasRHS30() (gas: 119648) -LibParseSourceInputsTest:testParseSourceInputsEmptyLinePrefix() (gas: 46901) -LibParseSourceInputsTest:testParseSourceInputsMultipleLines() (gas: 49638) -LibParseSourceInputsTest:testParseSourceInputsSingle() (gas: 46878) -LibParseStackNameTest:testPushAndRetrieveStackNameDouble((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes,uint256[],uint256,bytes,bytes),bytes32,bytes32) (runs: 2051, μ: 18162, ~: 18156) -LibParseStackNameTest:testPushAndRetrieveStackNameDoubleIdentical((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes,uint256[],uint256,bytes,bytes),bytes32) (runs: 2051, μ: 14183, ~: 14364) -LibParseStackNameTest:testPushAndRetrieveStackNameMany((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes,uint256[],uint256,bytes,bytes),uint256) (runs: 2051, μ: 249155, ~: 197148) -LibParseStackNameTest:testPushAndRetrieveStackNameSingle((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes,uint256[],uint256,bytes,bytes),bytes32) (runs: 2051, μ: 14039, ~: 14220) -LibParseStateConstantValueBloomTest:testConstantValueBloom(uint256) (runs: 2051, μ: 520, ~: 520) -LibParseStateConstantValueBloomTest:testConstantValueBloomAllBits() (gas: 42289) -LibParseStateConstantValueBloomTest:testConstantValueBloomSingleBit(uint256) (runs: 2051, μ: 580, ~: 580) -LibParseStateExportSubParsersTest:testExportSubParsers((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes,uint256[],uint256,bytes,bytes),address[]) (runs: 2051, μ: 105412, ~: 105849) -LibParseStateNewActiveSourcePointerTest:testAlignedOldPointer(uint256,uint256) (runs: 2051, μ: 7098, ~: 7226) -LibParseStateNewActiveSourcePointerTest:testPostUnalignedNewPointer(uint256) (runs: 2051, μ: 1330, ~: 1330) -LibParseStateNewActiveSourcePointerTest:testPreUnalignedNewPointer() (gas: 1650) -LibParseStateNewActiveSourcePointerTest:testZeroOldPointer(bytes) (runs: 2051, μ: 1010, ~: 1007) -LibParseStatePushConstantValueTest:testPushConstantValueEmpty(bytes,bytes,bytes,bytes) (runs: 2051, μ: 3193, ~: 3190) -LibParseStatePushConstantValueTest:testPushConstantValueMany(uint256[]) (runs: 2051, μ: 143268, ~: 143886) -LibParseStatePushConstantValueTest:testPushConstantValueSingle(uint256) (runs: 2051, μ: 2472, ~: 2472) -LibParseStatePushSubParserTest:testPushSubParserList((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes,uint256[],uint256,bytes,bytes),address[]) (runs: 2051, μ: 92507, ~: 92637) -LibParseStatePushSubParserTest:testPushSubParserMultiple((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes,uint256[],uint256,bytes,bytes),address,address,address) (runs: 2051, μ: 12955, ~: 12954) -LibParseStatePushSubParserTest:testPushSubParserOverflow((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes,uint256[],uint256,bytes,bytes),uint256) (runs: 2051, μ: 19464, ~: 19246) -LibParseStatePushSubParserTest:testPushSubParserZero((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes,uint256[],uint256,bytes,bytes),address) (runs: 2051, μ: 12563, ~: 12522) +LibParseSourceInputsTest:testParseSourceInputsEmptyLinePrefix() (gas: 49254) +LibParseSourceInputsTest:testParseSourceInputsMultipleLines() (gas: 51991) +LibParseSourceInputsTest:testParseSourceInputsSingle() (gas: 49231) +LibParseStackNameTest:testPushAndRetrieveStackNameDouble((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes,uint256[],uint256,bytes,bytes),bytes32,bytes32) (runs: 2051, μ: 20722, ~: 20699) +LibParseStackNameTest:testPushAndRetrieveStackNameDoubleIdentical((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes,uint256[],uint256,bytes,bytes),bytes32) (runs: 2051, μ: 17958, ~: 18140) +LibParseStackNameTest:testPushAndRetrieveStackNameMany((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes,uint256[],uint256,bytes,bytes),uint256) (runs: 2051, μ: 318821, ~: 260634) +LibParseStackNameTest:testPushAndRetrieveStackNameSingle((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes,uint256[],uint256,bytes,bytes),bytes32) (runs: 2051, μ: 17836, ~: 18018) +LibParseStateConstantValueBloomTest:testConstantValueBloom(uint256) (runs: 2051, μ: 3363, ~: 3363) +LibParseStateConstantValueBloomTest:testConstantValueBloomAllBits() (gas: 45132) +LibParseStateConstantValueBloomTest:testConstantValueBloomSingleBit(uint256) (runs: 2051, μ: 3423, ~: 3423) +LibParseStateExportSubParsersTest:testExportSubParsers((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes,uint256[],uint256,bytes,bytes),address[]) (runs: 2051, μ: 152089, ~: 152434) +LibParseStateNewActiveSourcePointerTest:testAlignedOldPointer(uint256,uint256) (runs: 2051, μ: 13310, ~: 13428) +LibParseStateNewActiveSourcePointerTest:testPostUnalignedNewPointer(uint256) (runs: 2051, μ: 7131, ~: 7131) +LibParseStateNewActiveSourcePointerTest:testPreUnalignedNewPointer() (gas: 9152) +LibParseStateNewActiveSourcePointerTest:testZeroOldPointer(bytes) (runs: 2051, μ: 4787, ~: 4784) +LibParseStatePushConstantValueTest:testPushConstantValueEmpty(bytes,bytes,bytes,bytes) (runs: 2051, μ: 6365, ~: 6362) +LibParseStatePushConstantValueTest:testPushConstantValueMany(uint256[]) (runs: 2051, μ: 227197, ~: 228479) +LibParseStatePushConstantValueTest:testPushConstantValueSingle(uint256) (runs: 2051, μ: 6968, ~: 6968) +LibParseStatePushSubParserTest:testPushSubParserList((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes,uint256[],uint256,bytes,bytes),address[]) (runs: 2051, μ: 135686, ~: 136275) +LibParseStatePushSubParserTest:testPushSubParserMultiple((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes,uint256[],uint256,bytes,bytes),address,address,address) (runs: 2051, μ: 16854, ~: 16855) +LibParseStatePushSubParserTest:testPushSubParserOverflow((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes,uint256[],uint256,bytes,bytes),uint256) (runs: 2051, μ: 19411, ~: 19199) +LibParseStatePushSubParserTest:testPushSubParserZero((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes,uint256[],uint256,bytes,bytes),address) (runs: 2051, μ: 15713, ~: 15673) LibParseUnclosedLeftParenTest:testParseUnclosedLeftParen() (gas: 44936) LibParseUnclosedLeftParenTest:testParseUnclosedLeftParenNested() (gas: 64305) -LibParseUnclosedLeftParenTest:testParseUnclosedLeftParenNested2() (gas: 65841) +LibParseUnclosedLeftParenTest:testParseUnclosedLeftParenNested2() (gas: 65819) LibParseUnclosedLeftParenTest:testParseUnclosedLeftParenNested3() (gas: 75373) -LibParseUnexpectedLHSTest:testParseUnexpectedLHSBadIgnoredTail(uint8) (runs: 2051, μ: 42692, ~: 42693) -LibParseUnexpectedLHSTest:testParseUnexpectedLHSBadNamedTail(uint8,bytes) (runs: 2051, μ: 48652, ~: 48699) -LibParseUnexpectedLHSTest:testParseUnexpectedLHSEOF() (gas: 41761) -LibParseUnexpectedLHSTest:testParseUnexpectedLHSEOL() (gas: 41717) -LibParseUnexpectedLHSTest:testParseUnexpectedLHSSingleChar(uint8) (runs: 2051, μ: 42307, ~: 42307) +LibParseUnexpectedLHSTest:testParseUnexpectedLHSBadIgnoredTail(uint8) (runs: 2051, μ: 42670, ~: 42671) +LibParseUnexpectedLHSTest:testParseUnexpectedLHSBadNamedTail(uint8,bytes) (runs: 2051, μ: 48704, ~: 48743) +LibParseUnexpectedLHSTest:testParseUnexpectedLHSEOF() (gas: 41739) +LibParseUnexpectedLHSTest:testParseUnexpectedLHSEOL() (gas: 41740) +LibParseUnexpectedLHSTest:testParseUnexpectedLHSSingleChar(uint8) (runs: 2051, μ: 42285, ~: 42285) LibParseUnexpectedLHSTest:testParseUnexpectedLHSUnderscoreTail() (gas: 42735) LibParseUnexpectedRHSTest:testParseUnexpectedRHS(uint8) (runs: 2051, μ: 42617, ~: 42617) LibParseUnexpectedRHSTest:testParseUnexpectedRHSLeftParen() (gas: 42109) LibParseUnexpectedRightParenTest:testParseUnexpectedRightParen() (gas: 41612) -LibParseUnexpectedRightParenTest:testParseUnexpectedRightParenNested() (gas: 47284) -LibSubParseSubParserExternTest:testLibSubParseSubParserExtern(address,uint8,uint8,uint8,uint16,uint8) (runs: 2051, μ: 7378, ~: 7310) -LibSubParseSubParserExternTest:testLibSubParseSubParserExternConstantsHeightOverflow(address,uint256,uint8,uint8,uint16,uint8) (runs: 2051, μ: 7966, ~: 7709) -RainterpreterExpressionDeployerNPE2DeployCheckTest:testRainterpreterExpressionDeployerDeployNoEIP1820() (gas: 9715204) -RainterpreterExpressionDeployerNPE2DescribedByMetaV1Test:testRainterpreterExpressionDeployerNPE2DescribedByMetaV1Happy() (gas: 9728975) -RainterpreterExpressionDeployerNPE2IERC165Test:testRainterpreterExpressionDeployerNPE2IERC165(bytes4) (runs: 2051, μ: 9722020, ~: 9722020) -RainterpreterExpressionDeployerNPE2MetaTest:testRainterpreterExpressionDeployerNPE2ExpectedConstructionMetaHash() (gas: 3338) -RainterpreterNPE2IERC165Test:testRainterpreterNPE2IERC165(bytes4) (runs: 2051, μ: 4193017, ~: 4193017) -RainterpreterNPE2PointersTest:testOpcodeFunctionPointers() (gas: 4225125) -RainterpreterNPE2StateOverlayTest:testStateOverlayGet() (gas: 48062) -RainterpreterNPE2StateOverlayTest:testStateOverlaySet() (gas: 78847) -RainterpreterNPE2Test:testRainterpreterNPE2OddFunctionPointersLength() (gas: 523) -RainterpreterParserNPE2IERC165Test:testRainterpreterParserNPE2IERC165(bytes4) (runs: 2051, μ: 3792295, ~: 3792295) -RainterpreterParserNPE2ParserPragma:testParsePragmaNoPragma() (gas: 18941619) -RainterpreterParserNPE2ParserPragma:testParsePragmaSinglePragma() (gas: 11416214) -RainterpreterParserNPE2ParserPragma:testParsePragmaWithInterstitial() (gas: 11419491) -RainterpreterParserNPE2PointersTest:testLiteralParserFunctionPointers() (gas: 3789194) -RainterpreterParserNPE2PointersTest:testOperandHandlerFunctionPointers() (gas: 3823132) -RainterpreterParserNPE2PointersTest:testParserParseMeta() (gas: 5548781) -RainterpreterReferenceExternNPE2ContextRainlenTest:testRainterpreterReferenceExterNPE2ContextRainlenHappy() (gas: 1737505) -RainterpreterReferenceExternNPE2ContextSenderTest:testRainterpreterReferenceExterNPE2ContextContractHappy() (gas: 1737112) -RainterpreterReferenceExternNPE2ContextSenderTest:testRainterpreterReferenceExterNPE2ContextSenderHappy() (gas: 1735808) -RainterpreterReferenceExternNPE2DescribedByMetaV1:testRainterpreterReferenceExternNPE2DescribedByMetaV1Happy() (gas: 1662362) -RainterpreterReferenceExternNPE2IERC165Test:testRainterpreterReferenceExternNPE2IERC165(bytes4) (runs: 2051, μ: 1666203, ~: 1666203) -RainterpreterReferenceExternNPE2IntIncTest:testRainterpreterReferenceExternNPE2IntIncHappySugared() (gas: 1758051) -RainterpreterReferenceExternNPE2IntIncTest:testRainterpreterReferenceExternNPE2IntIncHappyUnsugared() (gas: 1750384) -RainterpreterReferenceExternNPE2IntIncTest:testRainterpreterReferenceExternNPE2IntIncIntegrity(uint256,uint256,uint256) (runs: 2051, μ: 464, ~: 464) -RainterpreterReferenceExternNPE2IntIncTest:testRainterpreterReferenceExternNPE2IntIncRun(uint256,uint256[]) (runs: 2050, μ: 129377, ~: 119433) -RainterpreterReferenceExternNPE2IntIncTest:testRainterpreterReferenceExternNPE2IntIncSubParseKnownWord(uint16,bytes1) (runs: 2051, μ: 1671119, ~: 1671395) -RainterpreterReferenceExternNPE2IntIncTest:testRainterpreterReferenceExternNPE2IntIncSubParseUnknownWord(uint16,bytes1,bytes) (runs: 2048, μ: 1672026, ~: 1671805) -RainterpreterReferenceExternNPE2PointersTest:testIntegrityFunctionPointers() (gas: 1659872) -RainterpreterReferenceExternNPE2PointersTest:testOpcodeFunctionPointers() (gas: 1659871) -RainterpreterReferenceExternNPE2PointersTest:testSubParserFunctionPointers() (gas: 1661828) -RainterpreterReferenceExternNPE2PointersTest:testSubParserLiteralParsers() (gas: 1659914) -RainterpreterReferenceExternNPE2PointersTest:testSubParserOperandParsers() (gas: 1661811) -RainterpreterReferenceExternNPE2PointersTest:testSubParserParseMeta() (gas: 28150) -RainterpreterReferenceExternNPE2RepeatTest:testRainterpreterReferenceExternNPE2RepeatHappy() (gas: 1787613) -RainterpreterReferenceExternNPE2StackOperandTest:testRainterpreterReferenceExternNPE2StackOperandSingle(uint256) (runs: 2051, μ: 1744778, ~: 1745180) -RainterpreterReferenceExternNPE2UnknownWordTest:testRainterpreterReferenceExternNPE2UnknownWord() (gas: 1710356) -RainterpreterStoreNPE2IERC165Test:testRainterpreterStoreNPE2IERC165(bytes4) (runs: 2051, μ: 228974, ~: 228974) -RainterpreterStoreNPE2Test:testRainterpreterStoreNPE2IERC165(uint32) (runs: 2051, μ: 229013, ~: 229013) -RainterpreterStoreNPE2Test:testRainterpreterStoreNPE2SetGetDupes((uint256,uint256[11])[]) (runs: 2049, μ: 1494105, ~: 1451402) -RainterpreterStoreNPE2Test:testRainterpreterStoreNPE2SetGetNoDupesMany((uint256,uint256[])[]) (runs: 2051, μ: 3500507, ~: 3330987) -RainterpreterStoreNPE2Test:testRainterpreterStoreNPE2SetGetNoDupesSingle(uint256,uint256[]) (runs: 2051, μ: 1911604, ~: 1912618) -RainterpreterStoreNPE2Test:testRainterpreterStoreNPE2SetOddLength(uint256,uint256[]) (runs: 2050, μ: 248686, ~: 248672) -TestLibParseLiteralDecimalUnsafeStrToInt:testUnsafeStrToIntOverflowVeryLarge(uint256,uint256,uint8) (runs: 2050, μ: 43085, ~: 37910) -TestLibParseLiteralDecimalUnsafeStrToInt:testUnsafeStrToIntRoundTrip(uint256,uint8) (runs: 2051, μ: 29428, ~: 23371) -TestLibParseLiteralDecimalUnsafeStrToSignedInt:testUnsafeStrToSignedIntOverflowNegative(uint256,uint8) (runs: 2051, μ: 46453, ~: 36895) -TestLibParseLiteralDecimalUnsafeStrToSignedInt:testUnsafeStrToSignedIntOverflowPositive(uint256,uint8) (runs: 2051, μ: 46481, ~: 36924) -TestLibParseLiteralDecimalUnsafeStrToSignedInt:testUnsafeStrToSignedIntRoundTrip(uint256,uint8,bool) (runs: 2051, μ: 33034, ~: 27120) \ No newline at end of file +LibParseUnexpectedRightParenTest:testParseUnexpectedRightParenNested() (gas: 47262) +LibSubParseSubParserExternTest:testLibSubParseSubParserExtern(address,uint8,uint8,uint8,uint16,uint8) (runs: 2051, μ: 13169, ~: 13112) +LibSubParseSubParserExternTest:testLibSubParseSubParserExternConstantsHeightOverflow(address,uint256,uint8,uint8,uint16,uint8) (runs: 2051, μ: 7949, ~: 7689) +RainterpreterExpressionDeployerNPE2DeployCheckTest:testRainterpreterExpressionDeployerDeployNoEIP1820() (gas: 6664197) +RainterpreterExpressionDeployerNPE2DescribedByMetaV1Test:testRainterpreterExpressionDeployerNPE2DescribedByMetaV1Happy() (gas: 6671827) +RainterpreterExpressionDeployerNPE2IERC165Test:testRainterpreterExpressionDeployerNPE2IERC165(bytes4) (runs: 2051, μ: 6671638, ~: 6671638) +RainterpreterExpressionDeployerNPE2MetaTest:testRainterpreterExpressionDeployerNPE2ExpectedConstructionMetaHash() (gas: 6178) +RainterpreterNPE2IERC165Test:testRainterpreterNPE2IERC165(bytes4) (runs: 2051, μ: 1518943, ~: 1518943) +RainterpreterNPE2PointersTest:testOpcodeFunctionPointers() (gas: 1519849) +RainterpreterNPE2StateOverlayTest:testStateOverlayGet() (gas: 52180) +RainterpreterNPE2StateOverlayTest:testStateOverlaySet() (gas: 83231) +RainterpreterNPE2Test:testRainterpreterNPE2OddFunctionPointersLength() (gas: 3659) +RainterpreterParserNPE2IERC165Test:testRainterpreterParserNPE2IERC165(bytes4) (runs: 2051, μ: 3549963, ~: 3549963) +RainterpreterParserNPE2ParserPragma:testParsePragmaNoPragma() (gas: 17723855) +RainterpreterParserNPE2ParserPragma:testParsePragmaSinglePragma() (gas: 10685557) +RainterpreterParserNPE2ParserPragma:testParsePragmaWithInterstitial() (gas: 10688834) +RainterpreterParserNPE2PointersTest:testLiteralParserFunctionPointers() (gas: 3547377) +RainterpreterParserNPE2PointersTest:testOperandHandlerFunctionPointers() (gas: 3549326) +RainterpreterParserNPE2PointersTest:testParserParseMeta() (gas: 73264) +RainterpreterReferenceExternNPE2ContextRainlenTest:testRainterpreterReferenceExterNPE2ContextRainlenHappy() (gas: 1740865) +RainterpreterReferenceExternNPE2ContextSenderTest:testRainterpreterReferenceExterNPE2ContextContractHappy() (gas: 1740472) +RainterpreterReferenceExternNPE2ContextSenderTest:testRainterpreterReferenceExterNPE2ContextSenderHappy() (gas: 1739169) +RainterpreterReferenceExternNPE2DescribedByMetaV1:testRainterpreterReferenceExternNPE2DescribedByMetaV1Happy() (gas: 1662715) +RainterpreterReferenceExternNPE2IERC165Test:testRainterpreterReferenceExternNPE2IERC165(bytes4) (runs: 2051, μ: 1667797, ~: 1667797) +RainterpreterReferenceExternNPE2IntIncTest:testRainterpreterReferenceExternNPE2IntIncHappySugared() (gas: 1762085) +RainterpreterReferenceExternNPE2IntIncTest:testRainterpreterReferenceExternNPE2IntIncHappyUnsugared() (gas: 1756046) +RainterpreterReferenceExternNPE2IntIncTest:testRainterpreterReferenceExternNPE2IntIncIntegrity(uint256,uint256,uint256) (runs: 2051, μ: 3618, ~: 3618) +RainterpreterReferenceExternNPE2IntIncTest:testRainterpreterReferenceExternNPE2IntIncRun(uint256,uint256[]) (runs: 2049, μ: 167440, ~: 153965) +RainterpreterReferenceExternNPE2IntIncTest:testRainterpreterReferenceExternNPE2IntIncSubParseKnownWord(uint16,bytes1) (runs: 2051, μ: 1676572, ~: 1676836) +RainterpreterReferenceExternNPE2IntIncTest:testRainterpreterReferenceExternNPE2IntIncSubParseUnknownWord(uint16,bytes1,bytes) (runs: 2049, μ: 1672960, ~: 1672739) +RainterpreterReferenceExternNPE2PointersTest:testIntegrityFunctionPointers() (gas: 1662748) +RainterpreterReferenceExternNPE2PointersTest:testOpcodeFunctionPointers() (gas: 1662813) +RainterpreterReferenceExternNPE2PointersTest:testSubParserFunctionPointers() (gas: 1663258) +RainterpreterReferenceExternNPE2PointersTest:testSubParserLiteralParsers() (gas: 1662790) +RainterpreterReferenceExternNPE2PointersTest:testSubParserOperandParsers() (gas: 1663263) +RainterpreterReferenceExternNPE2PointersTest:testSubParserParseMeta() (gas: 21933) +RainterpreterReferenceExternNPE2RepeatTest:testRainterpreterReferenceExternNPE2RepeatHappy() (gas: 1793173) +RainterpreterReferenceExternNPE2StackOperandTest:testRainterpreterReferenceExternNPE2StackOperandSingle(uint256) (runs: 2051, μ: 1748101, ~: 1748206) +RainterpreterReferenceExternNPE2UnknownWordTest:testRainterpreterReferenceExternNPE2UnknownWord() (gas: 1709623) +RainterpreterStoreNPE2IERC165Test:testRainterpreterStoreNPE2IERC165(bytes4) (runs: 2051, μ: 229944, ~: 229944) +RainterpreterStoreNPE2Test:testRainterpreterStoreNPE2IERC165(uint32) (runs: 2051, μ: 229961, ~: 229961) +RainterpreterStoreNPE2Test:testRainterpreterStoreNPE2SetGetDupes((uint256,uint256[11])[]) (runs: 2049, μ: 1510361, ~: 1466284) +RainterpreterStoreNPE2Test:testRainterpreterStoreNPE2SetGetNoDupesMany((uint256,uint256[])[]) (runs: 2051, μ: 3516617, ~: 3349165) +RainterpreterStoreNPE2Test:testRainterpreterStoreNPE2SetGetNoDupesSingle(uint256,uint256[]) (runs: 2051, μ: 1936799, ~: 1950186) +RainterpreterStoreNPE2Test:testRainterpreterStoreNPE2SetOddLength(uint256,uint256[]) (runs: 2049, μ: 248673, ~: 248662) +TestLibParseLiteralDecimalUnsafeStrToInt:testUnsafeStrToIntOverflowVeryLarge(uint256,uint256,uint8) (runs: 2051, μ: 43048, ~: 37804) +TestLibParseLiteralDecimalUnsafeStrToInt:testUnsafeStrToIntRoundTrip(uint256,uint8) (runs: 2051, μ: 28860, ~: 23189) +TestLibParseLiteralDecimalUnsafeStrToSignedInt:testUnsafeStrToSignedIntOverflowNegative(uint256,uint8) (runs: 2051, μ: 46324, ~: 37118) +TestLibParseLiteralDecimalUnsafeStrToSignedInt:testUnsafeStrToSignedIntOverflowPositive(uint256,uint8) (runs: 2051, μ: 46351, ~: 37147) +TestLibParseLiteralDecimalUnsafeStrToSignedInt:testUnsafeStrToSignedIntRoundTrip(uint256,uint8,bool) (runs: 2051, μ: 36006, ~: 29677) \ No newline at end of file diff --git a/.github/workflows/rainix.yaml b/.github/workflows/rainix.yaml index 754a4a4a0..9124547c2 100644 --- a/.github/workflows/rainix.yaml +++ b/.github/workflows/rainix.yaml @@ -18,6 +18,9 @@ jobs: # We don't need to do rust static analysis on multiple platforms - os: ubuntu-latest task: rainix-rs-static + # We don't need to do build for wasm32 on multiple platforms + - os: ubuntu-latest + task: test-wasm-build fail-fast: false runs-on: ${{ matrix.os }} env: diff --git a/.gitmodules b/.gitmodules index 4f5d4828b..009d12055 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,18 +1,6 @@ -[submodule "lib/rain.lib.typecast"] - path = lib/rain.lib.typecast - url = https://github.com/rainprotocol/rain.lib.typecast [submodule "lib/rain.metadata"] path = lib/rain.metadata url = https://github.com/rainprotocol/rain.metadata -[submodule "lib/rain.datacontract"] - path = lib/rain.datacontract - url = https://github.com/rainprotocol/rain.datacontract -[submodule "lib/forge-std"] - path = lib/forge-std - url = https://github.com/foundry-rs/forge-std -[submodule "lib/rain.erc1820"] - path = lib/rain.erc1820 - url = https://github.com/rainprotocol/rain.erc1820 [submodule "lib/rain.lib.memkv"] path = lib/rain.lib.memkv url = https://github.com/rainprotocol/rain.lib.memkv @@ -25,24 +13,15 @@ [submodule "lib/rain.math.fixedpoint"] path = lib/rain.math.fixedpoint url = https://github.com/rainprotocol/rain.math.fixedpoint -[submodule "lib/openzeppelin-contracts"] - path = lib/openzeppelin-contracts - url = https://github.com/OpenZeppelin/openzeppelin-contracts [submodule "lib/rain.chainlink"] path = lib/rain.chainlink url = https://github.com/rainprotocol/rain.chainlink -[submodule "lib/rain.solmem"] - path = lib/rain.solmem - url = https://github.com/rainlanguage/rain.solmem [submodule "lib/rain.intorastring"] path = lib/rain.intorastring url = https://github.com/rainlanguage/rain.intorastring [submodule "lib/rain.interpreter.interface"] path = lib/rain.interpreter.interface url = https://github.com/rainlanguage/rain.interpreter.interface -[submodule "lib/rain.math.binary"] - path = lib/rain.math.binary - url = https://github.com/rainlanguage/rain.math.binary [submodule "lib/rain.sol.codegen"] path = lib/rain.sol.codegen url = https://github.com/rainlanguage/rain.sol.codegen diff --git a/Cargo.lock b/Cargo.lock index 399dd1582..1abb99423 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14,9 +14,9 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ "gimli", ] @@ -45,6 +45,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", + "getrandom", "once_cell", "version_check", "zerocopy", @@ -65,11 +66,27 @@ version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +[[package]] +name = "alloy" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ba1c79677c9ce51c8d45e20845b05e6fb070ea2c863fba03ad6af2c778474bd" +dependencies = [ + "alloy-consensus", + "alloy-core", + "alloy-eips", + "alloy-genesis", + "alloy-provider", + "alloy-rpc-client", + "alloy-serde", + "alloy-transport-http", +] + [[package]] name = "alloy-chains" -version = "0.1.17" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe6c2674230e94ea98767550b02853bf7024b46f784827be95acfc5f5f1a445f" +checksum = "5b515e82c8468ddb6ff8db21c78a5997442f113fd8471fd5b2261b2602dd0c67" dependencies = [ "num_enum", "serde", @@ -78,36 +95,49 @@ dependencies = [ [[package]] name = "alloy-consensus" -version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=8808d21#8808d21677ed9a05ff04000ac7f4acdd2fde94e3" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da374e868f54c7f4ad2ad56829827badca388efd645f8cf5fccc61c2b5343504" dependencies = [ "alloy-eips", - "alloy-primitives 0.7.1", + "alloy-primitives 0.7.7", "alloy-rlp", "alloy-serde", "c-kzg", "serde", - "sha2", ] [[package]] name = "alloy-contract" -version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=8808d21#8808d21677ed9a05ff04000ac7f4acdd2fde94e3" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dc6957ff706f9e5f6fd42f52a93e4bce476b726c92d077b348de28c4a76730c" dependencies = [ - "alloy-dyn-abi 0.7.1", - "alloy-json-abi 0.7.1", + "alloy-dyn-abi 0.7.7", + "alloy-json-abi 0.7.7", "alloy-network", - "alloy-primitives 0.7.1", + "alloy-primitives 0.7.7", "alloy-provider", - "alloy-rpc-types", - "alloy-sol-types 0.7.1", + "alloy-rpc-types-eth", + "alloy-sol-types 0.7.7", "alloy-transport", "futures", "futures-util", "thiserror", ] +[[package]] +name = "alloy-core" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "529fc6310dc1126c8de51c376cbc59c79c7f662bd742be7dc67055d5421a81b4" +dependencies = [ + "alloy-dyn-abi 0.7.7", + "alloy-json-abi 0.7.7", + "alloy-primitives 0.7.7", + "alloy-sol-types 0.7.7", +] + [[package]] name = "alloy-dyn-abi" version = "0.6.4" @@ -122,19 +152,19 @@ dependencies = [ "itoa", "serde", "serde_json", - "winnow 0.6.7", + "winnow 0.6.18", ] [[package]] name = "alloy-dyn-abi" -version = "0.7.1" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ab339ca7b4ea9115f0578c941abc80a171edf8e5eadd01e6c4237b68db8083" +checksum = "413902aa18a97569e60f679c23f46a18db1656d87ab4d4e49d0e1e52042f66df" dependencies = [ - "alloy-json-abi 0.7.1", - "alloy-primitives 0.7.1", - "alloy-sol-type-parser 0.7.1", - "alloy-sol-types 0.7.1", + "alloy-json-abi 0.7.7", + "alloy-primitives 0.7.7", + "alloy-sol-type-parser 0.7.7", + "alloy-sol-types 0.7.7", "arbitrary", "const-hex", "derive_arbitrary", @@ -143,34 +173,34 @@ dependencies = [ "proptest", "serde", "serde_json", - "winnow 0.6.7", + "winnow 0.6.18", ] [[package]] name = "alloy-eips" -version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=8808d21#8808d21677ed9a05ff04000ac7f4acdd2fde94e3" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f76ecab54890cdea1e4808fc0891c7e6cfcf71fe1a9fe26810c7280ef768f4ed" dependencies = [ - "alloy-primitives 0.7.1", + "alloy-primitives 0.7.7", "alloy-rlp", "alloy-serde", "c-kzg", "once_cell", "serde", + "sha2", ] [[package]] name = "alloy-ethers-typecast" version = "0.2.0" -source = "git+https://github.com/rainlanguage/alloy-ethers-typecast?rev=cbdedb77fb1994a18ceb47e72786f8b32b670669#cbdedb77fb1994a18ceb47e72786f8b32b670669" +source = "git+https://github.com/rainlanguage/alloy-ethers-typecast?rev=0881930a22e84db49ba955c5b88e790e1266ac66#0881930a22e84db49ba955c5b88e790e1266ac66" dependencies = [ - "alloy-dyn-abi 0.6.4", - "alloy-json-abi 0.6.4", - "alloy-primitives 0.6.4", - "alloy-sol-types 0.6.4", + "alloy", "async-trait", "derive_builder 0.12.0", "ethers", + "getrandom", "once_cell", "rain-error-decoding", "reqwest 0.11.27", @@ -183,10 +213,11 @@ dependencies = [ [[package]] name = "alloy-genesis" -version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=8808d21#8808d21677ed9a05ff04000ac7f4acdd2fde94e3" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bca15afde1b6d15e3fc1c97421262b1bbb37aee45752e3c8b6d6f13f776554ff" dependencies = [ - "alloy-primitives 0.7.1", + "alloy-primitives 0.7.7", "alloy-serde", "serde", ] @@ -205,22 +236,23 @@ dependencies = [ [[package]] name = "alloy-json-abi" -version = "0.7.1" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44294729c145cf7ae65feab544b5b81fb2bb7e2fd060214842eb3989a1e9d882" +checksum = "bc05b04ac331a9f07e3a4036ef7926e49a8bf84a99a1ccfc7e2ab55a5fcbb372" dependencies = [ - "alloy-primitives 0.7.1", - "alloy-sol-type-parser 0.7.1", + "alloy-primitives 0.7.7", + "alloy-sol-type-parser 0.7.7", "serde", "serde_json", ] [[package]] name = "alloy-json-rpc" -version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=8808d21#8808d21677ed9a05ff04000ac7f4acdd2fde94e3" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d6f34930b7e3e2744bcc79056c217f00cb2abb33bc5d4ff88da7623c5bb078b" dependencies = [ - "alloy-primitives 0.7.1", + "alloy-primitives 0.7.7", "serde", "serde_json", "thiserror", @@ -229,17 +261,20 @@ dependencies = [ [[package]] name = "alloy-network" -version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=8808d21#8808d21677ed9a05ff04000ac7f4acdd2fde94e3" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25f6895fc31b48fa12306ef9b4f78b7764f8bd6d7d91cdb0a40e233704a0f23f" dependencies = [ "alloy-consensus", "alloy-eips", "alloy-json-rpc", - "alloy-primitives 0.7.1", - "alloy-rpc-types", + "alloy-primitives 0.7.7", + "alloy-rpc-types-eth", + "alloy-serde", "alloy-signer", - "alloy-sol-types 0.7.1", + "alloy-sol-types 0.7.7", "async-trait", + "auto_impl", "futures-utils-wasm", "thiserror", ] @@ -269,9 +304,9 @@ dependencies = [ [[package]] name = "alloy-primitives" -version = "0.7.1" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c715249705afa1e32be79dabfd35e2ef0f1cc02ad2cf48c9d1e20026ee637b" +checksum = "ccb3ead547f4532bc8af961649942f0b9c16ee9226e26caa3f38420651cc0bf4" dependencies = [ "alloy-rlp", "arbitrary", @@ -296,17 +331,20 @@ dependencies = [ [[package]] name = "alloy-provider" -version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=8808d21#8808d21677ed9a05ff04000ac7f4acdd2fde94e3" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c538bfa893d07e27cb4f3c1ab5f451592b7c526d511d62b576a2ce59e146e4a" dependencies = [ + "alloy-chains", + "alloy-consensus", "alloy-eips", "alloy-json-rpc", "alloy-network", - "alloy-primitives 0.7.1", + "alloy-primitives 0.7.7", "alloy-rpc-client", - "alloy-rpc-types", - "alloy-rpc-types-trace", + "alloy-rpc-types-eth", "alloy-transport", + "alloy-transport-http", "async-stream", "async-trait", "auto_impl", @@ -314,18 +352,23 @@ dependencies = [ "futures", "futures-utils-wasm", "lru", + "pin-project", + "reqwest 0.12.5", + "serde", "serde_json", "tokio", "tracing", + "url", ] [[package]] name = "alloy-pubsub" -version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=8808d21#8808d21677ed9a05ff04000ac7f4acdd2fde94e3" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a7341322d9bc0e49f6e9fd9f2eb8e30f73806f2dd12cbb3d6bab2694c921f87" dependencies = [ "alloy-json-rpc", - "alloy-primitives 0.7.1", + "alloy-primitives 0.7.7", "alloy-transport", "bimap", "futures", @@ -339,9 +382,9 @@ dependencies = [ [[package]] name = "alloy-rlp" -version = "0.3.4" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d58d9f5da7b40e9bfff0b7e7816700be4019db97d4b6359fe7f94a9e22e42ac" +checksum = "26154390b1d205a4a7ac7352aa2eb4f81f391399d4e2f546fb81a2f8bb383f62" dependencies = [ "alloy-rlp-derive", "arrayvec", @@ -350,98 +393,118 @@ dependencies = [ [[package]] name = "alloy-rlp-derive" -version = "0.3.4" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a047897373be4bbb0224c1afdabca92648dc57a9c9ef6e7b0be3aff7a859c83" +checksum = "4d0f2d905ebd295e7effec65e5f6868d153936130ae718352771de3e7d03c75c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.74", ] [[package]] name = "alloy-rpc-client" -version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=8808d21#8808d21677ed9a05ff04000ac7f4acdd2fde94e3" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ba31bae67773fd5a60020bea900231f8396202b7feca4d0c70c6b59308ab4a8" dependencies = [ "alloy-json-rpc", "alloy-transport", "alloy-transport-http", "futures", "pin-project", + "reqwest 0.12.5", "serde", "serde_json", "tokio", "tokio-stream", "tower", "tracing", + "url", ] [[package]] name = "alloy-rpc-types" -version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=8808d21#8808d21677ed9a05ff04000ac7f4acdd2fde94e3" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "184a7a42c7ba9141cc9e76368356168c282c3bc3d9e5d78f3556bdfe39343447" +dependencies = [ + "alloy-rpc-types-engine", + "alloy-rpc-types-eth", + "alloy-rpc-types-trace", + "alloy-serde", +] + +[[package]] +name = "alloy-rpc-types-engine" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e765962e3b82fd6f276a0873b5bd897e5d75a25f78fa9a6a21bd350d8e98a4e" dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-genesis", - "alloy-primitives 0.7.1", + "alloy-primitives 0.7.7", "alloy-rlp", + "alloy-rpc-types-eth", "alloy-serde", - "alloy-sol-types 0.7.1", - "itertools 0.12.1", + "jsonwebtoken 9.3.0", + "rand", "serde", - "serde_json", "thiserror", ] [[package]] -name = "alloy-rpc-types-engine" -version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=8808d21#8808d21677ed9a05ff04000ac7f4acdd2fde94e3" +name = "alloy-rpc-types-eth" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab4123ee21f99ba4bd31bfa36ba89112a18a500f8b452f02b35708b1b951e2b9" dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives 0.7.1", + "alloy-primitives 0.7.7", "alloy-rlp", - "alloy-rpc-types", "alloy-serde", - "jsonwebtoken 9.3.0", - "rand", + "alloy-sol-types 0.7.7", + "itertools 0.13.0", "serde", + "serde_json", "thiserror", ] [[package]] name = "alloy-rpc-types-trace" -version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=8808d21#8808d21677ed9a05ff04000ac7f4acdd2fde94e3" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567933b1d95fd42cb70b75126e32afec2e5e2c3c16e7100a3f83dc1c80f4dc0e" dependencies = [ - "alloy-primitives 0.7.1", - "alloy-rpc-types", + "alloy-primitives 0.7.7", + "alloy-rpc-types-eth", "alloy-serde", "serde", "serde_json", + "thiserror", ] [[package]] name = "alloy-serde" -version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=8808d21#8808d21677ed9a05ff04000ac7f4acdd2fde94e3" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9416c52959e66ead795a11f4a86c248410e9e368a0765710e57055b8a1774dd6" dependencies = [ - "alloy-primitives 0.7.1", + "alloy-primitives 0.7.7", "serde", "serde_json", ] [[package]] name = "alloy-signer" -version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=8808d21#8808d21677ed9a05ff04000ac7f4acdd2fde94e3" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b33753c09fa1ad85e5b092b8dc2372f1e337a42e84b9b4cff9fede75ba4adb32" dependencies = [ - "alloy-dyn-abi 0.7.1", - "alloy-primitives 0.7.1", - "alloy-sol-types 0.7.1", + "alloy-dyn-abi 0.7.7", + "alloy-primitives 0.7.7", + "alloy-sol-types 0.7.7", "async-trait", "auto_impl", "elliptic-curve", @@ -450,81 +513,68 @@ dependencies = [ ] [[package]] -name = "alloy-signer-aws" -version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=8808d21#8808d21677ed9a05ff04000ac7f4acdd2fde94e3" +name = "alloy-signer-ledger" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "575e4c924b23132234c75bd1f8f3871c1bc12ba462f76af9b59249515a38253e" dependencies = [ "alloy-consensus", + "alloy-dyn-abi 0.7.7", "alloy-network", - "alloy-primitives 0.7.1", + "alloy-primitives 0.7.7", "alloy-signer", + "alloy-sol-types 0.7.7", "async-trait", - "aws-sdk-kms", - "k256", - "spki", + "coins-ledger 0.11.1", + "futures-util", + "semver 1.0.23", "thiserror", "tracing", ] [[package]] -name = "alloy-signer-ledger" -version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=8808d21#8808d21677ed9a05ff04000ac7f4acdd2fde94e3" +name = "alloy-signer-local" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dfc9c26fe6c6f1bad818c9a976de9044dd12e1f75f1f156a801ee3e8148c1b6" dependencies = [ "alloy-consensus", "alloy-network", - "alloy-primitives 0.7.1", + "alloy-primitives 0.7.7", "alloy-signer", "async-trait", - "coins-ledger", - "futures-util", - "semver 1.0.22", + "coins-bip32 0.11.1", + "coins-bip39 0.11.1", + "elliptic-curve", + "eth-keystore", + "k256", + "rand", "thiserror", - "tracing", ] [[package]] name = "alloy-signer-trezor" -version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=8808d21#8808d21677ed9a05ff04000ac7f4acdd2fde94e3" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd82e86e4a6604fd11f84b170638d16dcdac9db6c2b5f5b91a3941b7e7af7f94" dependencies = [ "alloy-consensus", "alloy-network", - "alloy-primitives 0.7.1", + "alloy-primitives 0.7.7", "alloy-signer", "async-trait", - "semver 1.0.22", + "semver 1.0.23", "thiserror", "tracing", "trezor-client", ] -[[package]] -name = "alloy-signer-wallet" -version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=8808d21#8808d21677ed9a05ff04000ac7f4acdd2fde94e3" -dependencies = [ - "alloy-consensus", - "alloy-network", - "alloy-primitives 0.7.1", - "alloy-signer", - "async-trait", - "coins-bip32", - "coins-bip39", - "elliptic-curve", - "eth-keystore", - "k256", - "rand", - "thiserror", -] - [[package]] name = "alloy-sol-macro" version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e86ec0a47740b20bc5613b8712d0d321d031c4efc58e9645af96085d5cccfc27" dependencies = [ - "alloy-json-abi 0.6.4", "const-hex", "dunce", "heck 0.4.1", @@ -532,46 +582,59 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "serde_json", - "syn 2.0.60", + "syn 2.0.74", "syn-solidity 0.6.4", "tiny-keccak", ] [[package]] name = "alloy-sol-macro" -version = "0.7.1" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef9a94a27345fb31e3fcb5f5e9f592bb4847493b07fa1e47dd9fde2222f2e28" +checksum = "2b40397ddcdcc266f59f959770f601ce1280e699a91fc1862f29cef91707cd09" dependencies = [ - "alloy-json-abi 0.7.1", + "alloy-sol-macro-expander", + "alloy-sol-macro-input", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.74", +] + +[[package]] +name = "alloy-sol-macro-expander" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "867a5469d61480fea08c7333ffeca52d5b621f5ca2e44f271b117ec1fc9a0525" +dependencies = [ + "alloy-json-abi 0.7.7", "alloy-sol-macro-input", "const-hex", - "heck 0.4.1", + "heck 0.5.0", "indexmap", "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.60", - "syn-solidity 0.7.1", + "syn 2.0.74", + "syn-solidity 0.7.7", "tiny-keccak", ] [[package]] name = "alloy-sol-macro-input" -version = "0.7.1" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31fe73cd259527e24dc2dbfe64bc95e5ddfcd2b2731f670a11ff72b2be2c25b" +checksum = "2e482dc33a32b6fadbc0f599adea520bd3aaa585c141a80b404d0a3e3fa72528" dependencies = [ - "alloy-json-abi 0.7.1", + "alloy-json-abi 0.7.7", "const-hex", "dunce", "heck 0.5.0", "proc-macro2", "quote", "serde_json", - "syn 2.0.60", - "syn-solidity 0.7.1", + "syn 2.0.74", + "syn-solidity 0.7.7", ] [[package]] @@ -580,16 +643,17 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0045cc89524e1451ccf33e8581355b6027ac7c6e494bb02959d4213ad0d8e91d" dependencies = [ - "winnow 0.6.7", + "winnow 0.6.18", ] [[package]] name = "alloy-sol-type-parser" -version = "0.7.1" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c8d6e74e4feeaa2bcfdecfd3da247ab53c67bd654ba1907270c32e02b142331" +checksum = "cbcba3ca07cf7975f15d871b721fb18031eec8bce51103907f6dcce00b255d98" dependencies = [ - "winnow 0.6.7", + "serde", + "winnow 0.6.18", ] [[package]] @@ -598,7 +662,6 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad09ec5853fa700d12d778ad224dcdec636af424d29fad84fb9a2f16a5b0ef09" dependencies = [ - "alloy-json-abi 0.6.4", "alloy-primitives 0.6.4", "alloy-sol-macro 0.6.4", "const-hex", @@ -607,24 +670,25 @@ dependencies = [ [[package]] name = "alloy-sol-types" -version = "0.7.1" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afaffed78bfb17526375754931e045f96018aa810844b29c7aef823266dd4b4b" +checksum = "a91ca40fa20793ae9c3841b83e74569d1cc9af29a2f5237314fd3452d51e38c7" dependencies = [ - "alloy-json-abi 0.7.1", - "alloy-primitives 0.7.1", - "alloy-sol-macro 0.7.1", + "alloy-json-abi 0.7.7", + "alloy-primitives 0.7.7", + "alloy-sol-macro 0.7.7", "const-hex", "serde", ] [[package]] name = "alloy-transport" -version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=8808d21#8808d21677ed9a05ff04000ac7f4acdd2fde94e3" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01b51a291f949f755e6165c3ed562883175c97423703703355f4faa4b7d0a57c" dependencies = [ "alloy-json-rpc", - "base64 0.22.0", + "base64 0.22.1", "futures-util", "futures-utils-wasm", "serde", @@ -632,27 +696,30 @@ dependencies = [ "thiserror", "tokio", "tower", + "tracing", "url", - "wasm-bindgen-futures", ] [[package]] name = "alloy-transport-http" -version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=8808d21#8808d21677ed9a05ff04000ac7f4acdd2fde94e3" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86d65871f9f1cafe1ed25cde2f1303be83e6473e995a2d56c275ae4fcce6119c" dependencies = [ "alloy-json-rpc", "alloy-transport", - "reqwest 0.12.4", + "reqwest 0.12.5", "serde_json", "tower", + "tracing", "url", ] [[package]] name = "alloy-transport-ipc" -version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=8808d21#8808d21677ed9a05ff04000ac7f4acdd2fde94e3" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd7fbc8b6282ce41b01cbddef7bffb133fe6e1bf65dcd39770d45a905c051179" dependencies = [ "alloy-json-rpc", "alloy-pubsub", @@ -669,63 +736,81 @@ dependencies = [ [[package]] name = "alloy-transport-ws" -version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy?rev=8808d21#8808d21677ed9a05ff04000ac7f4acdd2fde94e3" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aec83fd052684556c78c54df111433493267234d82321c2236560c752f595f20" dependencies = [ "alloy-pubsub", "alloy-transport", "futures", - "http 0.2.12", + "http 1.1.0", + "rustls 0.23.12", "serde_json", "tokio", - "tokio-tungstenite", + "tokio-tungstenite 0.23.1", "tracing", "ws_stream_wasm", ] +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "anstream" -version = "0.6.13" +version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.6" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -733,9 +818,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.82" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "arbitrary" @@ -885,30 +970,6 @@ dependencies = [ "term", ] -[[package]] -name = "async-channel" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "136d4d23bcc79e27423727b36823d86233aad06dfea531837b038394d11e9928" -dependencies = [ - "concurrent-queue", - "event-listener 5.3.0", - "event-listener-strategy 0.5.1", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "async-lock" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" -dependencies = [ - "event-listener 4.0.3", - "event-listener-strategy 0.4.0", - "pin-project-lite", -] - [[package]] name = "async-stream" version = "0.3.5" @@ -928,24 +989,18 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.74", ] -[[package]] -name = "async-task" -version = "4.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" - [[package]] name = "async-trait" -version = "0.1.80" +version = "0.1.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" +checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.74", ] [[package]] @@ -968,12 +1023,6 @@ dependencies = [ "bytemuck", ] -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "aurora-engine-modexp" version = "1.1.0" @@ -992,45 +1041,14 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.74", ] [[package]] name = "autocfg" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" - -[[package]] -name = "aws-config" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2a4707646259764ab59fd9a50e9de2e92c637b28b36285d6f6fa030e915fbd9" -dependencies = [ - "aws-credential-types", - "aws-runtime", - "aws-sdk-sso", - "aws-sdk-ssooidc", - "aws-sdk-sts", - "aws-smithy-async", - "aws-smithy-http", - "aws-smithy-json", - "aws-smithy-runtime", - "aws-smithy-runtime-api", - "aws-smithy-types", - "aws-types", - "bytes", - "fastrand", - "hex", - "http 0.2.12", - "hyper 0.14.28", - "ring 0.17.8", - "time", - "tokio", - "tracing", - "url", - "zeroize", -] +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "aws-credential-types" @@ -1041,115 +1059,49 @@ dependencies = [ "aws-smithy-async", "aws-smithy-runtime-api", "aws-smithy-types", - "zeroize", -] - -[[package]] -name = "aws-runtime" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4963ac9ff2d33a4231b3806c1c69f578f221a9cabb89ad2bde62ce2b442c8a7" -dependencies = [ - "aws-credential-types", - "aws-sigv4", - "aws-smithy-async", - "aws-smithy-http", - "aws-smithy-runtime-api", - "aws-smithy-types", - "aws-types", - "bytes", - "fastrand", - "http 0.2.12", - "http-body 0.4.6", - "percent-encoding", - "pin-project-lite", - "tracing", - "uuid 1.8.0", -] - -[[package]] -name = "aws-sdk-kms" -version = "1.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4453868f71232e0baf5947972972e87813c8bbb311351f669a6ad6aa5b86ee63" -dependencies = [ - "aws-credential-types", - "aws-runtime", - "aws-smithy-async", - "aws-smithy-http", - "aws-smithy-json", - "aws-smithy-runtime", - "aws-smithy-runtime-api", - "aws-smithy-types", - "aws-types", - "bytes", - "http 0.2.12", - "once_cell", - "regex-lite", - "tracing", -] - -[[package]] -name = "aws-sdk-sso" -version = "1.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d70fb493f4183f5102d8a8d0cc9b57aec29a762f55c0e7bf527e0f7177bb408" -dependencies = [ - "aws-credential-types", - "aws-runtime", - "aws-smithy-async", - "aws-smithy-http", - "aws-smithy-json", - "aws-smithy-runtime", - "aws-smithy-runtime-api", - "aws-smithy-types", - "aws-types", - "bytes", - "http 0.2.12", - "once_cell", - "regex-lite", - "tracing", + "zeroize", ] [[package]] -name = "aws-sdk-ssooidc" -version = "1.21.0" +name = "aws-runtime" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3f37549b3e38b7ea5efd419d4d7add6ea1e55223506eb0b4fef9d25e7cc90d" +checksum = "f42c2d4218de4dcd890a109461e2f799a1a2ba3bcd2cde9af88360f5df9266c6" dependencies = [ "aws-credential-types", - "aws-runtime", + "aws-sigv4", "aws-smithy-async", "aws-smithy-http", - "aws-smithy-json", - "aws-smithy-runtime", "aws-smithy-runtime-api", "aws-smithy-types", "aws-types", "bytes", + "fastrand", "http 0.2.12", + "http-body 0.4.6", "once_cell", - "regex-lite", + "percent-encoding", + "pin-project-lite", "tracing", + "uuid 1.10.0", ] [[package]] -name = "aws-sdk-sts" -version = "1.21.0" +name = "aws-sdk-kms" +version = "1.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2ff219a5d4b795cd33251c19dbe9c4b401f2b2cbe513e07c76ada644eaf34e" +checksum = "9bc44afa1eaa1d4cae1fb61647b142083c3ae1b77c225b5d61be3d5b64bd93d3" dependencies = [ "aws-credential-types", "aws-runtime", "aws-smithy-async", "aws-smithy-http", "aws-smithy-json", - "aws-smithy-query", "aws-smithy-runtime", "aws-smithy-runtime-api", "aws-smithy-types", - "aws-smithy-xml", "aws-types", + "bytes", "http 0.2.12", "once_cell", "regex-lite", @@ -1158,9 +1110,9 @@ dependencies = [ [[package]] name = "aws-sigv4" -version = "1.2.1" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58b56f1cbe6fd4d0c2573df72868f20ab1c125ca9c9dbce17927a463433a2e57" +checksum = "5df1b0fa6be58efe9d4ccc257df0a53b89cd8909e86591a13ca54817c87517be" dependencies = [ "aws-credential-types", "aws-smithy-http", @@ -1192,9 +1144,9 @@ dependencies = [ [[package]] name = "aws-smithy-http" -version = "0.60.8" +version = "0.60.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a7de001a1b9a25601016d8057ea16e31a45fdca3751304c8edf4ad72e706c08" +checksum = "d9cd0ae3d97daa0a2bf377a4d8e8e1362cae590c4a1aad0d40058ebca18eb91e" dependencies = [ "aws-smithy-runtime-api", "aws-smithy-types", @@ -1219,21 +1171,11 @@ dependencies = [ "aws-smithy-types", ] -[[package]] -name = "aws-smithy-query" -version = "0.60.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2fbd61ceb3fe8a1cb7352e42689cec5335833cd9f94103a61e98f9bb61c64bb" -dependencies = [ - "aws-smithy-types", - "urlencoding", -] - [[package]] name = "aws-smithy-runtime" -version = "1.3.1" +version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44e7945379821074549168917e89e60630647e186a69243248f08c6d168b975a" +checksum = "0abbf454960d0db2ad12684a1640120e7557294b0ff8e2f11236290a1b293225" dependencies = [ "aws-smithy-async", "aws-smithy-http", @@ -1244,8 +1186,9 @@ dependencies = [ "h2", "http 0.2.12", "http-body 0.4.6", - "http-body 1.0.0", - "hyper 0.14.28", + "http-body 1.0.1", + "httparse", + "hyper 0.14.30", "hyper-rustls 0.24.2", "once_cell", "pin-project-lite", @@ -1257,9 +1200,9 @@ dependencies = [ [[package]] name = "aws-smithy-runtime-api" -version = "1.4.0" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cc56a5c96ec741de6c5e6bf1ce6948be969d6506dfa9c39cffc284e31e4979b" +checksum = "e086682a53d3aa241192aa110fa8dfce98f2f5ac2ead0de84d41582c7e8fdb96" dependencies = [ "aws-smithy-async", "aws-smithy-types", @@ -1274,9 +1217,9 @@ dependencies = [ [[package]] name = "aws-smithy-types" -version = "1.1.8" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abe14dceea1e70101d38fbf2a99e6a34159477c0fb95e68e05c66bd7ae4c3729" +checksum = "6cee7cadb433c781d3299b916fbf620fea813bf38f49db282fb6858141a05cc8" dependencies = [ "base64-simd", "bytes", @@ -1284,7 +1227,7 @@ dependencies = [ "http 0.2.12", "http 1.1.0", "http-body 0.4.6", - "http-body 1.0.0", + "http-body 1.0.1", "http-body-util", "itoa", "num-integer", @@ -1295,35 +1238,25 @@ dependencies = [ "time", ] -[[package]] -name = "aws-smithy-xml" -version = "0.60.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d123fbc2a4adc3c301652ba8e149bf4bc1d1725affb9784eb20c953ace06bf55" -dependencies = [ - "xmlparser", -] - [[package]] name = "aws-types" -version = "1.2.0" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a43b56df2c529fe44cb4d92bd64d0479883fb9608ff62daede4df5405381814" +checksum = "5221b91b3e441e6675310829fd8984801b772cb1546ef6c0e54dec9f1ac13fef" dependencies = [ "aws-credential-types", "aws-smithy-async", "aws-smithy-runtime-api", "aws-smithy-types", - "http 0.2.12", "rustc_version 0.4.0", "tracing", ] [[package]] name = "backtrace" -version = "0.3.71" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", @@ -1354,9 +1287,9 @@ checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64-simd" @@ -1409,9 +1342,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" dependencies = [ "arbitrary", "serde", @@ -1439,27 +1372,11 @@ dependencies = [ "generic-array", ] -[[package]] -name = "blocking" -version = "1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" -dependencies = [ - "async-channel", - "async-lock", - "async-task", - "fastrand", - "futures-io", - "futures-lite", - "piper", - "tracing", -] - [[package]] name = "blst" -version = "0.3.11" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c94087b935a822949d3291a9989ad2b2051ea141eda0fd4e478a75f6aa3e604b" +checksum = "4378725facc195f1a538864863f6de233b500a8862747e7f165078a419d5e874" dependencies = [ "cc", "glob", @@ -1479,9 +1396,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.9.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706" +checksum = "40723b8fb387abc38f4f4a37c09073622e41dd12327033091ef8950659e6dc0c" dependencies = [ "memchr", "serde", @@ -1507,9 +1424,9 @@ checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" [[package]] name = "bytemuck" -version = "1.15.0" +version = "1.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15" +checksum = "102087e286b4677862ea56cf8fc58bb2cdfa8725c40ffb80fe3a008eb7f2fc83" [[package]] name = "byteorder" @@ -1519,9 +1436,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" dependencies = [ "serde", ] @@ -1559,9 +1476,9 @@ dependencies = [ [[package]] name = "c-kzg" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3130f3d8717cc02e668a896af24984d5d5d4e8bf12e278e982e0f1bd88a0f9af" +checksum = "cdf100c4cea8f207e883ff91ca886d621d8a166cb04971dfaa9bb8fd99ed95df" dependencies = [ "blst", "cc", @@ -1573,9 +1490,9 @@ dependencies = [ [[package]] name = "camino" -version = "1.1.6" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +checksum = "3054fea8a20d8ff3968d5b22cc27501d2b08dc4decdb31b184323f00c5ef23bb" dependencies = [ "serde", ] @@ -1597,7 +1514,7 @@ checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", - "semver 1.0.22", + "semver 1.0.23", "serde", "serde_json", "thiserror", @@ -1605,13 +1522,13 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.95" +version = "1.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32a725bc159af97c3e629873bb9f88fb8cf8a4867175f76dc987815ea07c83b" +checksum = "68064e60dbf1f17005c2fde4d07c16d8baa506fd7ffed8ccab702d93617975c7" dependencies = [ "jobserver", "libc", - "once_cell", + "shlex", ] [[package]] @@ -1626,7 +1543,10 @@ version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ + "android-tzdata", + "iana-time-zone", "num-traits", + "windows-targets 0.52.6", ] [[package]] @@ -1641,9 +1561,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.4" +version = "4.5.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" +checksum = "ed6719fffa43d0d87e5fd8caeab59be1554fb028cd30edc88fc4369b17971019" dependencies = [ "clap_builder", "clap_derive", @@ -1651,9 +1571,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.2" +version = "4.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +checksum = "216aec2b177652e3846684cbfe25c9964d18ec45234f0f5da5157b207ed1aab6" dependencies = [ "anstream", "anstyle", @@ -1666,21 +1586,21 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.4" +version = "4.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" +checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.74", ] [[package]] name = "clap_lex" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "coins-bip32" @@ -1689,7 +1609,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b6be4a5df2098cd811f3194f64ddb96c267606bffd9689ac7b0160097b01ad3" dependencies = [ "bs58", - "coins-core", + "coins-core 0.8.7", + "digest 0.10.7", + "hmac", + "k256", + "serde", + "sha2", + "thiserror", +] + +[[package]] +name = "coins-bip32" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66c43ff7fd9ff522219058808a259e61423335767b1071d5b346de60d9219657" +dependencies = [ + "bs58", + "coins-core 0.11.1", "digest 0.10.7", "hmac", "k256", @@ -1705,7 +1641,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3db8fba409ce3dc04f7d804074039eb68b960b0829161f8e06c95fea3f122528" dependencies = [ "bitvec", - "coins-bip32", + "coins-bip32 0.8.7", + "hmac", + "once_cell", + "pbkdf2 0.12.2", + "rand", + "sha2", + "thiserror", +] + +[[package]] +name = "coins-bip39" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c4587c0b4064da887ed39a6522f577267d57e58bdd583178cd877d721b56a2e" +dependencies = [ + "bitvec", + "coins-bip32 0.11.1", "hmac", "once_cell", "pbkdf2 0.12.2", @@ -1734,6 +1686,25 @@ dependencies = [ "thiserror", ] +[[package]] +name = "coins-core" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b3aeeec621f4daec552e9d28befd58020a78cfc364827d06a753e8bc13c6c4b" +dependencies = [ + "base64 0.21.7", + "bech32", + "bs58", + "const-hex", + "digest 0.10.7", + "generic-array", + "ripemd", + "serde", + "sha2", + "sha3", + "thiserror", +] + [[package]] name = "coins-ledger" version = "0.10.1" @@ -1757,11 +1728,34 @@ dependencies = [ "wasm-bindgen-futures", ] +[[package]] +name = "coins-ledger" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "166ef757aa936b45f3e5d39c344047f65ef7d25a50067246a498021a816d074b" +dependencies = [ + "async-trait", + "byteorder", + "cfg-if", + "const-hex", + "getrandom", + "hidapi-rusb", + "js-sys", + "log", + "nix", + "once_cell", + "thiserror", + "tokio", + "tracing", + "wasm-bindgen", + "wasm-bindgen-futures", +] + [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" [[package]] name = "comfy-table" @@ -1775,15 +1769,6 @@ dependencies = [ "unicode-width", ] -[[package]] -name = "concurrent-queue" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" -dependencies = [ - "crossbeam-utils", -] - [[package]] name = "console" version = "0.15.8" @@ -1799,9 +1784,9 @@ dependencies = [ [[package]] name = "const-hex" -version = "1.11.3" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ba00838774b4ab0233e355d26710fbfc8327a05c017f6dc4873f876d1f79f78" +checksum = "94fb8a24a26d37e1ffd45343323dc9fe6654ceea44c12f2fcb3d7ac29e610bc6" dependencies = [ "cfg-if", "cpufeatures", @@ -1840,24 +1825,24 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" dependencies = [ "libc", ] [[package]] name = "crc32fast" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] @@ -1883,9 +1868,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crossterm" @@ -1893,7 +1878,7 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "crossterm_winapi", "libc", "parking_lot", @@ -1958,12 +1943,12 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.8" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "darling_core 0.20.8", - "darling_macro 0.20.8", + "darling_core 0.20.10", + "darling_macro 0.20.10", ] [[package]] @@ -1982,16 +1967,16 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.8" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", - "strsim 0.10.0", - "syn 2.0.60", + "strsim 0.11.1", + "syn 2.0.74", ] [[package]] @@ -2007,13 +1992,13 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.8" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.20.8", + "darling_core 0.20.10", "quote", - "syn 2.0.60", + "syn 2.0.74", ] [[package]] @@ -2031,9 +2016,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "der" @@ -2074,7 +2059,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.74", ] [[package]] @@ -2113,10 +2098,10 @@ version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d48cda787f839151732d396ac69e3473923d54312c070ee21e9effcaa8ca0b1d" dependencies = [ - "darling 0.20.8", + "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.74", ] [[package]] @@ -2136,20 +2121,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "206868b8242f27cecce124c19fd88157fbd0dd334df2587f36417bafbc85097b" dependencies = [ "derive_builder_core 0.20.0", - "syn 2.0.60", + "syn 2.0.74", ] [[package]] name = "derive_more" -version = "0.99.17" +version = "0.99.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "convert_case", "proc-macro2", "quote", "rustc_version 0.4.0", - "syn 1.0.109", + "syn 2.0.74", ] [[package]] @@ -2228,11 +2213,28 @@ dependencies = [ "winapi", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.74", +] + +[[package]] +name = "doctest-file" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aac81fa3e28d21450aa4d2ac065992ba96a1d7303efbce51a95f4fd175b67562" + [[package]] name = "dunce" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "dyn-clone" @@ -2256,9 +2258,9 @@ dependencies = [ [[package]] name = "either" -version = "1.11.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "elliptic-curve" @@ -2282,9 +2284,9 @@ dependencies = [ [[package]] name = "ena" -version = "0.14.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c533630cf40e9caa44bd91aadc88a75d75a4c3a12b4cfde353cbed41daa1e1f1" +checksum = "3d248bdd43ce613d87415282f69b9bb99d947d290b10962dd6c56233312c2ad5" dependencies = [ "log", ] @@ -2324,13 +2326,13 @@ dependencies = [ [[package]] name = "enumn" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fd000fd6988e73bbe993ea3db9b1aa64906ab88766d654973924340c8cddb42" +checksum = "2f9ed6b3789237c8a0c1c505af1c7eb2c560df6186f01b098c3a1064ea532f38" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.74", ] [[package]] @@ -2341,9 +2343,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -2421,9 +2423,9 @@ dependencies = [ [[package]] name = "ethereum_ssz" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e61ffea29f26e8249d35128a82ec8d3bd4fbc80179ea5f5e5e3daafef6a80fcb" +checksum = "7d3627f83d8b87b432a5fad9934b4565260722a141a2c40f371f8080adec9425" dependencies = [ "ethereum-types", "itertools 0.10.5", @@ -2496,7 +2498,7 @@ dependencies = [ "reqwest 0.11.27", "serde", "serde_json", - "syn 2.0.60", + "syn 2.0.74", "toml", "walkdir", ] @@ -2514,7 +2516,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.60", + "syn 2.0.74", ] [[package]] @@ -2540,7 +2542,7 @@ dependencies = [ "serde", "serde_json", "strum", - "syn 2.0.60", + "syn 2.0.74", "tempfile", "thiserror", "tiny-keccak", @@ -2556,7 +2558,7 @@ dependencies = [ "chrono", "ethers-core", "reqwest 0.11.27", - "semver 1.0.22", + "semver 1.0.23", "serde", "serde_json", "thiserror", @@ -2617,7 +2619,7 @@ dependencies = [ "serde_json", "thiserror", "tokio", - "tokio-tungstenite", + "tokio-tungstenite 0.20.1", "tracing", "tracing-futures", "url", @@ -2634,9 +2636,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "228875491c782ad851773b652dd8ecac62cda8571d3bc32a5853644dd26766c2" dependencies = [ "async-trait", - "coins-bip32", - "coins-bip39", - "coins-ledger", + "coins-bip32 0.8.7", + "coins-bip39 0.8.7", + "coins-ledger 0.10.1", "const-hex", "elliptic-curve", "eth-keystore", @@ -2644,7 +2646,7 @@ dependencies = [ "futures-executor", "futures-util", "rand", - "semver 1.0.22", + "semver 1.0.23", "sha2", "thiserror", "tracing", @@ -2669,7 +2671,7 @@ dependencies = [ "path-slash", "rayon", "regex", - "semver 1.0.22", + "semver 1.0.23", "serde", "serde_json", "solang-parser", @@ -2682,48 +2684,6 @@ dependencies = [ "yansi 0.5.1", ] -[[package]] -name = "event-listener" -version = "4.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener" -version = "5.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d9944b8ca13534cdfb2800775f8dd4902ff3fc75a50101466decadfdf322a24" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener-strategy" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" -dependencies = [ - "event-listener 4.0.3", - "pin-project-lite", -] - -[[package]] -name = "event-listener-strategy" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "332f51cb23d20b0de8458b86580878211da09bcd4503cb579c225b3d124cabb3" -dependencies = [ - "event-listener 5.3.0", - "pin-project-lite", -] - [[package]] name = "eyre" version = "0.6.12" @@ -2736,9 +2696,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "fastrlp" @@ -2763,9 +2723,9 @@ dependencies = [ [[package]] name = "figment" -version = "0.10.18" +version = "0.10.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d032832d74006f99547004d49410a4b4218e4c33382d56ca3ff89df74f86b953" +checksum = "8cb01cd46b0cf372153850f4c6c272d9cbea2da513e07538405148f95bd789f3" dependencies = [ "atomic", "pear", @@ -2796,9 +2756,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.29" +version = "1.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4556222738635b7a3417ae6130d8f52201e45a0c4d1a907f0826383adb5f85e7" +checksum = "7f211bbe8e69bbd0cfdea405084f128ae8b4aaa6b0b522fc8f2b009084797920" dependencies = [ "crc32fast", "miniz_oxide", @@ -2836,16 +2796,16 @@ dependencies = [ [[package]] name = "foundry-block-explorers" -version = "0.2.6" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b64cb03e297eb85b9f84a195fec7390a5e9805d9b82b11b2af57f65fc6d4ceb7" +checksum = "6ecb3c05dbf9454cf58c6c440f84c5d2c8f4e94edb4b16f87cfad9e4d818065a" dependencies = [ "alloy-chains", - "alloy-json-abi 0.7.1", - "alloy-primitives 0.7.1", + "alloy-json-abi 0.7.7", + "alloy-primitives 0.7.7", "foundry-compilers", - "reqwest 0.12.4", - "semver 1.0.22", + "reqwest 0.12.5", + "semver 1.0.23", "serde", "serde_json", "thiserror", @@ -2855,35 +2815,36 @@ dependencies = [ [[package]] name = "foundry-cheatcodes" version = "0.2.0" -source = "git+https://github.com/foundry-rs/foundry?rev=26e6e57527497a90af1a5409484c01b5e7702a02#26e6e57527497a90af1a5409484c01b5e7702a02" +source = "git+https://github.com/foundry-rs/foundry?rev=72e44fb87c38b2acfa2b0b136fc1bc833f71e674#72e44fb87c38b2acfa2b0b136fc1bc833f71e674" dependencies = [ - "alloy-dyn-abi 0.7.1", + "alloy-dyn-abi 0.7.7", "alloy-genesis", - "alloy-json-abi 0.7.1", - "alloy-primitives 0.7.1", + "alloy-json-abi 0.7.7", + "alloy-primitives 0.7.7", "alloy-provider", "alloy-rpc-types", "alloy-signer", - "alloy-signer-wallet", - "alloy-sol-types 0.7.1", - "base64 0.22.0", - "const-hex", + "alloy-signer-local", + "alloy-sol-types 0.7.7", + "base64 0.22.1", "dialoguer", "eyre", "foundry-cheatcodes-spec", "foundry-common", "foundry-compilers", "foundry-config", + "foundry-evm-abi", "foundry-evm-core", "foundry-wallets", - "itertools 0.12.1", + "itertools 0.13.0", "jsonpath_lib", "k256", "p256", "parking_lot", + "rand", "revm", "rustc-hash", - "semver 1.0.22", + "semver 1.0.23", "serde_json", "thiserror", "toml", @@ -2894,9 +2855,9 @@ dependencies = [ [[package]] name = "foundry-cheatcodes-spec" version = "0.2.0" -source = "git+https://github.com/foundry-rs/foundry?rev=26e6e57527497a90af1a5409484c01b5e7702a02#26e6e57527497a90af1a5409484c01b5e7702a02" +source = "git+https://github.com/foundry-rs/foundry?rev=72e44fb87c38b2acfa2b0b136fc1bc833f71e674#72e44fb87c38b2acfa2b0b136fc1bc833f71e674" dependencies = [ - "alloy-sol-types 0.7.1", + "alloy-sol-types 0.7.7", "foundry-macros", "serde", ] @@ -2904,20 +2865,19 @@ dependencies = [ [[package]] name = "foundry-common" version = "0.2.0" -source = "git+https://github.com/foundry-rs/foundry?rev=26e6e57527497a90af1a5409484c01b5e7702a02#26e6e57527497a90af1a5409484c01b5e7702a02" +source = "git+https://github.com/foundry-rs/foundry?rev=72e44fb87c38b2acfa2b0b136fc1bc833f71e674#72e44fb87c38b2acfa2b0b136fc1bc833f71e674" dependencies = [ - "alloy-consensus", "alloy-contract", - "alloy-dyn-abi 0.7.1", - "alloy-json-abi 0.7.1", + "alloy-dyn-abi 0.7.7", + "alloy-json-abi 0.7.7", "alloy-json-rpc", - "alloy-primitives 0.7.1", + "alloy-primitives 0.7.7", "alloy-provider", "alloy-pubsub", "alloy-rpc-client", "alloy-rpc-types", - "alloy-rpc-types-engine", - "alloy-sol-types 0.7.1", + "alloy-serde", + "alloy-sol-types 0.7.7", "alloy-transport", "alloy-transport-http", "alloy-transport-ipc", @@ -2928,91 +2888,176 @@ dependencies = [ "dunce", "eyre", "foundry-block-explorers", + "foundry-common-fmt", "foundry-compilers", "foundry-config", "foundry-linking", - "glob", - "globset", "num-format", "once_cell", - "reqwest 0.12.4", + "reqwest 0.12.5", "rustc-hash", - "semver 1.0.22", + "semver 1.0.23", + "serde", + "serde_json", + "thiserror", + "tokio", + "tower", + "tracing", + "url", + "walkdir", + "yansi 1.0.1", +] + +[[package]] +name = "foundry-common-fmt" +version = "0.2.0" +source = "git+https://github.com/foundry-rs/foundry?rev=72e44fb87c38b2acfa2b0b136fc1bc833f71e674#72e44fb87c38b2acfa2b0b136fc1bc833f71e674" +dependencies = [ + "alloy-consensus", + "alloy-dyn-abi 0.7.7", + "alloy-primitives 0.7.7", + "alloy-rpc-types", + "alloy-serde", + "chrono", + "serde", + "serde_json", + "yansi 1.0.1", +] + +[[package]] +name = "foundry-compilers" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f506a672502997fbc778f1d30eb4a06a58654049ccc6cd0bdb93a785175f682" +dependencies = [ + "alloy-json-abi 0.7.7", + "alloy-primitives 0.7.7", + "auto_impl", + "derivative", + "dirs", + "dyn-clone", + "foundry-compilers-artifacts", + "foundry-compilers-core", + "futures-util", + "home", + "itertools 0.13.0", + "md-5", + "once_cell", + "path-slash", + "rayon", + "semver 1.0.23", + "serde", + "serde_json", + "sha2", + "solang-parser", + "svm-rs 0.5.4", + "svm-rs-builds", + "thiserror", + "tokio", + "tracing", + "winnow 0.6.18", + "yansi 1.0.1", +] + +[[package]] +name = "foundry-compilers-artifacts" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c352516419487416dde3250dbb56b576e0605429eb7b7b16f26849d924ee519" +dependencies = [ + "foundry-compilers-artifacts-solc", + "foundry-compilers-artifacts-vyper", +] + +[[package]] +name = "foundry-compilers-artifacts-solc" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49104d442d6f0266c07edbdd23baa9a1db0f01d04bfdc69b6ac060a57e6f3e27" +dependencies = [ + "alloy-json-abi 0.7.7", + "alloy-primitives 0.7.7", + "foundry-compilers-core", + "futures-util", + "md-5", + "path-slash", + "rayon", + "semver 1.0.23", "serde", "serde_json", - "tempfile", "thiserror", "tokio", - "tower", "tracing", - "url", "walkdir", "yansi 1.0.1", ] [[package]] -name = "foundry-compilers" -version = "0.3.19" +name = "foundry-compilers-artifacts-vyper" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5421772f768d43f81052159c5175e7d10941e0f0416dafd768f353ed9c554fd" +checksum = "7f012d22d0690ad6b6bbcc8d70467325212ddea3457e8efda6affe17fb5ae938" dependencies = [ - "alloy-json-abi 0.7.1", - "alloy-primitives 0.7.1", + "alloy-json-abi 0.7.7", + "alloy-primitives 0.7.7", + "foundry-compilers-artifacts-solc", + "foundry-compilers-core", + "path-slash", + "serde", +] + +[[package]] +name = "foundry-compilers-core" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23760fd6df67a9878ed0fe91e024bf1ff3b7358369cf54129539a8493177c6e7" +dependencies = [ + "alloy-primitives 0.7.7", "cfg-if", - "dirs", "dunce", - "futures-util", - "home", - "itertools 0.12.1", - "md-5", "memmap2", "once_cell", "path-slash", - "rayon", "regex", - "semver 1.0.22", + "semver 1.0.23", "serde", "serde_json", - "sha2", - "solang-parser", - "svm-rs 0.5.2", - "svm-rs-builds", + "svm-rs 0.5.4", "thiserror", "tokio", - "tracing", "walkdir", - "yansi 1.0.1", ] [[package]] name = "foundry-config" version = "0.2.0" -source = "git+https://github.com/foundry-rs/foundry?rev=26e6e57527497a90af1a5409484c01b5e7702a02#26e6e57527497a90af1a5409484c01b5e7702a02" +source = "git+https://github.com/foundry-rs/foundry?rev=72e44fb87c38b2acfa2b0b136fc1bc833f71e674#72e44fb87c38b2acfa2b0b136fc1bc833f71e674" dependencies = [ "Inflector", "alloy-chains", - "alloy-primitives 0.7.1", + "alloy-primitives 0.7.7", "dirs-next", "dunce", "eyre", "figment", "foundry-block-explorers", "foundry-compilers", + "glob", "globset", "number_prefix", "once_cell", "path-slash", "regex", - "reqwest 0.12.4", + "reqwest 0.12.5", "revm-primitives", - "semver 1.0.22", + "semver 1.0.23", "serde", "serde_json", "serde_regex", "solang-parser", "thiserror", "toml", - "toml_edit 0.22.12", + "toml_edit 0.22.20", "tracing", "walkdir", ] @@ -3020,14 +3065,12 @@ dependencies = [ [[package]] name = "foundry-evm" version = "0.2.0" -source = "git+https://github.com/foundry-rs/foundry?rev=26e6e57527497a90af1a5409484c01b5e7702a02#26e6e57527497a90af1a5409484c01b5e7702a02" +source = "git+https://github.com/foundry-rs/foundry?rev=72e44fb87c38b2acfa2b0b136fc1bc833f71e674#72e44fb87c38b2acfa2b0b136fc1bc833f71e674" dependencies = [ - "alloy-dyn-abi 0.7.1", - "alloy-json-abi 0.7.1", - "alloy-primitives 0.7.1", - "alloy-sol-types 0.7.1", - "arrayvec", - "const-hex", + "alloy-dyn-abi 0.7.7", + "alloy-json-abi 0.7.7", + "alloy-primitives 0.7.7", + "alloy-sol-types 0.7.7", "eyre", "foundry-cheatcodes", "foundry-common", @@ -3037,6 +3080,7 @@ dependencies = [ "foundry-evm-coverage", "foundry-evm-fuzz", "foundry-evm-traces", + "indicatif", "parking_lot", "proptest", "revm", @@ -3045,32 +3089,44 @@ dependencies = [ "tracing", ] +[[package]] +name = "foundry-evm-abi" +version = "0.2.0" +source = "git+https://github.com/foundry-rs/foundry?rev=72e44fb87c38b2acfa2b0b136fc1bc833f71e674#72e44fb87c38b2acfa2b0b136fc1bc833f71e674" +dependencies = [ + "alloy-primitives 0.7.7", + "alloy-sol-types 0.7.7", + "derive_more", + "foundry-common-fmt", + "foundry-macros", + "itertools 0.13.0", + "once_cell", + "rustc-hash", +] + [[package]] name = "foundry-evm-core" version = "0.2.0" -source = "git+https://github.com/foundry-rs/foundry?rev=26e6e57527497a90af1a5409484c01b5e7702a02#26e6e57527497a90af1a5409484c01b5e7702a02" +source = "git+https://github.com/foundry-rs/foundry?rev=72e44fb87c38b2acfa2b0b136fc1bc833f71e674#72e44fb87c38b2acfa2b0b136fc1bc833f71e674" dependencies = [ - "alloy-dyn-abi 0.7.1", + "alloy-dyn-abi 0.7.7", "alloy-genesis", - "alloy-json-abi 0.7.1", - "alloy-primitives 0.7.1", + "alloy-json-abi 0.7.7", + "alloy-primitives 0.7.7", "alloy-provider", "alloy-rpc-types", - "alloy-sol-types 0.7.1", + "alloy-serde", + "alloy-sol-types 0.7.7", "alloy-transport", - "arrayvec", "auto_impl", - "const-hex", - "derive_more", "eyre", "foundry-cheatcodes-spec", "foundry-common", - "foundry-compilers", "foundry-config", - "foundry-macros", + "foundry-evm-abi", + "foundry-fork-db", "futures", - "itertools 0.12.1", - "once_cell", + "itertools 0.13.0", "parking_lot", "revm", "revm-inspectors", @@ -3080,33 +3136,34 @@ dependencies = [ "thiserror", "tokio", "tracing", - "url", ] [[package]] name = "foundry-evm-coverage" version = "0.2.0" -source = "git+https://github.com/foundry-rs/foundry?rev=26e6e57527497a90af1a5409484c01b5e7702a02#26e6e57527497a90af1a5409484c01b5e7702a02" +source = "git+https://github.com/foundry-rs/foundry?rev=72e44fb87c38b2acfa2b0b136fc1bc833f71e674#72e44fb87c38b2acfa2b0b136fc1bc833f71e674" dependencies = [ - "alloy-primitives 0.7.1", + "alloy-primitives 0.7.7", "eyre", "foundry-common", "foundry-compilers", "foundry-evm-core", + "rayon", "revm", "rustc-hash", - "semver 1.0.22", + "semver 1.0.23", "tracing", ] [[package]] name = "foundry-evm-fuzz" version = "0.2.0" -source = "git+https://github.com/foundry-rs/foundry?rev=26e6e57527497a90af1a5409484c01b5e7702a02#26e6e57527497a90af1a5409484c01b5e7702a02" +source = "git+https://github.com/foundry-rs/foundry?rev=72e44fb87c38b2acfa2b0b136fc1bc833f71e674#72e44fb87c38b2acfa2b0b136fc1bc833f71e674" dependencies = [ - "alloy-dyn-abi 0.7.1", - "alloy-json-abi 0.7.1", - "alloy-primitives 0.7.1", + "ahash", + "alloy-dyn-abi 0.7.7", + "alloy-json-abi 0.7.7", + "alloy-primitives 0.7.7", "eyre", "foundry-common", "foundry-compilers", @@ -3115,7 +3172,7 @@ dependencies = [ "foundry-evm-coverage", "foundry-evm-traces", "indexmap", - "itertools 0.12.1", + "itertools 0.13.0", "parking_lot", "proptest", "rand", @@ -3128,13 +3185,12 @@ dependencies = [ [[package]] name = "foundry-evm-traces" version = "0.2.0" -source = "git+https://github.com/foundry-rs/foundry?rev=26e6e57527497a90af1a5409484c01b5e7702a02#26e6e57527497a90af1a5409484c01b5e7702a02" +source = "git+https://github.com/foundry-rs/foundry?rev=72e44fb87c38b2acfa2b0b136fc1bc833f71e674#72e44fb87c38b2acfa2b0b136fc1bc833f71e674" dependencies = [ - "alloy-dyn-abi 0.7.1", - "alloy-json-abi 0.7.1", - "alloy-primitives 0.7.1", - "alloy-sol-types 0.7.1", - "const-hex", + "alloy-dyn-abi 0.7.7", + "alloy-json-abi 0.7.7", + "alloy-primitives 0.7.7", + "alloy-sol-types 0.7.7", "eyre", "foundry-block-explorers", "foundry-common", @@ -3142,62 +3198,82 @@ dependencies = [ "foundry-config", "foundry-evm-core", "futures", - "itertools 0.12.1", + "itertools 0.13.0", "once_cell", "revm-inspectors", + "rustc-hash", "serde", + "tempfile", "tokio", "tracing", - "yansi 1.0.1", +] + +[[package]] +name = "foundry-fork-db" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3f9c9e02b19933218eb39c7234dcb0cc20e461258ced030f6fd6ac254a8637" +dependencies = [ + "alloy-primitives 0.7.7", + "alloy-provider", + "alloy-rpc-types", + "alloy-serde", + "alloy-transport", + "eyre", + "futures", + "parking_lot", + "revm", + "rustc-hash", + "serde", + "serde_json", + "thiserror", + "tokio", + "tracing", + "url", ] [[package]] name = "foundry-linking" version = "0.2.0" -source = "git+https://github.com/foundry-rs/foundry?rev=26e6e57527497a90af1a5409484c01b5e7702a02#26e6e57527497a90af1a5409484c01b5e7702a02" +source = "git+https://github.com/foundry-rs/foundry?rev=72e44fb87c38b2acfa2b0b136fc1bc833f71e674#72e44fb87c38b2acfa2b0b136fc1bc833f71e674" dependencies = [ - "alloy-primitives 0.7.1", + "alloy-primitives 0.7.7", "foundry-compilers", - "semver 1.0.22", + "semver 1.0.23", "thiserror", ] [[package]] name = "foundry-macros" version = "0.2.0" -source = "git+https://github.com/foundry-rs/foundry?rev=26e6e57527497a90af1a5409484c01b5e7702a02#26e6e57527497a90af1a5409484c01b5e7702a02" +source = "git+https://github.com/foundry-rs/foundry?rev=72e44fb87c38b2acfa2b0b136fc1bc833f71e674#72e44fb87c38b2acfa2b0b136fc1bc833f71e674" dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.74", ] [[package]] name = "foundry-wallets" version = "0.2.0" -source = "git+https://github.com/foundry-rs/foundry?rev=26e6e57527497a90af1a5409484c01b5e7702a02#26e6e57527497a90af1a5409484c01b5e7702a02" +source = "git+https://github.com/foundry-rs/foundry?rev=72e44fb87c38b2acfa2b0b136fc1bc833f71e674#72e44fb87c38b2acfa2b0b136fc1bc833f71e674" dependencies = [ "alloy-consensus", - "alloy-dyn-abi 0.7.1", + "alloy-dyn-abi 0.7.7", "alloy-network", - "alloy-primitives 0.7.1", + "alloy-primitives 0.7.7", "alloy-signer", - "alloy-signer-aws", "alloy-signer-ledger", + "alloy-signer-local", "alloy-signer-trezor", - "alloy-signer-wallet", - "alloy-sol-types 0.7.1", + "alloy-sol-types 0.7.7", "async-trait", - "aws-config", "aws-sdk-kms", "clap", - "const-hex", "derive_builder 0.20.0", "eyre", - "foundry-common", "foundry-config", - "itertools 0.12.1", "rpassword", "serde", "thiserror", @@ -3216,9 +3292,9 @@ dependencies = [ [[package]] name = "fs4" -version = "0.8.2" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21dabded2e32cd57ded879041205c60a4a4c4bab47bd0fd2fa8b01f30849f02b" +checksum = "f7e180ac76c23b45e767bd7ae9579bc0bb458618c4bc71835926e098e61d15f8" dependencies = [ "rustix", "windows-sys 0.52.0", @@ -3278,16 +3354,6 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" -[[package]] -name = "futures-lite" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" -dependencies = [ - "futures-core", - "pin-project-lite", -] - [[package]] name = "futures-locks" version = "0.7.1" @@ -3306,7 +3372,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.74", ] [[package]] @@ -3377,9 +3443,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "js-sys", @@ -3390,9 +3456,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] name = "glob" @@ -3409,8 +3475,8 @@ dependencies = [ "aho-corasick", "bstr", "log", - "regex-automata 0.4.6", - "regex-syntax 0.8.3", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] @@ -3457,9 +3523,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", "allocator-api2", @@ -3493,6 +3559,12 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +[[package]] +name = "hermit-abi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" + [[package]] name = "hex" version = "0.4.3" @@ -3573,9 +3645,9 @@ dependencies = [ [[package]] name = "http-body" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", "http 1.1.0", @@ -3583,22 +3655,22 @@ dependencies = [ [[package]] name = "http-body-util" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", - "futures-core", + "futures-util", "http 1.1.0", - "http-body 1.0.0", + "http-body 1.0.1", "pin-project-lite", ] [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" [[package]] name = "httpdate" @@ -3608,9 +3680,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.28" +version = "0.14.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" dependencies = [ "bytes", "futures-channel", @@ -3632,15 +3704,15 @@ dependencies = [ [[package]] name = "hyper" -version = "1.3.1" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" +checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" dependencies = [ "bytes", "futures-channel", "futures-util", "http 1.1.0", - "http-body 1.0.0", + "http-body 1.0.1", "httparse", "itoa", "pin-project-lite", @@ -3657,7 +3729,7 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", - "hyper 0.14.28", + "hyper 0.14.30", "log", "rustls 0.21.12", "rustls-native-certs 0.6.3", @@ -3667,19 +3739,21 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.26.0" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0bea761b46ae2b24eb4aef630d8d1c398157b6fc29e6350ecf090a0b70c952c" +checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" dependencies = [ "futures-util", "http 1.1.0", - "hyper 1.3.1", + "hyper 1.4.1", "hyper-util", - "rustls 0.22.4", + "rustls 0.23.12", + "rustls-native-certs 0.7.1", "rustls-pki-types", "tokio", - "tokio-rustls 0.25.0", + "tokio-rustls 0.26.0", "tower-service", + "webpki-roots 0.26.3", ] [[package]] @@ -3689,24 +3763,40 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes", - "hyper 0.14.28", + "hyper 0.14.30", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper 1.4.1", + "hyper-util", "native-tls", "tokio", "tokio-native-tls", + "tower-service", ] [[package]] name = "hyper-util" -version = "0.1.3" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" +checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9" dependencies = [ "bytes", "futures-channel", "futures-util", "http 1.1.0", - "http-body 1.0.0", - "hyper 1.3.1", + "http-body 1.0.1", + "hyper 1.4.1", "pin-project-lite", "socket2", "tokio", @@ -3715,6 +3805,29 @@ dependencies = [ "tracing", ] +[[package]] +name = "iana-time-zone" +version = "0.1.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -3777,14 +3890,27 @@ checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" [[package]] name = "indexmap" -version = "2.2.6" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" dependencies = [ "equivalent", "hashbrown", ] +[[package]] +name = "indicatif" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "763a5a8f45087d6bcea4222e7b72c291a054edf80e4ef6efd2a4979878c7bea3" +dependencies = [ + "console", + "instant", + "number_prefix", + "portable-atomic", + "unicode-width", +] + [[package]] name = "inlinable_string" version = "0.1.15" @@ -3802,40 +3928,28 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ "cfg-if", ] [[package]] name = "interprocess" -version = "1.2.1" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81f2533f3be42fffe3b5e63b71aeca416c1c3bc33e4e27be018521e76b1f38fb" +checksum = "d2f4e4a06d42fab3e85ab1b419ad32b09eab58b901d40c57935ff92db3287a13" dependencies = [ - "blocking", - "cfg-if", + "doctest-file", "futures-core", - "futures-io", - "intmap", "libc", - "once_cell", - "rustc_version 0.4.0", - "spinning", - "thiserror", - "to_method", + "recvmsg", "tokio", - "winapi", + "widestring", + "windows-sys 0.52.0", ] -[[package]] -name = "intmap" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae52f28f45ac2bc96edb7714de995cffc174a395fb0abf5bff453587c980d7b9" - [[package]] name = "ipnet" version = "2.9.0" @@ -3844,15 +3958,21 @@ checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-terminal" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" +checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" dependencies = [ - "hermit-abi", + "hermit-abi 0.4.0", "libc", "windows-sys 0.52.0", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + [[package]] name = "itertools" version = "0.10.5" @@ -3873,9 +3993,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ "either", ] @@ -3888,18 +4008,18 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jobserver" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ "wasm-bindgen", ] @@ -3969,9 +4089,9 @@ dependencies = [ [[package]] name = "keccak-asm" -version = "0.1.0" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb8515fff80ed850aea4a1595f2e519c003e2a00a82fe168ebf5269196caf444" +checksum = "422fbc7ff2f2f5bdffeb07718e5a5324dca72b0c9293d50df4026652385e3314" dependencies = [ "digest 0.10.7", "sha3-asm", @@ -3990,7 +4110,7 @@ dependencies = [ "lalrpop-util", "petgraph", "regex", - "regex-syntax 0.8.3", + "regex-syntax 0.8.4", "string_cache", "term", "tiny-keccak", @@ -4004,23 +4124,23 @@ version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "507460a910eb7b32ee961886ff48539633b788a36b65692b95f225b844c82553" dependencies = [ - "regex-automata 0.4.6", + "regex-automata 0.4.7", ] [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" dependencies = [ - "spin 0.5.2", + "spin 0.9.8", ] [[package]] name = "libc" -version = "0.2.153" +version = "0.2.156" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "a5f43f184355eefb8d17fc948dbecf6c13be3c141f20d834ae842193a448c72a" [[package]] name = "libm" @@ -4034,7 +4154,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "libc", ] @@ -4052,9 +4172,9 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" @@ -4066,17 +4186,23 @@ dependencies = [ "scopeguard", ] +[[package]] +name = "lockfree-object-pool" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9374ef4228402d4b7e403e5838cb880d9ee663314b0a900d5a6aabf0c213552e" + [[package]] name = "log" -version = "0.4.21" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "lru" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" +checksum = "37ee39891760e7d94734f6f63fedc29a2e4a152f836120753a72503f09fcf904" dependencies = [ "hashbrown", ] @@ -4102,9 +4228,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memmap2" @@ -4132,31 +4258,31 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.11" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ + "hermit-abi 0.3.9", "libc", "wasi", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "native-tls" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" dependencies = [ - "lazy_static", "libc", "log", "openssl", @@ -4199,9 +4325,9 @@ dependencies = [ [[package]] name = "num" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3135b08af27d103b0a51f2ae0f8632117b7b185ccf931445affa8df530576a41" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" dependencies = [ "num-bigint", "num-complex", @@ -4213,20 +4339,19 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ - "autocfg", "num-integer", "num-traits", ] [[package]] name = "num-complex" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23c6602fda94a57c990fe0df199a035d83576b496aa29f4e634a8ac6004e68a6" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" dependencies = [ "num-traits", ] @@ -4258,9 +4383,9 @@ dependencies = [ [[package]] name = "num-iter" -version = "0.1.44" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d869c01cc0c455284163fd0092f1f93835385ccab5a98a0dcc497b2f8bf055a9" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" dependencies = [ "autocfg", "num-integer", @@ -4269,11 +4394,10 @@ dependencies = [ [[package]] name = "num-rational" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" dependencies = [ - "autocfg", "num-bigint", "num-integer", "num-traits", @@ -4281,9 +4405,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", "libm", @@ -4295,29 +4419,29 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", ] [[package]] name = "num_enum" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" +checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" dependencies = [ "num_enum_derive", ] [[package]] name = "num_enum_derive" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" +checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.74", ] [[package]] @@ -4328,9 +4452,9 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "object" -version = "0.32.2" +version = "0.36.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9" dependencies = [ "memchr", ] @@ -4368,11 +4492,11 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.64" +version = "0.10.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" +checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cfg-if", "foreign-types", "libc", @@ -4389,7 +4513,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.74", ] [[package]] @@ -4400,9 +4524,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.102" +version = "0.9.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" +checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" dependencies = [ "cc", "libc", @@ -4442,9 +4566,9 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.6.9" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" +checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" dependencies = [ "arrayvec", "bitvec", @@ -4456,27 +4580,21 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.9" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" +checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" dependencies = [ - "proc-macro-crate 2.0.0", + "proc-macro-crate", "proc-macro2", "quote", "syn 1.0.109", ] -[[package]] -name = "parking" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" - [[package]] name = "parking_lot" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -4492,7 +4610,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -4508,9 +4626,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "path-slash" @@ -4560,7 +4678,7 @@ dependencies = [ "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn 2.0.60", + "syn 2.0.74", ] [[package]] @@ -4578,7 +4696,7 @@ version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e459365e590736a54c3fa561947c84837534b8e9af6fc5bf781307e82658fae" dependencies = [ - "base64 0.22.0", + "base64 0.22.1", "serde", ] @@ -4599,9 +4717,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.9" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "311fb059dee1a7b802f036316d790138c613a4e8b180c822e3925a662e9f0c95" +checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" dependencies = [ "memchr", "thiserror", @@ -4610,9 +4728,9 @@ dependencies = [ [[package]] name = "petgraph" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", "indexmap", @@ -4658,7 +4776,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.74", ] [[package]] @@ -4696,7 +4814,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.74", ] [[package]] @@ -4711,17 +4829,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "piper" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" -dependencies = [ - "atomic-waker", - "fastrand", - "futures-io", -] - [[package]] name = "pkcs8" version = "0.10.2" @@ -4738,6 +4845,12 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +[[package]] +name = "portable-atomic" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da544ee218f0d287a911e9c99a39a8c9bc8fcad3cb8db5959940044ecfc67265" + [[package]] name = "powerfmt" version = "0.2.0" @@ -4746,9 +4859,12 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "precomputed-hash" @@ -4758,12 +4874,12 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "prettyplease" -version = "0.2.19" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ac2cf0f2e4f42b49f5ffd07dae8d746508ef7526c13940e5f524012ae6c6550" +checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" dependencies = [ "proc-macro2", - "syn 2.0.60", + "syn 2.0.74", ] [[package]] @@ -4772,40 +4888,21 @@ version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" dependencies = [ - "elliptic-curve", -] - -[[package]] -name = "primitive-types" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" -dependencies = [ - "fixed-hash", - "impl-codec", - "impl-rlp", - "impl-serde", - "scale-info", - "uint", -] - -[[package]] -name = "proc-macro-crate" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" -dependencies = [ - "once_cell", - "toml_edit 0.19.15", + "elliptic-curve", ] [[package]] -name = "proc-macro-crate" -version = "2.0.0" +name = "primitive-types" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" +checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ - "toml_edit 0.20.7", + "fixed-hash", + "impl-codec", + "impl-rlp", + "impl-serde", + "scale-info", + "uint", ] [[package]] @@ -4843,9 +4940,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.81" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] @@ -4858,26 +4955,26 @@ checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.74", "version_check", "yansi 1.0.1", ] [[package]] name = "proptest" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" +checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" dependencies = [ "bit-set", "bit-vec", - "bitflags 2.5.0", + "bitflags 2.6.0", "lazy_static", "num-traits", "rand", "rand_chacha", "rand_xorshift", - "regex-syntax 0.8.3", + "regex-syntax 0.8.4", "rusty-fork", "tempfile", "unarray", @@ -4920,6 +5017,54 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" +[[package]] +name = "quinn" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b22d8e7369034b9a7132bc2008cac12f2013c8132b45e0554e6e20e2617f2156" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls 0.23.12", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba92fb39ec7ad06ca2582c0ca834dfeadcaf06ddfc8e635c80aa7e1c05315fdd" +dependencies = [ + "bytes", + "rand", + "ring 0.17.8", + "rustc-hash", + "rustls 0.23.12", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -4938,13 +5083,14 @@ checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" [[package]] name = "rain-error-decoding" version = "0.1.0" -source = "git+https://github.com/rainlanguage/rain.error?rev=700142c3c73d5cbaea82f1d51af5ce04de5bac6a#700142c3c73d5cbaea82f1d51af5ce04de5bac6a" +source = "git+https://github.com/rainlanguage/rain.error?rev=72d9577fdaf7135113847027ba951f9a43b41827#72d9577fdaf7135113847027ba951f9a43b41827" dependencies = [ "alloy-dyn-abi 0.6.4", "alloy-json-abi 0.6.4", "alloy-primitives 0.6.4", "alloy-sol-types 0.6.4", "ethers", + "getrandom", "once_cell", "reqwest 0.11.27", "serde", @@ -4956,8 +5102,7 @@ dependencies = [ name = "rain-i9r-cli" version = "0.0.1" dependencies = [ - "alloy-primitives 0.6.4", - "alloy-sol-types 0.6.4", + "alloy", "anyhow", "clap", "rain-interpreter-env", @@ -4974,7 +5119,7 @@ dependencies = [ name = "rain-interpreter-env" version = "0.0.0" dependencies = [ - "alloy-primitives 0.6.4", + "alloy", "once_cell", ] @@ -4982,10 +5127,7 @@ dependencies = [ name = "rain-interpreter-eval" version = "0.1.0" dependencies = [ - "alloy-dyn-abi 0.6.4", - "alloy-json-abi 0.6.4", - "alloy-primitives 0.6.4", - "alloy-sol-types 0.6.4", + "alloy", "eyre", "foundry-evm", "once_cell", @@ -5005,17 +5147,15 @@ dependencies = [ name = "rain_interpreter_bindings" version = "0.1.0" dependencies = [ - "alloy-primitives 0.6.4", - "alloy-sol-types 0.6.4", + "alloy", ] [[package]] name = "rain_interpreter_dispair" version = "0.1.0" dependencies = [ + "alloy", "alloy-ethers-typecast", - "alloy-primitives 0.6.4", - "alloy-sol-types 0.6.4", "ethers", "rain_interpreter_bindings", "serde", @@ -5030,9 +5170,8 @@ dependencies = [ name = "rain_interpreter_parser" version = "0.1.0" dependencies = [ + "alloy", "alloy-ethers-typecast", - "alloy-primitives 0.6.4", - "alloy-sol-types 0.6.4", "ethers", "rain_interpreter_bindings", "rain_interpreter_dispair", @@ -5101,13 +5240,19 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "recvmsg" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3edd4d5d42c92f0a659926464d4cce56b562761267ecf0f469d85b7de384175" + [[package]] name = "redox_syscall" -version = "0.5.1" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", ] [[package]] @@ -5123,14 +5268,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.4" +version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.6", - "regex-syntax 0.8.3", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] @@ -5144,20 +5289,20 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.3", + "regex-syntax 0.8.4", ] [[package]] name = "regex-lite" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30b661b2f27137bdbc16f00eda72866a92bb28af1753ffbd56744fb6e2e9cd8e" +checksum = "53a49587ad06b26609c52e423de037e7f57f20d53535d66e08c695f347df952a" [[package]] name = "regex-syntax" @@ -5167,9 +5312,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "reqwest" @@ -5185,9 +5330,9 @@ dependencies = [ "h2", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.28", + "hyper 0.14.30", "hyper-rustls 0.24.2", - "hyper-tls", + "hyper-tls 0.5.0", "ipnet", "js-sys", "log", @@ -5201,7 +5346,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", + "sync_wrapper 0.1.2", "system-configuration", "tokio", "tokio-native-tls", @@ -5217,52 +5362,56 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" +checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" dependencies = [ - "base64 0.22.0", + "base64 0.22.1", "bytes", "futures-channel", "futures-core", "futures-util", "http 1.1.0", - "http-body 1.0.0", + "http-body 1.0.1", "http-body-util", - "hyper 1.3.1", - "hyper-rustls 0.26.0", + "hyper 1.4.1", + "hyper-rustls 0.27.2", + "hyper-tls 0.6.0", "hyper-util", "ipnet", "js-sys", "log", "mime", + "native-tls", "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.22.4", - "rustls-native-certs 0.7.0", - "rustls-pemfile 2.1.2", + "quinn", + "rustls 0.23.12", + "rustls-native-certs 0.7.1", + "rustls-pemfile 2.1.3", "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", + "sync_wrapper 1.0.1", "tokio", - "tokio-rustls 0.25.0", + "tokio-native-tls", + "tokio-rustls 0.26.0", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots 0.26.1", + "webpki-roots 0.26.3", "winreg 0.52.0", ] [[package]] name = "revm" -version = "8.0.0" +version = "10.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72a454c1c650b2b2e23f0c461af09e6c31e1d15e1cbebe905a701c46b8a50afc" +checksum = "355bde4e21578c241f9379fbb344a73d254969b5007239115e094dda1511cd34" dependencies = [ "auto_impl", "cfg-if", @@ -5275,13 +5424,13 @@ dependencies = [ [[package]] name = "revm-inspectors" -version = "0.1.0" -source = "git+https://github.com/paradigmxyz/evm-inspectors?rev=813d7e7#813d7e73a090d426935e63d9308bdd2c945a58c4" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3aede4aaaa0c5b446ce1a951629d7929ea48473a0f307bd8d999ecdeb55c420b" dependencies = [ - "alloy-primitives 0.7.1", + "alloy-primitives 0.7.7", "alloy-rpc-types", - "alloy-rpc-types-trace", - "alloy-sol-types 0.7.1", + "alloy-sol-types 0.7.7", "anstyle", "colorchoice", "revm", @@ -5292,9 +5441,9 @@ dependencies = [ [[package]] name = "revm-interpreter" -version = "4.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d322f2730cd300e99d271a1704a2dfb8973d832428f5aa282aaa40e2473b5eec" +checksum = "23dfd24faa3cbbd96e0976103d1e174d6559b8036730f70415488ee21870d578" dependencies = [ "revm-primitives", "serde", @@ -5302,14 +5451,16 @@ dependencies = [ [[package]] name = "revm-precompile" -version = "6.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "931f692f3f4fc72ec39d5d270f8e9d208c4a6008de7590ee96cf948e3b6d3f8d" +checksum = "1c669c9b105dbb41133c17bf7f34d29368e358a7fee8fcc289e90dbfb024dfc4" dependencies = [ "aurora-engine-modexp", + "blst", "c-kzg", "k256", "once_cell", + "p256", "revm-primitives", "ripemd", "secp256k1", @@ -5319,20 +5470,22 @@ dependencies = [ [[package]] name = "revm-primitives" -version = "3.1.1" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbbc9640790cebcb731289afb7a7d96d16ad94afeb64b5d0b66443bd151e79d6" +checksum = "902184a7a781550858d4b96707098da357429f1e4545806fd5b589f455555cf2" dependencies = [ - "alloy-primitives 0.7.1", + "alloy-primitives 0.7.7", "auto_impl", - "bitflags 2.5.0", + "bitflags 2.6.0", "bitvec", "c-kzg", "cfg-if", + "derive_more", "dyn-clone", "enumn", "hashbrown", "hex", + "once_cell", "serde", ] @@ -5430,9 +5583,9 @@ dependencies = [ [[package]] name = "ruint" -version = "1.12.1" +version = "1.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f308135fef9fc398342da5472ce7c484529df23743fb7c734e0f3d472971e62" +checksum = "2c3cc4c2511671f327125da14133d0c5c5d137f006a1017a16f557bc85b16286" dependencies = [ "alloy-rlp", "arbitrary", @@ -5455,9 +5608,9 @@ dependencies = [ [[package]] name = "ruint-macro" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f86854cf50259291520509879a5c294c3c9a4c334e9ff65071c51e42ef1e2343" +checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" [[package]] name = "rusb" @@ -5471,15 +5624,15 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" -version = "1.1.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustc-hex" @@ -5502,7 +5655,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.22", + "semver 1.0.23", ] [[package]] @@ -5511,7 +5664,7 @@ version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", @@ -5532,14 +5685,14 @@ dependencies = [ [[package]] name = "rustls" -version = "0.22.4" +version = "0.23.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" +checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" dependencies = [ - "log", + "once_cell", "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.3", + "rustls-webpki 0.102.6", "subtle", "zeroize", ] @@ -5558,12 +5711,12 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792" +checksum = "a88d6d420651b496bdd98684116959239430022a115c1240e6c3993be0b15fba" dependencies = [ "openssl-probe", - "rustls-pemfile 2.1.2", + "rustls-pemfile 2.1.3", "rustls-pki-types", "schannel", "security-framework", @@ -5580,19 +5733,19 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.1.2" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" dependencies = [ - "base64 0.22.0", + "base64 0.22.1", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.5.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "beb461507cee2c2ff151784c52762cf4d9ff6a61f3e80968600ed24fa837fa54" +checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" [[package]] name = "rustls-webpki" @@ -5606,9 +5759,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.3" +version = "0.102.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3bce581c0dd41bce533ce695a1437fa16a7ab5ac3ccfa99fe1a620a7885eabf" +checksum = "8e6b52d4fda176fd835fdc55a835d4a89b8499cad995885a21149d5ad62f852e" dependencies = [ "ring 0.17.8", "rustls-pki-types", @@ -5617,9 +5770,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.15" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "rusty-fork" @@ -5635,9 +5788,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "salsa20" @@ -5659,9 +5812,9 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.11.2" +version = "2.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c453e59a955f81fb62ee5d596b450383d699f152d350e9d23a0db2adb78e4c0" +checksum = "eca070c12893629e2cc820a9761bedf6ce1dcddc9852984d1dc734b8bd9bd024" dependencies = [ "cfg-if", "derive_more", @@ -5671,11 +5824,11 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.11.2" +version = "2.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18cf6c6447f813ef19eb450e985bcce6705f9ce7660db221b59093d15c79c4b7" +checksum = "2d35494501194174bda522a32605929eefc9ecf7e0a326c26db1fdd85881eb62" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate", "proc-macro2", "quote", "syn 1.0.109", @@ -5734,9 +5887,9 @@ dependencies = [ [[package]] name = "secp256k1" -version = "0.28.2" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" +checksum = "0e0cc0f1cf93f4969faf3ea1c7d8a9faed25918d96affa959720823dfe86d4f3" dependencies = [ "rand", "secp256k1-sys", @@ -5744,20 +5897,20 @@ dependencies = [ [[package]] name = "secp256k1-sys" -version = "0.9.2" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d1746aae42c19d583c3c1a8c646bfad910498e2051c551a7f2e3c0c9fbb7eb" +checksum = "1433bd67156263443f14d603720b082dd3121779323fce20cba2aa07b874bc1b" dependencies = [ "cc", ] [[package]] name = "security-framework" -version = "2.10.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "770452e37cad93e0a50d5abc3990d2bc351c36d0328f86cefec2f2fb206eaef6" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "core-foundation", "core-foundation-sys", "libc", @@ -5766,9 +5919,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.10.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41f3cc463c0ef97e11c3461a9d3787412d30e8e7eb907c79180c4a57bf7c04ef" +checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" dependencies = [ "core-foundation-sys", "libc", @@ -5785,9 +5938,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" dependencies = [ "serde", ] @@ -5815,41 +5968,42 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.199" +version = "1.0.208" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c9f6e76df036c77cd94996771fb40db98187f096dd0b9af39c6c6e452ba966a" +checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" dependencies = [ "serde_derive", ] [[package]] name = "serde_bytes" -version = "0.11.14" +version = "0.11.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" +checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" dependencies = [ "serde", ] [[package]] name = "serde_derive" -version = "1.0.199" +version = "1.0.208" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11bd257a6541e141e42ca6d24ae26f7714887b47e89aa739099104c7e4d3b7fc" +checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.74", ] [[package]] name = "serde_json" -version = "1.0.116" +version = "1.0.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" +checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed" dependencies = [ "indexmap", "itoa", + "memchr", "ryu", "serde", ] @@ -5866,9 +6020,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.5" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" dependencies = [ "serde", ] @@ -5919,9 +6073,9 @@ dependencies = [ [[package]] name = "sha3-asm" -version = "0.1.0" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bac61da6b35ad76b195eb4771210f947734321a8d81d7738e1580d953bc7a15e" +checksum = "57d79b758b7cb2085612b11a235055e485605a5103faccdd633f35bd7aee69dd" dependencies = [ "cc", "cfg-if", @@ -5942,6 +6096,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook-registry" version = "1.4.2" @@ -5961,6 +6121,12 @@ dependencies = [ "rand_core", ] +[[package]] +name = "simd-adler32" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + [[package]] name = "simple_asn1" version = "0.6.2" @@ -5996,9 +6162,9 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", "windows-sys 0.52.0", @@ -6030,15 +6196,6 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -[[package]] -name = "spinning" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d4f0e86297cad2658d92a707320d87bf4e6ae1050287f51d19b67ef3f153a7b" -dependencies = [ - "lock_api", -] - [[package]] name = "spki" version = "0.7.3" @@ -6082,24 +6239,24 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" -version = "0.26.2" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ "strum_macros", ] [[package]] name = "strum_macros" -version = "0.26.2" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2", "quote", "rustversion", - "syn 2.0.60", + "syn 2.0.74", ] [[package]] @@ -6117,9 +6274,9 @@ dependencies = [ [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "svm-rs" @@ -6132,7 +6289,7 @@ dependencies = [ "hex", "once_cell", "reqwest 0.11.27", - "semver 1.0.22", + "semver 1.0.23", "serde", "serde_json", "sha2", @@ -6143,35 +6300,35 @@ dependencies = [ [[package]] name = "svm-rs" -version = "0.5.2" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c7a55b859b986daa02c731cd07758d84b1db852665e45c5cfa6698c41d17cb" +checksum = "af5910befd515534a92e9424f250d952fe6f6dba6a92bd001dfeba1fb4a2f87c" dependencies = [ "const-hex", "dirs", "fs4", "once_cell", - "reqwest 0.12.4", - "semver 1.0.22", + "reqwest 0.12.5", + "semver 1.0.23", "serde", "serde_json", "sha2", "thiserror", "url", - "zip 1.1.1", + "zip 2.1.6", ] [[package]] name = "svm-rs-builds" -version = "0.5.2" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bb4806c96207e7cde40fc238f9a1d570f3090f850a742e1e96665440615a31" +checksum = "3d5ea000fdbeab0b2739315f9093c75ea63030e5c44f92daa72401d11b48adda" dependencies = [ "build_const", "const-hex", - "semver 1.0.22", + "semver 1.0.23", "serde_json", - "svm-rs 0.5.2", + "svm-rs 0.5.4", ] [[package]] @@ -6187,9 +6344,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.60" +version = "2.0.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" +checksum = "1fceb41e3d546d0bd83421d3409b1460cc7444cd389341a4c880fe7a042cb3d7" dependencies = [ "proc-macro2", "quote", @@ -6205,19 +6362,19 @@ dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.74", ] [[package]] name = "syn-solidity" -version = "0.7.1" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70aba06097b6eda3c15f6eebab8a6339e121475bcf08bbe6758807e716c372a1" +checksum = "c837dc8852cb7074e46b444afb81783140dab12c58867b49fb3898fbafedf7ea" dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.74", ] [[package]] @@ -6226,6 +6383,12 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "sync_wrapper" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" + [[package]] name = "system-configuration" version = "0.5.1" @@ -6255,14 +6418,15 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.10.1" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" dependencies = [ "cfg-if", "fastrand", + "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -6288,22 +6452,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.59" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.59" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.74", ] [[package]] @@ -6367,9 +6531,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -6380,40 +6544,33 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" -[[package]] -name = "to_method" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7c4ceeeca15c8384bbc3e011dbd8fccb7f068a440b752b7d9b32ceb0ca0e2e8" - [[package]] name = "tokio" -version = "1.37.0" +version = "1.39.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1" dependencies = [ "backtrace", "bytes", "libc", "mio", - "num_cpus", "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.74", ] [[package]] @@ -6438,11 +6595,11 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.22.4", + "rustls 0.23.12", "rustls-pki-types", "tokio", ] @@ -6470,69 +6627,61 @@ dependencies = [ "rustls 0.21.12", "tokio", "tokio-rustls 0.24.1", - "tungstenite", + "tungstenite 0.20.1", "webpki-roots 0.25.4", ] +[[package]] +name = "tokio-tungstenite" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6989540ced10490aaf14e6bad2e3d33728a2813310a0c71d1574304c49631cd" +dependencies = [ + "futures-util", + "log", + "rustls 0.23.12", + "rustls-pki-types", + "tokio", + "tokio-rustls 0.26.0", + "tungstenite 0.23.0", + "webpki-roots 0.26.3", +] + [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", - "futures-io", "futures-sink", "pin-project-lite", "tokio", - "tracing", ] [[package]] name = "toml" -version = "0.8.12" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" dependencies = [ "indexmap", "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.12", + "toml_edit 0.22.20", ] [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" dependencies = [ "serde", ] -[[package]] -name = "toml_edit" -version = "0.19.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" -dependencies = [ - "indexmap", - "toml_datetime", - "winnow 0.5.40", -] - -[[package]] -name = "toml_edit" -version = "0.20.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" -dependencies = [ - "indexmap", - "toml_datetime", - "winnow 0.5.40", -] - [[package]] name = "toml_edit" version = "0.21.1" @@ -6546,15 +6695,15 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.12" +version = "0.22.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3328d4f68a705b2a4498da1d580585d39a6510f98318a2cec3018a7ec61ddef" +checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" dependencies = [ "indexmap", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.7", + "winnow 0.6.18", ] [[package]] @@ -6575,15 +6724,15 @@ dependencies = [ [[package]] name = "tower-layer" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -6605,7 +6754,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.74", ] [[package]] @@ -6697,6 +6846,26 @@ dependencies = [ "utf-8", ] +[[package]] +name = "tungstenite" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e2ce1e47ed2994fd43b04c8f618008d4cabdd5ee34027cf14f9d918edd9c8" +dependencies = [ + "byteorder", + "bytes", + "data-encoding", + "http 1.1.0", + "httparse", + "log", + "rand", + "rustls 0.23.12", + "rustls-pki-types", + "sha1", + "thiserror", + "utf-8", +] + [[package]] name = "typenum" version = "1.17.0" @@ -6769,9 +6938,9 @@ dependencies = [ [[package]] name = "unicode-width" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "unicode-xid" @@ -6793,21 +6962,15 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", "percent-encoding", ] -[[package]] -name = "urlencoding" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" - [[package]] name = "utf-8" version = "0.7.6" @@ -6816,9 +6979,9 @@ checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" @@ -6832,9 +6995,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" +checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" [[package]] name = "valuable" @@ -6850,9 +7013,9 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "vsimd" @@ -6896,34 +7059,35 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.74", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.42" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" dependencies = [ "cfg-if", "js-sys", @@ -6933,9 +7097,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -6943,28 +7107,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.74", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" dependencies = [ "js-sys", "wasm-bindgen", @@ -6978,13 +7142,19 @@ checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "webpki-roots" -version = "0.26.1" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3de34ae270483955a94f4b21bdaaeb83d508bb84a01435f393818edb0012009" +checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" dependencies = [ "rustls-pki-types", ] +[[package]] +name = "widestring" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" + [[package]] name = "winapi" version = "0.3.9" @@ -7003,11 +7173,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -7016,6 +7186,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -7031,7 +7210,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -7051,18 +7239,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -7073,9 +7261,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -7085,9 +7273,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -7097,15 +7285,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -7115,9 +7303,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -7127,9 +7315,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -7139,9 +7327,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -7151,9 +7339,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" @@ -7166,9 +7354,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.7" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14b9415ee827af173ebb3f15f9083df5a122eb93572ec28741fb153356ea2578" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" dependencies = [ "memchr", ] @@ -7221,12 +7409,6 @@ dependencies = [ "tap", ] -[[package]] -name = "xmlparser" -version = "0.13.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66fee0b777b0f5ac1c69bb06d361268faafa61cd4682ae064a171c16c433e9e4" - [[package]] name = "yansi" version = "0.5.1" @@ -7244,29 +7426,30 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ + "byteorder", "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.74", ] [[package]] name = "zeroize" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" dependencies = [ "zeroize_derive", ] @@ -7279,7 +7462,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.74", ] [[package]] @@ -7304,15 +7487,33 @@ dependencies = [ [[package]] name = "zip" -version = "1.1.1" +version = "2.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2655979068a1f8fa91cb9e8e5b9d3ee54d18e0ddc358f2f4a395afc0929a84b" +checksum = "40dd8c92efc296286ce1fbd16657c5dbefff44f1b4ca01cc5f517d8b7b3d3e2e" dependencies = [ "arbitrary", - "byteorder", "crc32fast", "crossbeam-utils", + "displaydoc", "flate2", + "indexmap", + "memchr", + "thiserror", + "zopfli", +] + +[[package]] +name = "zopfli" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5019f391bac5cf252e93bbcc53d039ffd62c7bfb7c150414d61369afe57e946" +dependencies = [ + "bumpalo", + "crc32fast", + "lockfree-object-pool", + "log", + "once_cell", + "simd-adler32", ] [[package]] @@ -7336,9 +7537,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.10+zstd.1.5.6" +version = "2.0.13+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" +checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" dependencies = [ "cc", "pkg-config", diff --git a/Cargo.toml b/Cargo.toml index 499f8dc6d..0e670d008 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,15 +8,14 @@ license = "CAL-1.0" homepage = "https://github.com/rainprotocol/rain.interpreter" [workspace.dependencies] -alloy-primitives = "0.6.3" -alloy-json-abi = "0.6.3" -alloy-dyn-abi = "0.6.3" -alloy-sol-types = { version = "0.6.3", features = ["json"] } +alloy = { version = "0.1.4", features = ["sol-types", "json", "json-abi"] } anyhow = "1.0.70" clap = { version = "4.2.5", features = ["cargo", "derive"] } ethers = { version = "2.0.14", default-features = false } -foundry-evm = { git = "https://github.com/foundry-rs/foundry", rev = "26e6e57527497a90af1a5409484c01b5e7702a02" } -revm = { version = "8", default-features = false, features = [ +foundry-evm = { git = "https://github.com/foundry-rs/foundry", rev = "72e44fb87c38b2acfa2b0b136fc1bc833f71e674" } +foundry-fork-db = "0.1.0" +foundry-block-explorers = "0.5.0" +revm = { version = "10.0.0", default-features = false, features = [ "std", "serde", "memory_limit", @@ -29,15 +28,14 @@ serde = "1.0.160" serde_bytes = "0.11.9" serde_json = "1.0.112" thiserror = "1.0.56" -tokio = { version = "1.28.0", features = ["full"] } tracing = "0.1.37" tracing-subscriber = "0.3.17" reqwest = { version = "0.11.17", features = ["json"] } once_cell = "1.17.1" -alloy-ethers-typecast = { git = "https://github.com/rainlanguage/alloy-ethers-typecast", rev = "cbdedb77fb1994a18ceb47e72786f8b32b670669" } +alloy-ethers-typecast = { git = "https://github.com/rainlanguage/alloy-ethers-typecast", rev = "0881930a22e84db49ba955c5b88e790e1266ac66" } rain-interpreter-env = { path = "crates/env" } eyre = "0.6" -rain-error-decoding = { git = "https://github.com/rainlanguage/rain.error", rev = "700142c3c73d5cbaea82f1d51af5ce04de5bac6a" } +rain-error-decoding = { git = "https://github.com/rainlanguage/rain.error", rev = "72d9577fdaf7135113847027ba951f9a43b41827" } [workspace.dependencies.rain_interpreter_parser] path = "crates/parser" diff --git a/crates/bindings/Cargo.toml b/crates/bindings/Cargo.toml index 3ca8d13d8..c44579cba 100644 --- a/crates/bindings/Cargo.toml +++ b/crates/bindings/Cargo.toml @@ -8,5 +8,4 @@ homepage.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -alloy-sol-types = { workspace = true } -alloy-primitives = { workspace = true } +alloy = { workspace = true} \ No newline at end of file diff --git a/crates/bindings/src/lib.rs b/crates/bindings/src/lib.rs index bf640a73d..f6fdc26c9 100644 --- a/crates/bindings/src/lib.rs +++ b/crates/bindings/src/lib.rs @@ -1,4 +1,4 @@ -use alloy_sol_types::sol; +use alloy::sol; sol!( #![sol(all_derives = true)] diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index d704fbba1..d7ff5f7fb 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -15,9 +15,8 @@ anyhow = { workspace = true } clap = { workspace = true } serde = { workspace = true } serde_bytes = { workspace = true } -tokio = { workspace = true } +tokio = { version = "1.28.0", features = ["full"] } tracing = { workspace = true } tracing-subscriber = { workspace = true, features = ['env-filter'] } -alloy-primitives = { workspace = true } -alloy-sol-types = { workspace = true } +alloy = { workspace = true } rain-interpreter-env = { workspace = true } \ No newline at end of file diff --git a/crates/cli/src/commands/eval.rs b/crates/cli/src/commands/eval.rs index 12c0c0e4b..b1cdfef88 100644 --- a/crates/cli/src/commands/eval.rs +++ b/crates/cli/src/commands/eval.rs @@ -1,7 +1,7 @@ use crate::execute::Execute; use crate::fork::NewForkedEvmCliArgs; use crate::output::SupportedOutputEncoding; -use alloy_primitives::{Address, U256}; +use alloy::primitives::{Address, U256}; use anyhow::anyhow; use anyhow::Context; use anyhow::Result; @@ -134,7 +134,7 @@ mod tests { fork_block_number: Some(*CI_FORK_SEPOLIA_BLOCK_NUMBER), }, fork_eval_args: ForkEvalCliArgs { - rainlang_string: r"_: int-add(10 2), _: context<0 0>(), _:context<0 1>();".into(), + rainlang_string: r"_: add(10 2), _: context<0 0>(), _:context<0 1>();".into(), source_index: 0, deployer: *CI_FORK_SEPOLIA_DEPLOYER_ADDRESS, namespace: "0x123".into(), diff --git a/crates/cli/src/commands/parse.rs b/crates/cli/src/commands/parse.rs index 7d2f6d11e..f22e2517a 100644 --- a/crates/cli/src/commands/parse.rs +++ b/crates/cli/src/commands/parse.rs @@ -1,7 +1,7 @@ use crate::execute::Execute; use crate::fork::NewForkedEvmCliArgs; use crate::output::SupportedOutputEncoding; -use alloy_primitives::Address; +use alloy::primitives::Address; use anyhow::anyhow; use anyhow::Result; use clap::Args; diff --git a/crates/cli/src/fork.rs b/crates/cli/src/fork.rs index 15c02ab98..a286ec321 100644 --- a/crates/cli/src/fork.rs +++ b/crates/cli/src/fork.rs @@ -1,4 +1,4 @@ -use alloy_primitives::BlockNumber; +use alloy::primitives::BlockNumber; use clap::Args; use rain_interpreter_eval::fork::NewForkedEvm; diff --git a/crates/cli/src/output.rs b/crates/cli/src/output.rs index 79d954d34..137fe54a9 100644 --- a/crates/cli/src/output.rs +++ b/crates/cli/src/output.rs @@ -16,7 +16,7 @@ pub fn output( let encoded_bytes: &[u8] = match output_encoding { SupportedOutputEncoding::Binary => bytes, SupportedOutputEncoding::Hex => { - hex_encoded = alloy_primitives::hex::encode_prefixed(bytes); + hex_encoded = alloy::primitives::hex::encode_prefixed(bytes); hex_encoded.as_bytes() } }; diff --git a/crates/dispair/Cargo.toml b/crates/dispair/Cargo.toml index 161d6a4bb..6369b04ce 100644 --- a/crates/dispair/Cargo.toml +++ b/crates/dispair/Cargo.toml @@ -11,15 +11,19 @@ alloy-ethers-typecast = { workspace = true } rain_interpreter_bindings = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } -tokio = { workspace = true } -alloy-primitives = {workspace = true} -alloy-sol-types = { workspace = true } +tracing = { workspace = true } +tracing-subscriber = { workspace = true } +alloy = { workspace = true } ethers = { workspace = true, features = [ "legacy", ] } -tracing = { workspace = true } -tracing-subscriber = { workspace = true } thiserror = { workspace = true } +[target.'cfg(not(target_family = "wasm"))'.dependencies] +tokio = { version = "1.28.0", features = ["full"] } + +[target.'cfg(target_family = "wasm")'.dependencies] +tokio = { version = "1.28.0", features = ["sync", "macros", "io-util", "rt", "time"] } + [package.metadata.docs.rs] all-features = true diff --git a/crates/dispair/src/lib.rs b/crates/dispair/src/lib.rs index b10bdd034..199e93451 100644 --- a/crates/dispair/src/lib.rs +++ b/crates/dispair/src/lib.rs @@ -1,8 +1,8 @@ +use alloy::primitives::*; use alloy_ethers_typecast::transaction::{ ReadContractParametersBuilder, ReadContractParametersBuilderError, ReadableClient, ReadableClientError, }; -use alloy_primitives::*; use ethers::providers::JsonRpcClient; use rain_interpreter_bindings::DeployerISP; use thiserror::Error; @@ -73,7 +73,7 @@ impl DISPair { #[cfg(test)] mod tests { use super::*; - use alloy_primitives::Address; + use alloy::primitives::Address; use ethers::providers::{MockProvider, MockResponse, Provider}; use serde_json::json; use tracing_subscriber::FmtSubscriber; diff --git a/crates/env/Cargo.toml b/crates/env/Cargo.toml index 798794a26..d1d2e6954 100644 --- a/crates/env/Cargo.toml +++ b/crates/env/Cargo.toml @@ -7,4 +7,4 @@ homepage.workspace = true [dependencies] once_cell = { workspace = true } -alloy-primitives = {workspace = true} +alloy = { workspace = true } diff --git a/crates/env/src/lib.rs b/crates/env/src/lib.rs index a6b86dfe1..243ee0efb 100644 --- a/crates/env/src/lib.rs +++ b/crates/env/src/lib.rs @@ -1,4 +1,4 @@ -use alloy_primitives::{Address, BlockNumber}; +use alloy::primitives::{Address, BlockNumber}; use once_cell::sync::Lazy; pub const CI_DEPLOY_SEPOLIA_RPC_URL: &str = env!( diff --git a/crates/eval/Cargo.toml b/crates/eval/Cargo.toml index 92485b598..c58bce1cb 100644 --- a/crates/eval/Cargo.toml +++ b/crates/eval/Cargo.toml @@ -6,14 +6,9 @@ license.workspace = true homepage.workspace = true [dependencies] +alloy = { workspace = true } thiserror = { workspace = true } -alloy-primitives = {workspace = true} rain_interpreter_bindings = { workspace = true } -alloy-sol-types = { workspace = true } -alloy-json-abi = { workspace = true } -alloy-dyn-abi = { workspace = true } -foundry-evm = { workspace = true } -revm = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } reqwest = { workspace = true } @@ -21,7 +16,11 @@ once_cell = { workspace = true } eyre = { workspace = true } rain-error-decoding = { workspace = true } +[target.'cfg(not(target_family = "wasm"))'.dependencies] +foundry-evm = { workspace = true } +revm = { workspace = true } + [dev-dependencies] -tokio = { workspace = true } +tokio = { version = "1.28.0", features = ["full"] } tracing = { workspace = true } rain-interpreter-env = { workspace = true } diff --git a/crates/eval/src/dispatch.rs b/crates/eval/src/dispatch.rs index bf08f11ff..2d2c59efa 100644 --- a/crates/eval/src/dispatch.rs +++ b/crates/eval/src/dispatch.rs @@ -1,4 +1,4 @@ -use alloy_primitives::{Address, U256}; +use alloy::primitives::{Address, U256}; use rain_interpreter_bindings::IInterpreterV2::EncodedDispatch; #[derive(Debug, PartialEq)] diff --git a/crates/eval/src/error.rs b/crates/eval/src/error.rs index 20ca6b4e4..b2a6d2d40 100644 --- a/crates/eval/src/error.rs +++ b/crates/eval/src/error.rs @@ -1,4 +1,5 @@ -use alloy_primitives::ruint::FromUintError; +use alloy::primitives::ruint::FromUintError; +#[cfg(not(target_family = "wasm"))] use foundry_evm::executors::RawCallResult; use rain_error_decoding::{AbiDecodeFailedErrors, AbiDecodedErrorType}; use thiserror::Error; @@ -7,6 +8,7 @@ use thiserror::Error; pub enum ForkCallError { #[error("Executor error: {0}")] ExecutorError(String), + #[cfg(not(target_family = "wasm"))] #[error("Call failed: {:#?}", .0)] Failed(RawCallResult), #[error("Typed error: {0}")] @@ -23,6 +25,7 @@ pub enum ForkCallError { Eyre(#[from] eyre::Report), } +#[cfg(not(target_family = "wasm"))] impl From for ForkCallError { fn from(value: RawCallResult) -> Self { Self::Failed(value) diff --git a/crates/eval/src/eval.rs b/crates/eval/src/eval.rs index 6c2763b40..9dd08b047 100644 --- a/crates/eval/src/eval.rs +++ b/crates/eval/src/eval.rs @@ -1,6 +1,6 @@ use crate::error::ForkCallError; use crate::fork::{ForkTypedReturn, Forker}; -use alloy_primitives::{Address, U256}; +use alloy::primitives::{Address, U256}; use rain_interpreter_bindings::DeployerISP::{iInterpreterCall, iStoreCall}; use rain_interpreter_bindings::IInterpreterStoreV1::FullyQualifiedNamespace; use rain_interpreter_bindings::IInterpreterV3::eval3Call; @@ -40,7 +40,7 @@ impl Forker { /// /// * `rainlang_string` - The Rainlang string to parse. /// * `deployer` - The address of the deployer. Must be deployed before the - /// fork's current block. + /// fork's current block. /// /// # Returns /// @@ -56,7 +56,7 @@ impl Forker { } = args; let parse_call = parse2Call { - data: rainlang_string.as_bytes().to_vec(), + data: rainlang_string.as_bytes().to_vec().into(), }; let parse_result = self @@ -134,6 +134,7 @@ impl Forker { #[cfg(test)] mod tests { + use alloy::primitives::utils::parse_ether; use rain_interpreter_env::{ CI_DEPLOY_SEPOLIA_RPC_URL, CI_FORK_SEPOLIA_BLOCK_NUMBER, CI_FORK_SEPOLIA_DEPLOYER_ADDRESS, }; @@ -153,21 +154,14 @@ mod tests { let fork = Forker::new_with_fork(args, None, None).await.unwrap(); let res = fork .fork_parse(ForkParseArgs { - rainlang_string: r"_: int-add(1 2);".to_owned(), + rainlang_string: r"_: add(1 2);".to_owned(), deployer, decode_errors: true, }) .await .unwrap(); - let expected_bytes: Vec = vec![ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 1, 0, 0, 3, 2, 0, 1, 1, 16, 0, 1, 1, 16, 0, 0, 61, - 18, 0, 0, - ]; + let expected_bytes: Vec = alloy::hex::decode("0x00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000001bc16d674ec8000000000000000000000000000000000000000000000000000000000000000000130100000302000101100001011000002b120000").unwrap(); assert_eq!(res.typed_return.bytecode, expected_bytes); } @@ -181,7 +175,7 @@ mod tests { let fork = Forker::new_with_fork(args, None, None).await.unwrap(); let res = fork .fork_eval(ForkEvalArgs { - rainlang_string: r"_: int-add(1 2);".into(), + rainlang_string: r"_: add(1 2);".into(), source_index: 0, deployer, namespace: FullyQualifiedNamespace::default(), @@ -192,7 +186,7 @@ mod tests { .unwrap(); // stack - let expected_stack = vec![U256::from(3)]; + let expected_stack = vec![parse_ether("3").unwrap()]; assert_eq!(res.typed_return.stack, expected_stack); // storage writes @@ -201,7 +195,7 @@ mod tests { // stack in the trace for source index 0 let mut expected_stack_trace = vec![0u8, 0u8, 0u8, 0u8]; - expected_stack_trace.append(&mut U256::from(3).to_be_bytes_vec()); + expected_stack_trace.append(&mut parse_ether("3").unwrap().to_be_bytes_vec()); let source_index_zero_trace = res.raw.traces.unwrap().into_nodes()[1].to_owned().trace; assert_eq!(source_index_zero_trace.data, expected_stack_trace); @@ -229,7 +223,7 @@ mod tests { let handle = tokio::spawn(async move { fork_clone .fork_eval(ForkEvalArgs { - rainlang_string: r"_: int-add(1 2);".into(), + rainlang_string: r"_: add(1 2);".into(), source_index: 0, deployer, namespace: FullyQualifiedNamespace::default(), @@ -244,7 +238,7 @@ mod tests { for handle in handles { let res = handle.await.unwrap(); - assert_eq!(res.typed_return.stack, vec![U256::from(3)]); + assert_eq!(res.typed_return.stack, vec![parse_ether("3").unwrap()]); } } } diff --git a/crates/eval/src/fork.rs b/crates/eval/src/fork.rs index f18dc7213..357b11260 100644 --- a/crates/eval/src/fork.rs +++ b/crates/eval/src/fork.rs @@ -1,6 +1,6 @@ use crate::error::ForkCallError; -use alloy_primitives::{Address, BlockNumber, U256}; -use alloy_sol_types::SolCall; +use alloy::primitives::{Address, BlockNumber, U256}; +use alloy::sol_types::SolCall; use foundry_evm::{ backend::{Backend, DatabaseExt, LocalForkId}, executors::{Executor, ExecutorBuilder, RawCallResult}, @@ -10,7 +10,7 @@ use foundry_evm::{ use rain_error_decoding::AbiDecodedErrorType; use revm::{ interpreter::InstructionResult, - primitives::{Address as Addr, Bytes, Env, HashSet, SpecId, U256 as Uint256}, + primitives::{Address as Addr, Bytes, Env, HashSet, SpecId}, JournaledState, }; use std::{any::type_name, collections::HashMap}; @@ -113,7 +113,7 @@ impl Forker { let builder = if let Some(gas) = gas_limit { ExecutorBuilder::default() - .gas_limit(Uint256::from(gas)) + .gas_limit(gas) .inspectors(|stack| stack.trace(true).debug(false)) } else { ExecutorBuilder::default().inspectors(|stack| stack.trace(true).debug(false)) @@ -146,12 +146,12 @@ impl Forker { } = args; let fork_id = ForkId::new(&fork_url, fork_block_number); if let Some((local_fork_id, spec_id, _)) = self.forks.get(&fork_id) { - if self.executor.backend.is_active_fork(*local_fork_id) { + if self.executor.backend().is_active_fork(*local_fork_id) { Ok(()) } else { let mut journaled_state = JournaledState::new(*spec_id, HashSet::new()); self.executor - .backend + .backend_mut() .select_fork( *local_fork_id, &mut env.unwrap_or_default(), @@ -191,7 +191,7 @@ impl Forker { ); let default_env = create_fork.env.clone(); self.executor - .backend + .backend_mut() .create_select_fork( create_fork, &mut env.unwrap_or(default_env), @@ -332,7 +332,7 @@ impl Forker { let result = self .executor - .call_raw_committing( + .transact_raw( Addr::from_slice(from_address), Addr::from_slice(to_address), Bytes::copy_from_slice(calldata), @@ -342,7 +342,7 @@ impl Forker { // remove to_address from persisted accounts self.executor - .backend + .backend_mut() .remove_persistent_account(&Addr::from_slice(to_address)); result @@ -356,7 +356,7 @@ impl Forker { ) -> Result<(), ForkCallError> { let active_fork_local_id = self .executor - .backend + .backend() .active_fork_id() .ok_or(ForkCallError::ExecutorError("no active fork!".to_owned()))?; let mut org_block_number = None; @@ -376,10 +376,10 @@ impl Forker { .map(BlockNumber::from) .unwrap_or(org_block_number.unwrap()); - self.executor.env.block.number = U256::from(block_number); + self.executor.env_mut().block.number = U256::from(block_number); self.executor - .backend + .backend_mut() .roll_fork( Some(active_fork_local_id), block_number, @@ -399,8 +399,8 @@ mod tests { }; use super::*; - use alloy_primitives::U256; - use alloy_sol_types::sol; + use alloy::primitives::U256; + use alloy::sol; use rain_interpreter_bindings::{ DeployerISP::{iParserCall, iStoreCall}, IInterpreterStoreV1::{getCall, setCall}, @@ -440,7 +440,7 @@ mod tests { .await .unwrap(); let parser_address = result.typed_return._0; - let expected_address = "0x90caf23ea7e507bb722647b0674e50d8d6468234" + let expected_address = "0xf14e09601a47552de6abd3a0b165607fafd2b5ba" .parse::
() .unwrap(); assert_eq!(parser_address, expected_address); @@ -648,7 +648,7 @@ mod tests { // check the env block number is the same as the fork block number assert_eq!( - forker.executor.env.block.number, + forker.executor.env().block.number, U256::from(POLYGON_FORK_NUMBER) ); @@ -659,7 +659,7 @@ mod tests { // check the env block number is updated assert_eq!( - forker.executor.env.block.number, + forker.executor.env().block.number, U256::from(POLYGON_FORK_NUMBER + 1) ); } diff --git a/crates/eval/src/lib.rs b/crates/eval/src/lib.rs index fb6bb25ec..56586abd6 100644 --- a/crates/eval/src/lib.rs +++ b/crates/eval/src/lib.rs @@ -1,6 +1,9 @@ pub mod dispatch; pub mod error; +#[cfg(not(target_family = "wasm"))] pub mod eval; +#[cfg(not(target_family = "wasm"))] pub mod fork; pub mod namespace; +#[cfg(not(target_family = "wasm"))] pub mod trace; diff --git a/crates/eval/src/namespace.rs b/crates/eval/src/namespace.rs index d23597db0..5e5d446d7 100644 --- a/crates/eval/src/namespace.rs +++ b/crates/eval/src/namespace.rs @@ -1,4 +1,4 @@ -use alloy_primitives::{keccak256, Address, B256, U256}; +use alloy::primitives::{keccak256, Address, B256, U256}; use rain_interpreter_bindings::IInterpreterV2::FullyQualifiedNamespace; pub struct CreateNamespace {} diff --git a/crates/eval/src/trace.rs b/crates/eval/src/trace.rs index b4af727ce..22c453f96 100644 --- a/crates/eval/src/trace.rs +++ b/crates/eval/src/trace.rs @@ -1,5 +1,5 @@ use crate::fork::ForkTypedReturn; -use alloy_primitives::{Address, U256}; +use alloy::primitives::{Address, U256}; use rain_interpreter_bindings::IInterpreterV3::{eval3Call, eval3Return}; use thiserror::Error; @@ -169,6 +169,7 @@ mod tests { use super::*; use crate::eval::ForkEvalArgs; use crate::fork::{Forker, NewForkedEvm}; + use alloy::primitives::utils::parse_ether; use rain_interpreter_bindings::IInterpreterStoreV1::FullyQualifiedNamespace; use rain_interpreter_env::{ CI_DEPLOY_SEPOLIA_RPC_URL, CI_FORK_SEPOLIA_BLOCK_NUMBER, CI_FORK_SEPOLIA_DEPLOYER_ADDRESS, @@ -186,7 +187,7 @@ mod tests { let res = fork .fork_eval(ForkEvalArgs { rainlang_string: r" - a: int-add(1 2), + a: add(1 2), b: 2, c: 4, _: call<1>(1 2), @@ -194,9 +195,9 @@ mod tests { :set(3 4); a b:, c: call<2>(a b), - d: int-add(a b); + d: add(a b); a b:, - c: int-mul(a b); + c: mul(a b); " .into(), source_index: 0, @@ -255,15 +256,15 @@ mod tests { let res = fork .fork_eval(ForkEvalArgs { rainlang_string: r" - a: int-add(1 2), + a: add(1 2), b: 2, c: 4, _: call<1>(1 2); a b:, c: call<2>(a b), - d: int-add(a b); + d: add(a b); a b:, - c: int-mul(a b); + c: mul(a b); " .into(), source_index: 0, @@ -279,11 +280,11 @@ mod tests { // search_trace_by_path let trace_0 = rain_eval_result.search_trace_by_path("0.1").unwrap(); - assert_eq!(trace_0, U256::from(2)); + assert_eq!(trace_0, parse_ether("2").unwrap()); let trace_1 = rain_eval_result.search_trace_by_path("0.1.3").unwrap(); - assert_eq!(trace_1, U256::from(3)); + assert_eq!(trace_1, parse_ether("3").unwrap()); let trace_2 = rain_eval_result.search_trace_by_path("0.1.2").unwrap(); - assert_eq!(trace_2, U256::from(2)); + assert_eq!(trace_2, parse_ether("2").unwrap()); // test the various errors // bad trace path @@ -297,6 +298,8 @@ mod tests { } fn vec_i32_to_u256(vec: Vec) -> Vec { - vec.iter().map(|&x| U256::from(x)).collect() + vec.iter() + .map(|&x| parse_ether(&x.to_string()).unwrap()) + .collect() } } diff --git a/crates/parser/Cargo.toml b/crates/parser/Cargo.toml index 142016c2d..36e834c41 100644 --- a/crates/parser/Cargo.toml +++ b/crates/parser/Cargo.toml @@ -12,10 +12,14 @@ rain_interpreter_dispair = { workspace = true } rain_interpreter_bindings = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } -tokio = { workspace = true } -alloy-primitives = { workspace = true } -alloy-sol-types = { workspace = true } +alloy = { workspace = true } ethers = { workspace = true, features = [ "legacy", ] } thiserror = { workspace = true } + +[target.'cfg(not(target_family = "wasm"))'.dependencies] +tokio = { version = "1.28.0", features = ["full"] } + +[target.'cfg(target_family = "wasm")'.dependencies] +tokio = { version = "1.28.0", features = ["sync", "macros", "io-util", "rt", "time"] } diff --git a/crates/parser/src/v1.rs b/crates/parser/src/v1.rs index 3a9aa2a59..ab3db193c 100644 --- a/crates/parser/src/v1.rs +++ b/crates/parser/src/v1.rs @@ -1,10 +1,11 @@ use crate::error::ParserError; +use alloy::primitives::*; use alloy_ethers_typecast::transaction::{ReadContractParametersBuilder, ReadableClient}; -use alloy_primitives::*; use ethers::providers::JsonRpcClient; use rain_interpreter_bindings::IParserV1::*; use rain_interpreter_dispair::DISPair; +#[cfg(not(target_family = "wasm"))] pub trait Parser { /// Call Parser contract to parse the provided rainlang text. fn parse_text( @@ -26,6 +27,30 @@ pub trait Parser { client: ReadableClient, ) -> impl std::future::Future> + Send; } + +#[cfg(target_family = "wasm")] +pub trait Parser { + /// Call Parser contract to parse the provided rainlang text. + fn parse_text( + &self, + text: &str, + client: ReadableClient, + ) -> impl std::future::Future> + where + Self: Sync, + { + self.parse(text.as_bytes().to_vec(), client) + } + + /// Call Parser contract to parse the provided data + /// The provided data must contain valid UTF-8 encoding of valid rainlang text. + fn parse( + &self, + data: Vec, + client: ReadableClient, + ) -> impl std::future::Future>; +} + /// ParserV1 /// Struct representing ParserV1 instances. #[derive(Clone, Default)] @@ -51,7 +76,7 @@ impl Parser for ParserV1 { .read( ReadContractParametersBuilder::default() .address(self.address) - .call(parseCall { data }) + .call(parseCall { data: data.into() }) .build() .map_err(ParserError::ReadContractParametersBuilderError)?, ) @@ -63,7 +88,7 @@ impl Parser for ParserV1 { #[cfg(test)] mod tests { use super::*; - use alloy_primitives::{Address, U256}; + use alloy::primitives::{Address, U256}; use ethers::providers::{MockProvider, MockResponse, Provider}; #[tokio::test] @@ -106,7 +131,7 @@ mod tests { let result = parser.parse_text("my rainlang", client).await.unwrap(); - assert_eq!(result.bytecode, hex!("1234")); + assert_eq!(**result.bytecode, hex!("1234")); assert_eq!(result.constants, vec![U256::from(3), U256::from(4)]); } @@ -135,7 +160,7 @@ mod tests { let result = parser.parse_text(rainlang, client).await.unwrap(); - assert_eq!(result.bytecode, hex!("6d79207261696e6c616e67")); + assert_eq!(**result.bytecode, hex!("6d79207261696e6c616e67")); assert_eq!(result.constants, vec![U256::from(3), U256::from(4)]); } } diff --git a/crates/parser/src/v2.rs b/crates/parser/src/v2.rs index 6bf845570..167a97aa6 100644 --- a/crates/parser/src/v2.rs +++ b/crates/parser/src/v2.rs @@ -1,11 +1,12 @@ use crate::error::ParserError; +use alloy::primitives::*; use alloy_ethers_typecast::transaction::{ReadContractParametersBuilder, ReadableClient}; -use alloy_primitives::*; use ethers::providers::JsonRpcClient; use rain_interpreter_bindings::IParserPragmaV1::*; use rain_interpreter_bindings::IParserV2::*; use rain_interpreter_dispair::DISPair; +#[cfg(not(target_family = "wasm"))] pub trait Parser2 { /// Call Parser contract to parse the provided rainlang text. fn parse_text( @@ -35,6 +36,38 @@ pub trait Parser2 { client: ReadableClient, ) -> impl std::future::Future> + Send; } + +#[cfg(target_family = "wasm")] +pub trait Parser2 { + /// Call Parser contract to parse the provided rainlang text. + fn parse_text( + &self, + text: &str, + client: ReadableClient, + ) -> impl std::future::Future> + where + Self: Sync, + { + self.parse(text.as_bytes().to_vec(), client) + } + + /// Call Parser contract to parse the provided data + /// The provided data must contain valid UTF-8 encoding of valid rainlang text. + fn parse( + &self, + data: Vec, + client: ReadableClient, + ) -> impl std::future::Future>; + + /// Call Parser contract to parse the provided rainlang text and provide the pragma. + /// The provided rainlang text must be valid UTF-8 encoding of valid rainlang text. + fn parse_pragma( + &self, + data: Vec, + client: ReadableClient, + ) -> impl std::future::Future>; +} + /// ParserV2 /// Struct representing ParserV2 instances. #[derive(Clone, Default)] @@ -74,7 +107,7 @@ impl Parser2 for ParserV2 { .read( ReadContractParametersBuilder::default() .address(self.deployer_address) - .call(parse2Call { data }) + .call(parse2Call { data: data.into() }) .build() .map_err(ParserError::ReadContractParametersBuilderError)?, ) @@ -91,7 +124,7 @@ impl Parser2 for ParserV2 { .read( ReadContractParametersBuilder::default() .address(self.deployer_address) - .call(parsePragma1Call { data }) + .call(parsePragma1Call { data: data.into() }) .build() .map_err(ParserError::ReadContractParametersBuilderError)?, ) @@ -118,7 +151,7 @@ impl ParserV2 { #[cfg(test)] mod tests { use super::*; - use alloy_primitives::Address; + use alloy::primitives::Address; use ethers::providers::{MockProvider, MockResponse, Provider}; #[tokio::test] @@ -157,7 +190,7 @@ mod tests { let result = parser.parse_text("my rainlang", client).await.unwrap(); - assert_eq!(result.bytecode, hex!("1234")); + assert_eq!(**result.bytecode, hex!("1234")); } #[tokio::test] @@ -181,7 +214,7 @@ mod tests { let result = parser.parse_text(rainlang, client).await.unwrap(); - assert_eq!(result.bytecode, hex!("6d79207261696e6c616e67")); + assert_eq!(**result.bytecode, hex!("6d79207261696e6c616e67")); } #[tokio::test] diff --git a/flake.lock b/flake.lock index 30b0bbb35..07089efb9 100644 --- a/flake.lock +++ b/flake.lock @@ -182,11 +182,11 @@ "nixpkgs": "nixpkgs_5" }, "locked": { - "lastModified": 1719997877, - "narHash": "sha256-/Edw+w0PiGgxwnCeJycM0VgH4HtlCi91v1d8xbi+REE=", + "lastModified": 1722676286, + "narHash": "sha256-wEDJdvwRZF2ErQ33nQ0Lqn/48XrPbaadv56/bM2MSZU=", "owner": "shazow", "repo": "foundry.nix", - "rev": "02febba4f1cf0606d790acdb24adcf7a64afb4e1", + "rev": "d84c83b1c1722c8742b3d2d84c9386814d75384e", "type": "github" }, "original": { @@ -273,11 +273,11 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1720771713, - "narHash": "sha256-bfsLhD3deWYECwvo3b8AQPQkdx0Pqu3Qyds5UP6a2x0=", + "lastModified": 1723043047, + "narHash": "sha256-s6LBVajxwWulSiFYRmxfGFHTlyiy1+lHGbW0nCOTPRk=", "owner": "nixos", "repo": "nixpkgs", - "rev": "2977213b607671ed2d9b8a935eb55ae998dbb964", + "rev": "4e8f8f13e64d2795384ed17679bf193987a1f731", "type": "github" }, "original": { @@ -368,11 +368,11 @@ "solc": "solc_2" }, "locked": { - "lastModified": 1720772500, - "narHash": "sha256-UFqI1xkg01ZddqOqJmUz3rG2jE4DusR9IwFcAbiCQ6M=", + "lastModified": 1723043648, + "narHash": "sha256-DZCGdrjDRjjKF2BuPCqGb7H8guYA7uWsCeOT30tUWrk=", "owner": "rainlanguage", "repo": "rainix", - "rev": "eeb91c191c4b94b0a1716b3dd9956372a092474c", + "rev": "6baf112368cb17b44233b5fce6848aa0cc2d36d6", "type": "github" }, "original": { @@ -412,11 +412,11 @@ "nixpkgs": "nixpkgs_7" }, "locked": { - "lastModified": 1720750737, - "narHash": "sha256-hPXe9Pr3s2EKRdDki3UkCKoPGlNkOhplCooNoC/L7Qc=", + "lastModified": 1722997267, + "narHash": "sha256-8Pncp8IKd0f0N711CRrCGTC4iLfBE+/5kaMqyWxnYic=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "a17c5d38c6fe47880eb8c6bede15d943ac2c4d17", + "rev": "d720bf3cebac38c2426d77ee2e59943012854cb8", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 40289563c..88c8821b0 100644 --- a/flake.nix +++ b/flake.nix @@ -43,11 +43,23 @@ ''; additionalBuildInputs = rainix.sol-build-inputs.${system} ++ [rain.defaultPackage.${system}]; }; + + test-wasm-build = rainix.mkTask.${system} { + name = "test-wasm-build"; + body = '' + set -euxo pipefail + + cargo build --target wasm32-unknown-unknown --exclude rain-i9r-cli --exclude rain-interpreter-env --workspace + ''; + }; } // rainix.packages.${system}; devShells.default = pkgs.mkShell { shellHook = rainix.devShells.${system}.default.shellHook; - packages = [ packages.i9r-prelude ]; + packages = [ + packages.i9r-prelude + packages.test-wasm-build + ]; inputsFrom = [ rainix.devShells.${system}.default ]; }; } diff --git a/foundry.toml b/foundry.toml index 591d1fca8..bc40f6ecc 100644 --- a/foundry.toml +++ b/foundry.toml @@ -9,7 +9,7 @@ solc = "0.8.25" # Try to make sure the optimizer doesn't touch the output in a way that can break # source maps for debugging. -# via_ir = false +# via_ir = true # optimizer = false # optimizer_runs = 0 # optimizer_steps = 0 @@ -32,9 +32,12 @@ fs_permissions = [ remappings = [ # The auto remapping wasn't appending /src/ for some reason. + "forge-std/=lib/rain.interpreter.interface/lib/forge-std/src/", "rain.metadata/=lib/rain.metadata/src/", "rain.math.saturating/=lib/rain.math.fixedpoint/lib/rain.math.saturating/src/", "rain.sol.codegen/=lib/rain.sol.codegen/src/", + "rain.solmem/=lib/rain.interpreter.interface/lib/rain.solmem/src/", + "openzeppelin-contracts/=lib/rain.interpreter.interface/lib/openzeppelin-contracts/", ] [fuzz] diff --git a/lib/forge-std b/lib/forge-std deleted file mode 160000 index 1d0766bc5..000000000 --- a/lib/forge-std +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1d0766bc5d814f117c7b1e643828f7d85024fb51 diff --git a/lib/openzeppelin-contracts b/lib/openzeppelin-contracts deleted file mode 160000 index fd81a96f0..000000000 --- a/lib/openzeppelin-contracts +++ /dev/null @@ -1 +0,0 @@ -Subproject commit fd81a96f01cc42ef1c9a5399364968d0e07e9e90 diff --git a/lib/rain.datacontract b/lib/rain.datacontract deleted file mode 160000 index 959649ed3..000000000 --- a/lib/rain.datacontract +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 959649ed3555199c14c2ec3718bccbe4fea76ce2 diff --git a/lib/rain.erc1820 b/lib/rain.erc1820 deleted file mode 160000 index 1fe5e050d..000000000 --- a/lib/rain.erc1820 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1fe5e050d194a76f26d712604abb5db32639b06a diff --git a/lib/rain.interpreter.interface b/lib/rain.interpreter.interface index 39f592e13..20da616b9 160000 --- a/lib/rain.interpreter.interface +++ b/lib/rain.interpreter.interface @@ -1 +1 @@ -Subproject commit 39f592e1324d47dff606b4804a76dbf6a665cdd6 +Subproject commit 20da616b981d45578cd1c56fca234f19b3db9f5b diff --git a/lib/rain.lib.typecast b/lib/rain.lib.typecast deleted file mode 160000 index 4ad548bf9..000000000 --- a/lib/rain.lib.typecast +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4ad548bf9969b7f24c5f72ae12b7e8ae1e487266 diff --git a/lib/rain.math.binary b/lib/rain.math.binary deleted file mode 160000 index 3442b5885..000000000 --- a/lib/rain.math.binary +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3442b5885a9ca909f0d2c0c2b6ea3dc11799f6c8 diff --git a/lib/rain.metadata b/lib/rain.metadata index 5cddca643..7d2ea7947 160000 --- a/lib/rain.metadata +++ b/lib/rain.metadata @@ -1 +1 @@ -Subproject commit 5cddca643020bd8ef6e7c3ade6b57502f97b3074 +Subproject commit 7d2ea7947fdb986d61c1b45065804d9e26d74508 diff --git a/lib/rain.solmem b/lib/rain.solmem deleted file mode 160000 index 6414ab88a..000000000 --- a/lib/rain.solmem +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6414ab88a017eacf2b263e9e08d0787fbd677192 diff --git a/script/BuildPointers.sol b/script/BuildPointers.sol index e115cdf76..681d1bda9 100644 --- a/script/BuildPointers.sol +++ b/script/BuildPointers.sol @@ -85,14 +85,16 @@ contract BuildPointers is Script { address(extern), "RainterpreterReferenceExternNPE2", string.concat( - LibCodeGen.describedByMetaHashConstantString(vm, name), - LibCodeGen.parseMetaConstantString( - vm, LibRainterpreterReferenceExternNPE2.authoringMetaV2(), EXTERN_PARSE_META_BUILD_DEPTH + string.concat( + LibCodeGen.describedByMetaHashConstantString(vm, name), + LibCodeGen.parseMetaConstantString( + vm, LibRainterpreterReferenceExternNPE2.authoringMetaV2(), EXTERN_PARSE_META_BUILD_DEPTH + ), + LibCodeGen.subParserWordParsersConstantString(vm, extern), + LibCodeGen.operandHandlerFunctionPointersConstantString(vm, extern), + LibCodeGen.literalParserFunctionPointersConstantString(vm, extern), + LibCodeGen.integrityFunctionPointersConstantString(vm, extern) ), - LibCodeGen.subParserWordParsersConstantString(vm, extern), - LibCodeGen.operandHandlerFunctionPointersConstantString(vm, extern), - LibCodeGen.literalParserFunctionPointersConstantString(vm, extern), - LibCodeGen.integrityFunctionPointersConstantString(vm, extern), LibCodeGen.opcodeFunctionPointersConstantString(vm, extern) ) ); diff --git a/script/Deploy.sol b/script/Deploy.sol index 10659f68d..b295eacfb 100644 --- a/script/Deploy.sol +++ b/script/Deploy.sol @@ -9,7 +9,7 @@ import { RainterpreterExpressionDeployerNPE2, RainterpreterExpressionDeployerNPE2ConstructionConfigV2 } from "../src/concrete/RainterpreterExpressionDeployerNPE2.sol"; -import {IMetaBoardV1} from "rain.metadata/interface/IMetaBoardV1.sol"; +import {IMetaBoardV1_2} from "rain.metadata/interface/unstable/IMetaBoardV1_2.sol"; import {LibDescribedByMeta} from "rain.metadata/lib/LibDescribedByMeta.sol"; /// @title Deploy @@ -19,7 +19,7 @@ contract Deploy is Script { function run() external { uint256 deployerPrivateKey = vm.envUint("DEPLOYMENT_KEY"); bytes memory constructionMeta = vm.readFileBinary("meta/RainterpreterExpressionDeployerNPE2.rain.meta"); - IMetaBoardV1 metaboard = IMetaBoardV1(vm.envAddress("DEPLOY_METABOARD_ADDRESS")); + IMetaBoardV1_2 metaboard = IMetaBoardV1_2(vm.envAddress("DEPLOY_METABOARD_ADDRESS")); vm.startBroadcast(deployerPrivateKey); diff --git a/src/abstract/BaseRainterpreterExternNPE2.sol b/src/abstract/BaseRainterpreterExternNPE2.sol index 35527046c..a6e81b687 100644 --- a/src/abstract/BaseRainterpreterExternNPE2.sol +++ b/src/abstract/BaseRainterpreterExternNPE2.sol @@ -49,7 +49,7 @@ abstract contract BaseRainterpreterExternNPE2 is IInterpreterExternV3, IIntegrit Operand operand = Operand.wrap(ExternDispatch.unwrap(dispatch) & type(uint16).max); function(Operand, uint256[] memory) internal view returns (uint256[] memory) f; - assembly { + assembly ("memory-safe") { f := shr(0xf0, mload(add(fPointersStart, mul(mod(opcode, fsCount), 2)))) } outputs = f(operand, inputs); @@ -75,7 +75,7 @@ abstract contract BaseRainterpreterExternNPE2 is IInterpreterExternV3, IIntegrit Operand operand = Operand.wrap(ExternDispatch.unwrap(dispatch) & type(uint16).max); function(Operand, uint256, uint256) internal pure returns (uint256, uint256) f; - assembly { + assembly ("memory-safe") { f := shr(0xf0, mload(add(fPointersStart, mul(mod(opcode, fsCount), 2)))) } (actualInputs, actualOutputs) = f(operand, expectedInputs, expectedOutputs); diff --git a/src/abstract/BaseRainterpreterSubParserNPE2.sol b/src/abstract/BaseRainterpreterSubParserNPE2.sol index 5d7c043df..b00d171f4 100644 --- a/src/abstract/BaseRainterpreterSubParserNPE2.sol +++ b/src/abstract/BaseRainterpreterSubParserNPE2.sol @@ -11,7 +11,7 @@ import {CMASK_RHS_WORD_TAIL} from "../lib/parse/LibParseCMask.sol"; import {LibParse, Operand} from "../lib/parse/LibParse.sol"; import {LibParseMeta} from "rain.interpreter.interface/lib/parse/LibParseMeta.sol"; import {LibParseOperand} from "../lib/parse/LibParseOperand.sol"; -import {IDescribedByMetaV1} from "rain.metadata/interface/unstable/IDescribedByMetaV1.sol"; +import {IDescribedByMetaV1} from "rain.metadata/interface/IDescribedByMetaV1.sol"; import {IParserToolingV1} from "rain.sol.codegen/interface/IParserToolingV1.sol"; import {ISubParserToolingV1} from "rain.sol.codegen/interface/ISubParserToolingV1.sol"; diff --git a/src/concrete/RainterpreterExpressionDeployerNPE2.sol b/src/concrete/RainterpreterExpressionDeployerNPE2.sol index 6597c8aee..e0764ae1d 100644 --- a/src/concrete/RainterpreterExpressionDeployerNPE2.sol +++ b/src/concrete/RainterpreterExpressionDeployerNPE2.sol @@ -5,7 +5,6 @@ import {ERC165, IERC165} from "openzeppelin-contracts/contracts/utils/introspect import {Pointer, LibPointer} from "rain.solmem/lib/LibPointer.sol"; import {LibStackPointer} from "rain.solmem/lib/LibStackPointer.sol"; import {LibDataContract, DataContractMemoryContainer} from "rain.datacontract/lib/LibDataContract.sol"; -import {IERC1820_REGISTRY} from "rain.erc1820/lib/LibIERC1820.sol"; import {LibUint256Array} from "rain.solmem/lib/LibUint256Array.sol"; import {IParserV2} from "rain.interpreter.interface/interface/IParserV2.sol"; import {IParserPragmaV1, PragmaV1} from "rain.interpreter.interface/interface/IParserPragmaV1.sol"; @@ -18,7 +17,7 @@ import { UnexpectedPointers } from "../error/ErrDeploy.sol"; import {IInterpreterStoreV2} from "rain.interpreter.interface/interface/IInterpreterStoreV2.sol"; -import {IDescribedByMetaV1} from "rain.metadata/interface/unstable/IDescribedByMetaV1.sol"; +import {IDescribedByMetaV1} from "rain.metadata/interface/IDescribedByMetaV1.sol"; import {IInterpreterV4} from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; import {LibIntegrityCheckNP} from "../lib/integrity/LibIntegrityCheckNP.sol"; diff --git a/src/concrete/extern/RainterpreterReferenceExternNPE2.sol b/src/concrete/extern/RainterpreterReferenceExternNPE2.sol index ac86d406a..097bc5fac 100644 --- a/src/concrete/extern/RainterpreterReferenceExternNPE2.sol +++ b/src/concrete/extern/RainterpreterReferenceExternNPE2.sol @@ -112,7 +112,7 @@ library LibRainterpreterReferenceExternNPE2 { ]; AuthoringMetaV2[] memory wordsDynamic; uint256 length = SUB_PARSER_WORD_PARSERS_LENGTH; - assembly { + assembly ("memory-safe") { wordsDynamic := wordsFixed mstore(wordsDynamic, length) } @@ -215,7 +215,7 @@ contract RainterpreterReferenceExternNPE2 is BaseRainterpreterSubParserNPE2, Bas function (uint256, uint256, uint256) internal pure returns (uint256)[SUB_PARSER_LITERAL_PARSERS_LENGTH + 1] memory parsersFixed = [lengthPointer, LibParseLiteralRepeat.parseRepeat]; uint256[] memory parsersDynamic; - assembly { + assembly ("memory-safe") { parsersDynamic := parsersFixed } // Sanity check that the dynamic length is correct. Should be an @@ -289,7 +289,7 @@ contract RainterpreterReferenceExternNPE2 is BaseRainterpreterSubParserNPE2, Bas LibParseOperand.handleOperandDisallowed ]; uint256[] memory handlersDynamic; - assembly { + assembly ("memory-safe") { handlersDynamic := handlersFixed } // Sanity check that the dynamic length is correct. Should be an @@ -328,7 +328,7 @@ contract RainterpreterReferenceExternNPE2 is BaseRainterpreterSubParserNPE2, Bas LibExternOpContextRainlenNPE2.subParser ]; uint256[] memory pointersDynamic; - assembly { + assembly ("memory-safe") { pointersDynamic := pointersFixed } // Sanity check that the dynamic length is correct. Should be an @@ -358,7 +358,7 @@ contract RainterpreterReferenceExternNPE2 is BaseRainterpreterSubParserNPE2, Bas function(Operand, uint256[] memory) internal view returns (uint256[] memory)[OPCODE_FUNCTION_POINTERS_LENGTH + 1] memory pointersFixed = [lengthPointer, LibExternOpIntIncNPE2.run]; uint256[] memory pointersDynamic; - assembly { + assembly ("memory-safe") { pointersDynamic := pointersFixed } // Sanity check that the dynamic length is correct. Should be an @@ -388,7 +388,7 @@ contract RainterpreterReferenceExternNPE2 is BaseRainterpreterSubParserNPE2, Bas function(Operand, uint256, uint256) internal pure returns (uint256, uint256)[OPCODE_FUNCTION_POINTERS_LENGTH + 1] memory pointersFixed = [lengthPointer, LibExternOpIntIncNPE2.integrity]; uint256[] memory pointersDynamic; - assembly { + assembly ("memory-safe") { pointersDynamic := pointersFixed } // Sanity check that the dynamic length is correct. Should be an diff --git a/src/lib/op/erc20/LibOpERC20TotalSupply.sol b/src/lib/op/erc20/LibOpERC20TotalSupply.sol index 05ed9ebd7..957e630e6 100644 --- a/src/lib/op/erc20/LibOpERC20TotalSupply.sol +++ b/src/lib/op/erc20/LibOpERC20TotalSupply.sol @@ -20,7 +20,7 @@ library LibOpERC20TotalSupply { function run(InterpreterStateNP memory, Operand, Pointer stackTop) internal view returns (Pointer) { uint256 token; - assembly { + assembly ("memory-safe") { token := mload(stackTop) } uint256 totalSupply = IERC20(address(uint160(token))).totalSupply(); @@ -34,7 +34,7 @@ library LibOpERC20TotalSupply { 0 ); - assembly { + assembly ("memory-safe") { mstore(stackTop, totalSupply) } return stackTop; diff --git a/src/lib/op/erc20/uint256/LibOpUint256ERC20TotalSupply.sol b/src/lib/op/erc20/uint256/LibOpUint256ERC20TotalSupply.sol index 2e1fd16fb..9ed39e448 100644 --- a/src/lib/op/erc20/uint256/LibOpUint256ERC20TotalSupply.sol +++ b/src/lib/op/erc20/uint256/LibOpUint256ERC20TotalSupply.sol @@ -18,11 +18,11 @@ library LibOpUint256ERC20TotalSupply { function run(InterpreterStateNP memory, Operand, Pointer stackTop) internal view returns (Pointer) { uint256 account; - assembly { + assembly ("memory-safe") { account := mload(stackTop) } uint256 totalSupply = IERC20(address(uint160(account))).totalSupply(); - assembly { + assembly ("memory-safe") { mstore(stackTop, totalSupply) } return stackTop; diff --git a/src/lib/op/erc5313/LibOpERC5313OwnerNP.sol b/src/lib/op/erc5313/LibOpERC5313OwnerNP.sol index 099c1a1a7..b504fe77c 100644 --- a/src/lib/op/erc5313/LibOpERC5313OwnerNP.sol +++ b/src/lib/op/erc5313/LibOpERC5313OwnerNP.sol @@ -18,11 +18,11 @@ library LibOpERC5313OwnerNP { function run(InterpreterStateNP memory, Operand, Pointer stackTop) internal view returns (Pointer) { uint256 account; - assembly { + assembly ("memory-safe") { account := mload(stackTop) } address owner = IERC5313(address(uint160(account))).owner(); - assembly { + assembly ("memory-safe") { mstore(stackTop, owner) } return stackTop; diff --git a/test/abstract/OpTest.sol b/test/abstract/OpTest.sol index b0f5b858b..9b24bdd82 100644 --- a/test/abstract/OpTest.sol +++ b/test/abstract/OpTest.sol @@ -86,7 +86,7 @@ abstract contract OpTest is RainterpreterExpressionDeployerNPE2DeploymentTest { Operand operand, uint256[] memory constants, uint256[] memory inputs - ) internal returns (uint256) { + ) internal view returns (uint256) { IntegrityCheckStateNP memory integrityState = LibIntegrityCheckNP.newState("", 0, constants); (uint256 calcInputs, uint256 calcOutputs) = integrityFn(integrityState, operand); assertEq(calcInputs, inputs.length, "inputs length"); @@ -140,7 +140,7 @@ abstract contract OpTest is RainterpreterExpressionDeployerNPE2DeploymentTest { Operand operand, ReferenceCheckPointers memory pointers, function(InterpreterStateNP memory, Operand, Pointer) view returns (Pointer) runFn - ) internal { + ) internal view { bytes32 stateFingerprintBefore = state.fingerprint(); pointers.actualStackTopAfter = runFn(state, operand, pointers.stackTop); bytes32 stateFingerprintAfter = state.fingerprint(); @@ -155,7 +155,7 @@ abstract contract OpTest is RainterpreterExpressionDeployerNPE2DeploymentTest { ReferenceCheckPointers memory pointers, uint256[] memory inputs, uint256 calcOutputs - ) internal { + ) internal view { uint256[] memory expectedOutputs = referenceFn(state, operand, inputs); assertEq(expectedOutputs.length, calcOutputs, "expected outputs length"); @@ -179,7 +179,7 @@ abstract contract OpTest is RainterpreterExpressionDeployerNPE2DeploymentTest { function(IntegrityCheckStateNP memory, Operand) view returns (uint256, uint256) integrityFn, function(InterpreterStateNP memory, Operand, Pointer) view returns (Pointer) runFn, uint256[] memory inputs - ) internal { + ) internal view { uint256 calcOutputs = opReferenceCheckIntegrity(integrityFn, operand, state.constants, inputs); ReferenceCheckPointers memory pointers = opReferenceCheckPointers(inputs, calcOutputs); @@ -214,13 +214,16 @@ abstract contract OpTest is RainterpreterExpressionDeployerNPE2DeploymentTest { return parseAndEval(rainString, LibContext.build(new uint256[][](0), new SignedContextV1[](0))); } - function checkHappy(bytes memory rainString, uint256 expectedValue, string memory errString) internal { + function checkHappy(bytes memory rainString, uint256 expectedValue, string memory errString) internal view { uint256[] memory expectedStack = new uint256[](1); expectedStack[0] = expectedValue; checkHappy(rainString, expectedStack, errString); } - function checkHappy(bytes memory rainString, uint256[] memory expectedStack, string memory errString) internal { + function checkHappy(bytes memory rainString, uint256[] memory expectedStack, string memory errString) + internal + view + { checkHappy(rainString, LibContext.build(new uint256[][](0), new SignedContextV1[](0)), expectedStack, errString); } @@ -229,7 +232,7 @@ abstract contract OpTest is RainterpreterExpressionDeployerNPE2DeploymentTest { uint256[][] memory context, uint256[] memory expectedStack, string memory errString - ) internal { + ) internal view { (uint256[] memory stack, uint256[] memory kvs) = parseAndEval(rainString, context); assertEq(stack.length, expectedStack.length, errString); @@ -239,7 +242,10 @@ abstract contract OpTest is RainterpreterExpressionDeployerNPE2DeploymentTest { assertEq(kvs.length, 0); } - function checkHappyKVs(bytes memory rainString, uint256[] memory expectedKVs, string memory errString) internal { + function checkHappyKVs(bytes memory rainString, uint256[] memory expectedKVs, string memory errString) + internal + view + { (uint256[] memory stack, uint256[] memory kvs) = parseAndEval(rainString); assertEq(stack.length, 0); diff --git a/test/abstract/OperandTest.sol b/test/abstract/OperandTest.sol index 1f5b6f3fa..a357d4cdc 100644 --- a/test/abstract/OperandTest.sol +++ b/test/abstract/OperandTest.sol @@ -24,7 +24,7 @@ abstract contract OperandTest is Test { (constants); } - function checkOperandParse(bytes memory rainString, bytes memory operand) internal { + function checkOperandParse(bytes memory rainString, bytes memory operand) internal view { (bytes memory bytecode, uint256[] memory constants) = this.parse(rainString); assertEq( bytecode, diff --git a/test/abstract/ParseLiteralTest.sol b/test/abstract/ParseLiteralTest.sol index 374bfcc77..636226fec 100644 --- a/test/abstract/ParseLiteralTest.sol +++ b/test/abstract/ParseLiteralTest.sol @@ -31,7 +31,7 @@ contract ParseLiteralTest is Test { uint256 expectedInnerEnd, uint256 expectedOuterEnd, uint256 expectedFinalCursor - ) internal { + ) internal pure { uint256 cursor = Pointer.unwrap(data.dataPointer()); uint256 end = cursor + data.length; diff --git a/test/abstract/RainterpreterExpressionDeployerNPE2DeploymentTest.sol b/test/abstract/RainterpreterExpressionDeployerNPE2DeploymentTest.sol index 96a8e7a60..09722d228 100644 --- a/test/abstract/RainterpreterExpressionDeployerNPE2DeploymentTest.sol +++ b/test/abstract/RainterpreterExpressionDeployerNPE2DeploymentTest.sol @@ -1,7 +1,6 @@ // SPDX-License-Identifier: CAL pragma solidity =0.8.25; -import {IERC1820_REGISTRY, IERC1820Registry} from "rain.erc1820/lib/LibIERC1820.sol"; import {Test, console2, stdError} from "forge-std/Test.sol"; import {INVALID_BYTECODE} from "../lib/etch/LibEtch.sol"; @@ -90,15 +89,6 @@ abstract contract RainterpreterExpressionDeployerNPE2DeploymentTest is Test { revert("unexpected parse meta"); } - vm.etch(address(IERC1820_REGISTRY), INVALID_BYTECODE); - vm.mockCall( - address(IERC1820_REGISTRY), - abi.encodeWithSelector(IERC1820Registry.interfaceHash.selector), - abi.encode(bytes32(uint256(0))) - ); - vm.mockCall( - address(IERC1820_REGISTRY), abi.encodeWithSelector(IERC1820Registry.setInterfaceImplementer.selector), "" - ); iDeployer = new RainterpreterExpressionDeployerNPE2( RainterpreterExpressionDeployerNPE2ConstructionConfigV2( address(iInterpreter), address(iStore), address(iParser) diff --git a/test/src/abstract/BaseRainterpreterSubParserNPE2.ierc165.t.sol b/test/src/abstract/BaseRainterpreterSubParserNPE2.ierc165.t.sol index 2d6c88a29..e1682a487 100644 --- a/test/src/abstract/BaseRainterpreterSubParserNPE2.ierc165.t.sol +++ b/test/src/abstract/BaseRainterpreterSubParserNPE2.ierc165.t.sol @@ -5,7 +5,7 @@ import {Test} from "forge-std/Test.sol"; import {IERC165} from "openzeppelin-contracts/contracts/utils/introspection/IERC165.sol"; import {ISubParserV3} from "rain.interpreter.interface/interface/ISubParserV3.sol"; import {BaseRainterpreterSubParserNPE2} from "src/abstract/BaseRainterpreterSubParserNPE2.sol"; -import {IDescribedByMetaV1} from "rain.metadata/interface/unstable/IDescribedByMetaV1.sol"; +import {IDescribedByMetaV1} from "rain.metadata/interface/IDescribedByMetaV1.sol"; /// @dev We need a contract that is deployable in order to test the abstract /// base contract. diff --git a/test/src/concrete/RainterpreterExpressionDeployerNPE2.ierc165.t.sol b/test/src/concrete/RainterpreterExpressionDeployerNPE2.ierc165.t.sol index 6721e7fd7..895e9e3ff 100644 --- a/test/src/concrete/RainterpreterExpressionDeployerNPE2.ierc165.t.sol +++ b/test/src/concrete/RainterpreterExpressionDeployerNPE2.ierc165.t.sol @@ -10,7 +10,7 @@ import { } from "src/concrete/RainterpreterExpressionDeployerNPE2.sol"; import {IParserPragmaV1} from "rain.interpreter.interface/interface/IParserPragmaV1.sol"; import {IParserV2} from "rain.interpreter.interface/interface/IParserV2.sol"; -import {IDescribedByMetaV1} from "rain.metadata/interface/unstable/IDescribedByMetaV1.sol"; +import {IDescribedByMetaV1} from "rain.metadata/interface/IDescribedByMetaV1.sol"; import {RainterpreterNPE2} from "src/concrete/RainterpreterNPE2.sol"; import {RainterpreterParserNPE2} from "src/concrete/RainterpreterParserNPE2.sol"; import {RainterpreterStoreNPE2} from "src/concrete/RainterpreterStoreNPE2.sol"; diff --git a/test/src/concrete/RainterpreterExpressionDeployerNPE2.meta.t.sol b/test/src/concrete/RainterpreterExpressionDeployerNPE2.meta.t.sol index c0839908a..08e29fb3a 100644 --- a/test/src/concrete/RainterpreterExpressionDeployerNPE2.meta.t.sol +++ b/test/src/concrete/RainterpreterExpressionDeployerNPE2.meta.t.sol @@ -12,7 +12,7 @@ import {DESCRIBED_BY_META_HASH} from "src/concrete/RainterpreterExpressionDeploy contract RainterpreterExpressionDeployerNPE2MetaTest is RainterpreterExpressionDeployerNPE2DeploymentTest { /// Test that the expected construction meta hash can be read from the /// deployer. - function testRainterpreterExpressionDeployerNPE2ExpectedConstructionMetaHash() external { + function testRainterpreterExpressionDeployerNPE2ExpectedConstructionMetaHash() external view { bytes32 actualConstructionMetaHash = iDeployer.describedByMetaV1(); assertEq(actualConstructionMetaHash, DESCRIBED_BY_META_HASH); } diff --git a/test/src/concrete/RainterpreterNPE2.t.sol b/test/src/concrete/RainterpreterNPE2.t.sol index 5e7acd800..20f9b4702 100644 --- a/test/src/concrete/RainterpreterNPE2.t.sol +++ b/test/src/concrete/RainterpreterNPE2.t.sol @@ -9,7 +9,7 @@ import {RainterpreterNPE2, OPCODE_FUNCTION_POINTERS} from "src/concrete/Rainterp /// Test suite for RainterpreterNP. contract RainterpreterNPE2Test is Test { /// The function pointers of the interpreter must be even non-zero length. - function testRainterpreterNPE2OddFunctionPointersLength() external { + function testRainterpreterNPE2OddFunctionPointersLength() external pure { assertTrue(OPCODE_FUNCTION_POINTERS.length % 2 == 0); assertTrue(OPCODE_FUNCTION_POINTERS.length > 0); } diff --git a/test/src/concrete/RainterpreterParserNPE2.pointers.t.sol b/test/src/concrete/RainterpreterParserNPE2.pointers.t.sol index 42ca36c3e..ec116f011 100644 --- a/test/src/concrete/RainterpreterParserNPE2.pointers.t.sol +++ b/test/src/concrete/RainterpreterParserNPE2.pointers.t.sol @@ -28,7 +28,7 @@ contract RainterpreterParserNPE2PointersTest is Test { assertEq(actual, expected); } - function testParserParseMeta() external { + function testParserParseMeta() external pure { bytes memory authoringMetaBytes = LibAllStandardOpsNP.authoringMetaV2(); AuthoringMetaV2[] memory authoringMeta = abi.decode(authoringMetaBytes, (AuthoringMetaV2[])); bytes memory expected = LibGenParseMeta.buildParseMetaV2(authoringMeta, PARSE_META_BUILD_DEPTH); diff --git a/test/src/concrete/RainterpreterReferenceExternNPE2.ierc165.t.sol b/test/src/concrete/RainterpreterReferenceExternNPE2.ierc165.t.sol index 004d1a0a8..44de71d68 100644 --- a/test/src/concrete/RainterpreterReferenceExternNPE2.ierc165.t.sol +++ b/test/src/concrete/RainterpreterReferenceExternNPE2.ierc165.t.sol @@ -7,7 +7,7 @@ import {IERC165} from "openzeppelin-contracts/contracts/utils/introspection/IERC import {IInterpreterExternV3} from "rain.interpreter.interface/interface/IInterpreterExternV3.sol"; import {ISubParserV3} from "rain.interpreter.interface/interface/ISubParserV3.sol"; import {RainterpreterReferenceExternNPE2} from "src/concrete/extern/RainterpreterReferenceExternNPE2.sol"; -import {IDescribedByMetaV1} from "rain.metadata/interface/unstable/IDescribedByMetaV1.sol"; +import {IDescribedByMetaV1} from "rain.metadata/interface/IDescribedByMetaV1.sol"; contract RainterpreterReferenceExternNPE2IERC165Test is Test { /// Test that ERC165 is implemented for the reference extern contract. diff --git a/test/src/concrete/RainterpreterReferenceExternNPE2.intInc.t.sol b/test/src/concrete/RainterpreterReferenceExternNPE2.intInc.t.sol index f783d634a..960e3ee9d 100644 --- a/test/src/concrete/RainterpreterReferenceExternNPE2.intInc.t.sol +++ b/test/src/concrete/RainterpreterReferenceExternNPE2.intInc.t.sol @@ -130,7 +130,7 @@ contract RainterpreterReferenceExternNPE2IntIncTest is OpTest { /// Test the inc library directly. The run function should increment every /// value it is passed by 1. - function testRainterpreterReferenceExternNPE2IntIncRun(Operand operand, uint256[] memory inputs) external { + function testRainterpreterReferenceExternNPE2IntIncRun(Operand operand, uint256[] memory inputs) external pure { uint256[] memory expectedOutputs = new uint256[](inputs.length); for (uint256 i = 0; i < inputs.length; i++) { vm.assume(inputs[i] < type(uint256).max); @@ -148,6 +148,7 @@ contract RainterpreterReferenceExternNPE2IntIncTest is OpTest { /// same inputs and outputs. function testRainterpreterReferenceExternNPE2IntIncIntegrity(Operand operand, uint256 inputs, uint256 outputs) external + pure { (uint256 calcInputs, uint256 calcOutputs) = LibExternOpIntIncNPE2.integrity(operand, inputs, outputs); assertEq(calcInputs, inputs); diff --git a/test/src/concrete/RainterpreterReferenceExternNPE2.pointers.t.sol b/test/src/concrete/RainterpreterReferenceExternNPE2.pointers.t.sol index 30e670100..b6bcc1eb2 100644 --- a/test/src/concrete/RainterpreterReferenceExternNPE2.pointers.t.sol +++ b/test/src/concrete/RainterpreterReferenceExternNPE2.pointers.t.sol @@ -31,7 +31,7 @@ contract RainterpreterReferenceExternNPE2PointersTest is Test { assertEq(actual, expected); } - function testSubParserParseMeta() external { + function testSubParserParseMeta() external pure { bytes memory authoringMetaBytes = LibRainterpreterReferenceExternNPE2.authoringMetaV2(); AuthoringMetaV2[] memory authoringMeta = abi.decode(authoringMetaBytes, (AuthoringMetaV2[])); bytes memory expected = LibGenParseMeta.buildParseMetaV2(authoringMeta, 2); diff --git a/test/src/lib/eval/LibEvalNP.fBounds.t.sol b/test/src/lib/eval/LibEvalNP.fBounds.t.sol index d3071c143..8a4ebf315 100644 --- a/test/src/lib/eval/LibEvalNP.fBounds.t.sol +++ b/test/src/lib/eval/LibEvalNP.fBounds.t.sol @@ -15,7 +15,7 @@ contract LibEvalNPFBoundsTest is Test { /// Due to the mod of indexes to function pointers the indexes wrap at the /// length of the function pointers. Test that the length of the fn pointers /// + 1 is the constant op. - function testEvalNPFBoundsModConstant(uint256 c) public { + function testEvalNPFBoundsModConstant(uint256 c) public view { bytes memory fs = LibAllStandardOpsNP.opcodeFunctionPointers(); bytes memory bytecode = diff --git a/test/src/lib/extern/LibExtern.codec.t.sol b/test/src/lib/extern/LibExtern.codec.t.sol index 710a7b96b..6a265be5d 100644 --- a/test/src/lib/extern/LibExtern.codec.t.sol +++ b/test/src/lib/extern/LibExtern.codec.t.sol @@ -13,7 +13,7 @@ import {LibExtern, ExternDispatch} from "src/lib/extern/LibExtern.sol"; /// calling and internal dispatch. contract LibExternCodecTest is Test { /// Ensure `encodeExternDispatch` encodes the opcode and operand correctly. - function testLibExternCodecEncodeExternDispatch(uint256 opcode, uint256 operand) external { + function testLibExternCodecEncodeExternDispatch(uint256 opcode, uint256 operand) external pure { opcode = bound(opcode, 0, type(uint16).max); operand = bound(operand, 0, type(uint16).max); ExternDispatch dispatch = LibExtern.encodeExternDispatch(opcode, Operand.wrap(operand)); @@ -23,7 +23,7 @@ contract LibExternCodecTest is Test { } /// Ensure `encodeExternCall` encodes the address and dispatch correctly. - function testLibExternCodecEncodeExternCall(uint256 opcode, uint256 operand) external { + function testLibExternCodecEncodeExternCall(uint256 opcode, uint256 operand) external pure { opcode = bound(opcode, 0, type(uint16).max); operand = bound(operand, 0, type(uint16).max); IInterpreterExternV3 extern = IInterpreterExternV3(address(0x1234567890123456789012345678901234567890)); diff --git a/test/src/lib/op/00/LibOpConstantNP.t.sol b/test/src/lib/op/00/LibOpConstantNP.t.sol index 4f72580b8..b6da9ca4a 100644 --- a/test/src/lib/op/00/LibOpConstantNP.t.sol +++ b/test/src/lib/op/00/LibOpConstantNP.t.sol @@ -27,7 +27,7 @@ contract LibOpConstantNPTest is OpTest { /// Directly test the integrity logic of LibOpConstantNP. The operand always /// puts a single value on the stack. This tests the happy path where the /// operand points to a value in the constants array. - function testOpConstantNPIntegrity(IntegrityCheckStateNP memory state, Operand operand) external { + function testOpConstantNPIntegrity(IntegrityCheckStateNP memory state, Operand operand) external pure { vm.assume(state.constants.length > 0); operand = Operand.wrap(bound(Operand.unwrap(operand), 0, state.constants.length - 1)); @@ -53,7 +53,7 @@ contract LibOpConstantNPTest is OpTest { /// Directly test the runtime logic of LibOpConstantNP. This tests that the /// operand always puts a single value on the stack. - function testOpConstantNPRun(uint256[] memory constants, uint16 constantIndex) external { + function testOpConstantNPRun(uint256[] memory constants, uint16 constantIndex) external view { InterpreterStateNP memory state = opTestDefaultInterpreterState(); state.constants = constants; vm.assume(state.constants.length > 0); @@ -80,7 +80,7 @@ contract LibOpConstantNPTest is OpTest { } /// Test the eval of a constant opcode parsed from a string. - function testOpConstantEvalNPE2E() external { + function testOpConstantEvalNPE2E() external view { bytes memory bytecode = iDeployer.parse2("_ _: 2 1.001;"); (uint256[] memory stack, uint256[] memory kvs) = iInterpreter.eval4( diff --git a/test/src/lib/op/00/LibOpContextNP.t.sol b/test/src/lib/op/00/LibOpContextNP.t.sol index 2dc034901..2c22e3f78 100644 --- a/test/src/lib/op/00/LibOpContextNP.t.sol +++ b/test/src/lib/op/00/LibOpContextNP.t.sol @@ -25,7 +25,7 @@ contract LibOpContextNPTest is OpTest { /// Directly test the integrity logic of LibOpContextNP. All operands are /// valid, so the integrity check should always pass. The inputs and /// outputs are always 0 and 1 respectively. - function testOpContextNPIntegrity(IntegrityCheckStateNP memory state, Operand operand) external { + function testOpContextNPIntegrity(IntegrityCheckStateNP memory state, Operand operand) external pure { (uint256 calcInputs, uint256 calcOutputs) = LibOpContextNP.integrity(state, operand); assertEq(calcInputs, 0, "inputs"); @@ -34,7 +34,7 @@ contract LibOpContextNPTest is OpTest { /// Directly test the runtime logic of LibOpContextNP. This tests that the /// values in the context matrix can be pushed to the stack via. the operand. - function testOpContextNPRun(uint256[][] memory context, uint256 i, uint256 j) external { + function testOpContextNPRun(uint256[][] memory context, uint256 i, uint256 j) external view { InterpreterStateNP memory state = opTestDefaultInterpreterState(); state.context = context; vm.assume(state.context.length > 0); @@ -85,7 +85,7 @@ contract LibOpContextNPTest is OpTest { } /// Test the eval of context opcode parsed from a string. This tests 0 0. - function testOpContextNPEval00(uint256[][] memory context) external { + function testOpContextNPEval00(uint256[][] memory context) external view { vm.assume(context.length > 0); vm.assume(context[0].length > 0); bytes memory bytecode = iDeployer.parse2("_: context<0 0>();"); @@ -108,7 +108,7 @@ contract LibOpContextNPTest is OpTest { } /// Test the eval of context opcode parsed from a string. This tests 0 1. - function testOpContextNPEval01(uint256[][] memory context) external { + function testOpContextNPEval01(uint256[][] memory context) external view { vm.assume(context.length > 0); vm.assume(context[0].length > 1); bytes memory bytecode = iDeployer.parse2("_: context<0 1>();"); @@ -130,7 +130,7 @@ contract LibOpContextNPTest is OpTest { } /// Test the eval of context opcode parsed from a string. This tests 1 0. - function testOpContextNPEval10(uint256[][] memory context) external { + function testOpContextNPEval10(uint256[][] memory context) external view { vm.assume(context.length > 1); vm.assume(context[1].length > 0); bytes memory bytecode = iDeployer.parse2("_: context<1 0>();"); @@ -153,7 +153,7 @@ contract LibOpContextNPTest is OpTest { } /// Test the eval of context opcode parsed from a string. This tests 1 1. - function testOpContextNPEval11(uint256[][] memory context) external { + function testOpContextNPEval11(uint256[][] memory context) external view { vm.assume(context.length > 1); vm.assume(context[1].length > 1); bytes memory bytecode = iDeployer.parse2("_: context<1 1>();"); diff --git a/test/src/lib/op/00/LibOpStackNP.t.sol b/test/src/lib/op/00/LibOpStackNP.t.sol index 497584106..077cf7d1b 100644 --- a/test/src/lib/op/00/LibOpStackNP.t.sol +++ b/test/src/lib/op/00/LibOpStackNP.t.sol @@ -36,7 +36,7 @@ contract LibOpStackNPTest is OpTest { uint256 stackIndex, uint256[] memory constants, Operand operand - ) external { + ) external pure { stackIndex = bound(stackIndex, 1, type(uint256).max); operand = Operand.wrap(bound(Operand.unwrap(operand), 0, stackIndex - 1)); IntegrityCheckStateNP memory state = LibIntegrityCheckNP.newState(bytecode, stackIndex, constants); @@ -69,7 +69,7 @@ contract LibOpStackNPTest is OpTest { /// Directly test the runtime logic of LibOpStackNP. This tests that the /// operand always puts a single value on the stack. - function testOpStackNPRun(uint256[][] memory stacks, uint256 stackIndex) external { + function testOpStackNPRun(uint256[][] memory stacks, uint256 stackIndex) external view { InterpreterStateNP memory state = opTestDefaultInterpreterState(); uint256 stackValue; { @@ -128,7 +128,7 @@ contract LibOpStackNPTest is OpTest { } /// Test the eval of a stack opcode parsed from a string. - function testOpStackEval() external { + function testOpStackEval() external view { bytes memory bytecode = iDeployer.parse2("foo: 1, bar: foo, _: -1;"); (uint256[] memory stack, uint256[] memory kvs) = iInterpreter.eval4( EvalV4({ @@ -149,7 +149,7 @@ contract LibOpStackNPTest is OpTest { } /// Test the eval of several stack opcodes parsed from a string. - function testOpStackEvalSeveral() external { + function testOpStackEvalSeveral() external view { bytes memory bytecode = iDeployer.parse2("foo: 1, bar: foo, _ baz: bar bar, bing _:foo baz;"); (uint256[] memory stack, uint256[] memory kvs) = iInterpreter.eval4( diff --git a/test/src/lib/op/LibAllStandardOpsNP.t.sol b/test/src/lib/op/LibAllStandardOpsNP.t.sol index ba7059e6a..e84047726 100644 --- a/test/src/lib/op/LibAllStandardOpsNP.t.sol +++ b/test/src/lib/op/LibAllStandardOpsNP.t.sol @@ -12,13 +12,13 @@ import "src/lib/op/LibAllStandardOpsNP.sol"; /// logic can only be tested by deploying an interpreter and running it. contract LibAllStandardOpsNPTest is Test { /// Test that the dynamic length of the function pointers is correct. - function testIntegrityFunctionPointersLength() external { + function testIntegrityFunctionPointersLength() external pure { bytes memory integrityFunctionPointers = LibAllStandardOpsNP.integrityFunctionPointers(); assertEq(integrityFunctionPointers.length, ALL_STANDARD_OPS_LENGTH * 2); } /// Test that the dynamic length of the function pointers is correct. - function testOpcodeFunctionPointersLength() external { + function testOpcodeFunctionPointersLength() external pure { bytes memory functionPointers = LibAllStandardOpsNP.opcodeFunctionPointers(); // Each function pointer is 2 bytes. assertEq(functionPointers.length, ALL_STANDARD_OPS_LENGTH * 2); @@ -26,7 +26,7 @@ contract LibAllStandardOpsNPTest is Test { /// Test that the integrity function pointers length and opcode function /// pointers length are the same. - function testIntegrityAndOpcodeFunctionPointersLength() external { + function testIntegrityAndOpcodeFunctionPointersLength() external pure { bytes memory integrityFunctionPointers = LibAllStandardOpsNP.integrityFunctionPointers(); bytes memory functionPointers = LibAllStandardOpsNP.opcodeFunctionPointers(); diff --git a/test/src/lib/op/bitwise/LibOpBitwiseAndNP.t.sol b/test/src/lib/op/bitwise/LibOpBitwiseAndNP.t.sol index 1e9f9e973..7be891cdc 100644 --- a/test/src/lib/op/bitwise/LibOpBitwiseAndNP.t.sol +++ b/test/src/lib/op/bitwise/LibOpBitwiseAndNP.t.sol @@ -12,7 +12,7 @@ import {LibOperand} from "test/lib/operand/LibOperand.sol"; contract LibOpBitwiseAndNPTest is OpTest { /// Directly test the integrity logic of LibOpBitwiseAndNP. All possible /// operands result in the same number of inputs and outputs, (2, 1). - function testOpBitwiseAndNPIntegrity(IntegrityCheckStateNP memory state, Operand operand) external { + function testOpBitwiseAndNPIntegrity(IntegrityCheckStateNP memory state, Operand operand) external pure { (uint256 calcInputs, uint256 calcOutputs) = LibOpBitwiseAndNP.integrity(state, operand); assertEq(calcInputs, 2); assertEq(calcOutputs, 1); @@ -20,7 +20,7 @@ contract LibOpBitwiseAndNPTest is OpTest { /// Directly test the runtime logic of LibOpBitwiseAndNP. This tests that the /// opcode correctly pushes the bitwise AND onto the stack. - function testOpBitwiseAndNPRun(uint256 x, uint256 y) external { + function testOpBitwiseAndNPRun(uint256 x, uint256 y) external view { InterpreterStateNP memory state = opTestDefaultInterpreterState(); uint256[] memory inputs = new uint256[](2); inputs[0] = x; @@ -32,7 +32,7 @@ contract LibOpBitwiseAndNPTest is OpTest { } /// Test the eval of bitwise AND parsed from a string. - function testOpBitwiseAndNPEvalHappy() external { + function testOpBitwiseAndNPEvalHappy() external view { checkHappy("_: bitwise-and(0 0);", 0, "0 0"); checkHappy("_: bitwise-and(0 1e-18);", 0, "0 1"); checkHappy("_: bitwise-and(1e-18 0);", 0, "1 0"); diff --git a/test/src/lib/op/bitwise/LibOpBitwiseOrNP.t.sol b/test/src/lib/op/bitwise/LibOpBitwiseOrNP.t.sol index ee16fdeea..787acbb4f 100644 --- a/test/src/lib/op/bitwise/LibOpBitwiseOrNP.t.sol +++ b/test/src/lib/op/bitwise/LibOpBitwiseOrNP.t.sol @@ -12,7 +12,7 @@ import {LibOperand} from "test/lib/operand/LibOperand.sol"; contract LibOpBitwiseOrNPTest is OpTest { /// Directly test the integrity logic of LibOpBitwiseOrNP. All possible /// operands result in the same number of inputs and outputs, (2, 1). - function testOpBitwiseORNPIntegrity(IntegrityCheckStateNP memory state, Operand operand) external { + function testOpBitwiseORNPIntegrity(IntegrityCheckStateNP memory state, Operand operand) external pure { (uint256 calcInputs, uint256 calcOutputs) = LibOpBitwiseOrNP.integrity(state, operand); assertEq(calcInputs, 2); assertEq(calcOutputs, 1); @@ -20,7 +20,7 @@ contract LibOpBitwiseOrNPTest is OpTest { /// Directly test the runtime logic of LibOpBitwiseOrNP. This tests that the /// opcode correctly pushes the bitwise OR onto the stack. - function testOpBitwiseORNPRun(uint256 x, uint256 y) external { + function testOpBitwiseORNPRun(uint256 x, uint256 y) external view { InterpreterStateNP memory state = opTestDefaultInterpreterState(); uint256[] memory inputs = new uint256[](2); inputs[0] = x; @@ -32,7 +32,7 @@ contract LibOpBitwiseOrNPTest is OpTest { } /// Test the eval of bitwise OR parsed from a string. - function testOpBitwiseORNPEval() external { + function testOpBitwiseORNPEval() external view { checkHappy("_: bitwise-or(0 0);", 0, "0 0"); checkHappy("_: bitwise-or(0 1e-18);", 1, "0 1"); checkHappy("_: bitwise-or(1e-18 0);", 1, "1 0"); diff --git a/test/src/lib/op/bitwise/LibOpCtPopNP.t.sol b/test/src/lib/op/bitwise/LibOpCtPopNP.t.sol index 6fa03dee2..e70930899 100644 --- a/test/src/lib/op/bitwise/LibOpCtPopNP.t.sol +++ b/test/src/lib/op/bitwise/LibOpCtPopNP.t.sol @@ -22,7 +22,7 @@ import {Strings} from "openzeppelin-contracts/contracts/utils/Strings.sol"; contract LibOpCtPopNPTest is OpTest { /// Directly test the integrity logic of LibOpCtPopNP. All possible operands /// result in the same number of inputs and outputs, (1, 1). - function testOpCtPopNPIntegrity(IntegrityCheckStateNP memory state, Operand operand) external { + function testOpCtPopNPIntegrity(IntegrityCheckStateNP memory state, Operand operand) external pure { (uint256 calcInputs, uint256 calcOutputs) = LibOpCtPopNP.integrity(state, operand); assertEq(calcInputs, 1); assertEq(calcOutputs, 1); @@ -30,7 +30,7 @@ contract LibOpCtPopNPTest is OpTest { /// Directly test the runtime logic of LibOpCtPopNP. This tests that the /// opcode correctly pushes the ct pop onto the stack. - function testOpCtPopNPRun(uint256 x) external { + function testOpCtPopNPRun(uint256 x) external view { InterpreterStateNP memory state = opTestDefaultInterpreterState(); uint256[] memory inputs = new uint256[](1); inputs[0] = x; @@ -39,7 +39,7 @@ contract LibOpCtPopNPTest is OpTest { } /// Test the eval of a ct pop opcode parsed from a string. - function testOpCtPopNPEval(uint256 x) external { + function testOpCtPopNPEval(uint256 x) external view { uint256[] memory stack = new uint256[](1); stack[0] = LibCtPop.ctpop(x) * 1e18; checkHappy(bytes(string.concat("_: bitwise-count-ones(", Strings.toString(x), "e-18);")), stack, ""); diff --git a/test/src/lib/op/bitwise/LibOpDecodeBitsNP.t.sol b/test/src/lib/op/bitwise/LibOpDecodeBitsNP.t.sol index d8ef398e2..44b62c480 100644 --- a/test/src/lib/op/bitwise/LibOpDecodeBitsNP.t.sol +++ b/test/src/lib/op/bitwise/LibOpDecodeBitsNP.t.sol @@ -20,7 +20,7 @@ contract LibOpDecodeBitsNPTest is OpTest { uint8 outputs, uint8 start8Bit, uint8 length8Bit - ) external { + ) external pure { inputs = uint8(bound(inputs, 0, 0x0F)); outputs = uint8(bound(outputs, 0, 0x0F)); uint256 start = bound(uint256(start8Bit), 0, type(uint8).max); @@ -56,7 +56,7 @@ contract LibOpDecodeBitsNPTest is OpTest { /// Directly test the runtime logic of LibOpDecodeBitsNP. This tests that the /// opcode correctly pushes the decoded bits onto the stack. - function testOpDecodeBitsNPRun(uint256 value, uint8 start8Bit, uint8 length8Bit) external { + function testOpDecodeBitsNPRun(uint256 value, uint8 start8Bit, uint8 length8Bit) external view { uint256 start = uint256(start8Bit); uint256 length = bound(uint256(length8Bit), 1, type(uint8).max - start + 1); Operand operand = LibOperand.build(1, 1, uint16((uint256(length) << 8) | uint256(start))); @@ -69,7 +69,7 @@ contract LibOpDecodeBitsNPTest is OpTest { } /// Test the eval of decoding bits parsed from a string. - function testOpDecodeBitsNPEvalHappy() external { + function testOpDecodeBitsNPEvalHappy() external view { checkHappy("_:bitwise-decode<0 1>(0);", 0, "0 1 0"); checkHappy("_:bitwise-decode<0 1>(1e-18);", 1, "0 1 1"); checkHappy("_:bitwise-decode<0 1>(2e-18);", 0, "0 1 2"); diff --git a/test/src/lib/op/bitwise/LibOpEncodeBitsNP.t.sol b/test/src/lib/op/bitwise/LibOpEncodeBitsNP.t.sol index b7ab2ae02..6fb3850cf 100644 --- a/test/src/lib/op/bitwise/LibOpEncodeBitsNP.t.sol +++ b/test/src/lib/op/bitwise/LibOpEncodeBitsNP.t.sol @@ -16,6 +16,7 @@ contract LibOpEncodeBitsNPTest is OpTest { /// that here. function testOpEncodeBitsNPIntegrity(IntegrityCheckStateNP memory state, uint8 start8Bit, uint8 length8Bit) external + pure { uint256 start = uint256(start8Bit); uint256 length = bound(uint256(length8Bit), 1, type(uint8).max - start + 1); @@ -50,7 +51,7 @@ contract LibOpEncodeBitsNPTest is OpTest { /// Directly test the runtime logic of LibOpEncodeBitsNP. This tests that the /// opcode correctly pushes the encoded bits onto the stack. - function testOpEncodeBitsNPRun(uint256 source, uint256 target, uint8 start8Bit, uint8 length8Bit) external { + function testOpEncodeBitsNPRun(uint256 source, uint256 target, uint8 start8Bit, uint8 length8Bit) external view { uint256 start = uint256(start8Bit); uint256 length = bound(uint256(length8Bit), 1, type(uint8).max - start + 1); Operand operand = LibOperand.build(2, 1, uint16((uint256(length) << 8) | uint256(start))); @@ -64,7 +65,7 @@ contract LibOpEncodeBitsNPTest is OpTest { } /// Test the eval of encoding bits parsed from a string. - function testOpEncodeBitsNPEvalHappy() external { + function testOpEncodeBitsNPEvalHappy() external view { checkHappy("_:bitwise-encode<0 1>(0 0);", 0, "0 0"); checkHappy("_:bitwise-encode<0 1>(0 1e-18);", 0, "0 1"); checkHappy("_:bitwise-encode<0 1>(1e-18 0);", 1, "1 0"); diff --git a/test/src/lib/op/bitwise/LibOpShiftBitsLeftNP.t.sol b/test/src/lib/op/bitwise/LibOpShiftBitsLeftNP.t.sol index f91ee49a5..74d5d74da 100644 --- a/test/src/lib/op/bitwise/LibOpShiftBitsLeftNP.t.sol +++ b/test/src/lib/op/bitwise/LibOpShiftBitsLeftNP.t.sol @@ -27,7 +27,7 @@ contract LibOpShiftBitsLeftNPTest is OpTest { uint8 inputs, uint8 outputs, uint8 shiftAmount - ) external { + ) external pure { vm.assume(shiftAmount != 0); inputs = uint8(bound(inputs, 1, 0x0F)); outputs = uint8(bound(outputs, 1, 0x0F)); @@ -63,7 +63,7 @@ contract LibOpShiftBitsLeftNPTest is OpTest { /// Directly test the runtime logic of LibOpShiftBitsLeftNP. This tests that /// the opcode correctly shifts bits left. - function testOpShiftBitsLeftNPRun(uint256 x, uint8 shiftAmount) external { + function testOpShiftBitsLeftNPRun(uint256 x, uint8 shiftAmount) external view { vm.assume(shiftAmount != 0); InterpreterStateNP memory state = opTestDefaultInterpreterState(); uint256[] memory inputs = new uint256[](1); @@ -80,7 +80,7 @@ contract LibOpShiftBitsLeftNPTest is OpTest { } /// Test the eval of a shift bits left opcode parsed from a string. - function testOpShiftBitsLeftNPEval() external { + function testOpShiftBitsLeftNPEval() external view { checkHappy("_: bitwise-shift-left<1>(0);", 0, "1, 0"); checkHappy("_: bitwise-shift-left<2>(0);", 0, "2, 0"); checkHappy("_: bitwise-shift-left<3>(0);", 0, "3, 0"); diff --git a/test/src/lib/op/bitwise/LibOpShiftBitsRightNP.t.sol b/test/src/lib/op/bitwise/LibOpShiftBitsRightNP.t.sol index a2f4c2754..ba5e7dbb1 100644 --- a/test/src/lib/op/bitwise/LibOpShiftBitsRightNP.t.sol +++ b/test/src/lib/op/bitwise/LibOpShiftBitsRightNP.t.sol @@ -27,7 +27,7 @@ contract LibOpShiftBitsRightNPTest is OpTest { uint8 inputs, uint8 outputs, uint8 shiftAmount - ) external { + ) external pure { vm.assume(shiftAmount != 0); inputs = uint8(bound(inputs, 1, 0x0F)); outputs = uint8(bound(outputs, 1, 0x0F)); @@ -62,7 +62,7 @@ contract LibOpShiftBitsRightNPTest is OpTest { /// Directly test the runtime logic of LibOpShiftBitsRightNP. This tests that /// the opcode correctly shifts bits right. - function testOpShiftBitsRightNPRun(uint256 x, uint8 shiftAmount) external { + function testOpShiftBitsRightNPRun(uint256 x, uint8 shiftAmount) external view { vm.assume(shiftAmount != 0); InterpreterStateNP memory state = opTestDefaultInterpreterState(); uint256[] memory inputs = new uint256[](1); @@ -79,7 +79,7 @@ contract LibOpShiftBitsRightNPTest is OpTest { } /// Test the eval of a shift bits right opcode parsed from a string. - function testOpShiftBitsRightNPEval() external { + function testOpShiftBitsRightNPEval() external view { checkHappy("_: bitwise-shift-right<1>(0);", 0, "1, 0"); checkHappy("_: bitwise-shift-right<2>(0);", 0, "2, 0"); checkHappy("_: bitwise-shift-right<3>(0);", 0, "3, 0"); diff --git a/test/src/lib/op/call/LibOpCallNP.t.sol b/test/src/lib/op/call/LibOpCallNP.t.sol index 1feeeea62..0c2d5c6d9 100644 --- a/test/src/lib/op/call/LibOpCallNP.t.sol +++ b/test/src/lib/op/call/LibOpCallNP.t.sol @@ -82,7 +82,7 @@ contract LibOpCallNPTest is OpTest, BytecodeTest { uint256 outputs, uint8 sourceCount, bytes32 seed - ) external { + ) external pure { inputs = bound(inputs, 0, 0x0F); conformBytecode(state.bytecode, sourceCount, seed); @@ -204,7 +204,7 @@ contract LibOpCallNPTest is OpTest, BytecodeTest { // } /// Boilerplate for checking the stack and kvs of a call. - function checkCallNPRun(bytes memory rainlang, uint256[] memory stack, uint256[] memory kvs) internal { + function checkCallNPRun(bytes memory rainlang, uint256[] memory stack, uint256[] memory kvs) internal view { bytes memory bytecode = iDeployer.parse2(rainlang); (uint256[] memory actualStack, uint256[] memory actualKVs) = iInterpreter.eval4( EvalV4({ @@ -228,7 +228,7 @@ contract LibOpCallNPTest is OpTest, BytecodeTest { } // /// Test the eval of call to see various stacks. - // function testOpCallNPRunNoIO() external { + // function testOpCallNPRunNoIO() external view { // // Check evals that result in no stack or kvs. // uint256[] memory stack = new uint256[](0); // uint256[] memory kvs = new uint256[](0); diff --git a/test/src/lib/op/crypto/LibOpHashNP.t.sol b/test/src/lib/op/crypto/LibOpHashNP.t.sol index a52604e21..2c160bb2e 100644 --- a/test/src/lib/op/crypto/LibOpHashNP.t.sol +++ b/test/src/lib/op/crypto/LibOpHashNP.t.sol @@ -38,7 +38,7 @@ contract LibOpHashNPTest is OpTest { uint8 inputs, uint8 outputs, uint16 operandData - ) external { + ) external pure { inputs = uint8(bound(inputs, 0, 0x0F)); outputs = uint8(bound(outputs, 0, 0x0F)); Operand operand = LibOperand.build(inputs, outputs, operandData); @@ -49,7 +49,7 @@ contract LibOpHashNPTest is OpTest { } /// Directly test the runtime logic of LibOpHashNP. - function testOpHashNPRun(uint256[] memory inputs) external { + function testOpHashNPRun(uint256[] memory inputs) external view { vm.assume(inputs.length <= 0x0F); InterpreterStateNP memory state = opTestDefaultInterpreterState(); Operand operand = LibOperand.build(uint8(inputs.length), 1, 0); @@ -90,7 +90,7 @@ contract LibOpHashNPTest is OpTest { /// Test the eval of a hash opcode parsed from a string. Tests 2 inputs and /// other stack items. - function testOpHashNPEval2InputsOtherStack() external { + function testOpHashNPEval2InputsOtherStack() external view { bytes memory bytecode = iDeployer.parse2("_ _ _: 5 hash(0x1234567890abcdef 0xfedcba0987654321) 9;"); (uint256[] memory stack, uint256[] memory kvs) = iInterpreter.eval4( EvalV4({ diff --git a/test/src/lib/op/erc20/LibOpERC20Allowance.t.sol b/test/src/lib/op/erc20/LibOpERC20Allowance.t.sol index 1c34954f2..32d1e5d67 100644 --- a/test/src/lib/op/erc20/LibOpERC20Allowance.t.sol +++ b/test/src/lib/op/erc20/LibOpERC20Allowance.t.sol @@ -14,7 +14,7 @@ // /// @title LibOpERC20AllowanceTest // /// @notice Test the opcode for getting the allowance of an erc20 token. // contract LibOpERC20AllowanceTest is OpTest { -// function testOpERC20AllowanceNPIntegrity(IntegrityCheckStateNP memory state, Operand operand) external { +// function testOpERC20AllowanceNPIntegrity(IntegrityCheckStateNP memory state, Operand operand) external pure { // (uint256 calcInputs, uint256 calcOutputs) = LibOpERC20Allowance.integrity(state, operand); // assertEq(calcInputs, 3); diff --git a/test/src/lib/op/erc20/LibOpERC20BalanceOf.t.sol b/test/src/lib/op/erc20/LibOpERC20BalanceOf.t.sol index a62f4f4e5..f43d537bb 100644 --- a/test/src/lib/op/erc20/LibOpERC20BalanceOf.t.sol +++ b/test/src/lib/op/erc20/LibOpERC20BalanceOf.t.sol @@ -16,7 +16,7 @@ // /// @title LibOpERC20BalanceOfTest // /// @notice Test the opcode for getting the balance of an erc20 token. // contract LibOpERC20BalanceOfTest is OpTest { -// function testOpERC20BalanceOfNPIntegrity(IntegrityCheckStateNP memory state, Operand operand) external { +// function testOpERC20BalanceOfNPIntegrity(IntegrityCheckStateNP memory state, Operand operand) external pure { // (uint256 calcInputs, uint256 calcOutputs) = LibOpERC20BalanceOf.integrity(state, operand); // assertEq(calcInputs, 2); diff --git a/test/src/lib/op/erc20/LibOpERC20TotalSupply.t.sol b/test/src/lib/op/erc20/LibOpERC20TotalSupply.t.sol index 7a6696892..d14f28e62 100644 --- a/test/src/lib/op/erc20/LibOpERC20TotalSupply.t.sol +++ b/test/src/lib/op/erc20/LibOpERC20TotalSupply.t.sol @@ -16,7 +16,7 @@ // /// @title LibOpERC20TotalSupplyTest // /// @notice Test the opcode for getting the total supply of an erc20 contract. // contract LibOpERC20TotalSupplyTest is OpTest { -// function testOpERC20TotalSupplyNPIntegrity(IntegrityCheckStateNP memory state, Operand operand) external { +// function testOpERC20TotalSupplyNPIntegrity(IntegrityCheckStateNP memory state, Operand operand) external pure { // (uint256 calcInputs, uint256 calcOutputs) = LibOpERC20TotalSupply.integrity(state, operand); // assertEq(calcInputs, 1); diff --git a/test/src/lib/op/erc20/uint256/LibOpUint256ERC20Allowance.t.sol b/test/src/lib/op/erc20/uint256/LibOpUint256ERC20Allowance.t.sol index db66ee370..c2c099d22 100644 --- a/test/src/lib/op/erc20/uint256/LibOpUint256ERC20Allowance.t.sol +++ b/test/src/lib/op/erc20/uint256/LibOpUint256ERC20Allowance.t.sol @@ -12,7 +12,7 @@ // /// @title LibOpUint256ERC20AllowanceTest // /// @notice Test the opcode for getting the allowance of an erc20 token. // contract LibOpUint256ERC20AllowanceTest is OpTest { -// function testOpERC20AllowanceNPIntegrity(IntegrityCheckStateNP memory state, Operand operand) external { +// function testOpERC20AllowanceNPIntegrity(IntegrityCheckStateNP memory state, Operand operand) external pure { // (uint256 calcInputs, uint256 calcOutputs) = LibOpUint256ERC20Allowance.integrity(state, operand); // assertEq(calcInputs, 3); diff --git a/test/src/lib/op/erc20/uint256/LibOpUint256ERC20BalanceOf.t.sol b/test/src/lib/op/erc20/uint256/LibOpUint256ERC20BalanceOf.t.sol index cae8045a5..46294fd20 100644 --- a/test/src/lib/op/erc20/uint256/LibOpUint256ERC20BalanceOf.t.sol +++ b/test/src/lib/op/erc20/uint256/LibOpUint256ERC20BalanceOf.t.sol @@ -1,82 +1,82 @@ -// // SPDX-License-Identifier: CAL -// pragma solidity =0.8.25; +// // // SPDX-License-Identifier: CAL +// // pragma solidity =0.8.25; -// import {OpTest} from "test/abstract/OpTest.sol"; -// import {IntegrityCheckStateNP} from "src/lib/integrity/LibIntegrityCheckNP.sol"; -// import {Operand} from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; -// import {LibOpUint256ERC20BalanceOf} from "src/lib/op/erc20/uint256/LibOpUint256ERC20BalanceOf.sol"; -// import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; -// import {UnexpectedOperand} from "src/error/ErrParse.sol"; -// import {LibOperand} from "test/lib/operand/LibOperand.sol"; +// // import {OpTest} from "test/abstract/OpTest.sol"; +// // import {IntegrityCheckStateNP} from "src/lib/integrity/LibIntegrityCheckNP.sol"; +// // import {Operand} from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; +// // import {LibOpUint256ERC20BalanceOf} from "src/lib/op/erc20/uint256/LibOpUint256ERC20BalanceOf.sol"; +// // import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; +// // import {UnexpectedOperand} from "src/error/ErrParse.sol"; +// // import {LibOperand} from "test/lib/operand/LibOperand.sol"; // /// @title LibOpUint256ERC20BalanceOfTest // /// @notice Test the opcode for getting the balance of an erc20 token. // contract LibOpUint256ERC20BalanceOfTest is OpTest { -// function testOpERC20BalanceOfNPIntegrity(IntegrityCheckStateNP memory state, Operand operand) external { +// function testOpERC20BalanceOfNPIntegrity(IntegrityCheckStateNP memory state, Operand operand) external pure { // (uint256 calcInputs, uint256 calcOutputs) = LibOpUint256ERC20BalanceOf.integrity(state, operand); -// assertEq(calcInputs, 2); -// assertEq(calcOutputs, 1); -// } +// // assertEq(calcInputs, 2); +// // assertEq(calcOutputs, 1); +// // } -// function testOpERC20BalanceOfNPRun(address token, address account, uint256 balance, uint16 operandData) external { -// assumeEtchable(token); -// vm.etch(token, hex"fe"); +// // function testOpERC20BalanceOfNPRun(address token, address account, uint256 balance, uint16 operandData) external { +// // assumeEtchable(token); +// // vm.etch(token, hex"fe"); -// uint256[] memory inputs = new uint256[](2); -// inputs[0] = uint256(uint160(token)); -// inputs[1] = uint256(uint160(account)); -// Operand operand = LibOperand.build(2, 1, operandData); +// // uint256[] memory inputs = new uint256[](2); +// // inputs[0] = uint256(uint160(token)); +// // inputs[1] = uint256(uint160(account)); +// // Operand operand = LibOperand.build(2, 1, operandData); -// vm.mockCall(token, abi.encodeWithSelector(IERC20.balanceOf.selector, account), abi.encode(balance)); -// // called once for reference, once for run -// vm.expectCall(token, abi.encodeWithSelector(IERC20.balanceOf.selector, account), 2); +// // vm.mockCall(token, abi.encodeWithSelector(IERC20.balanceOf.selector, account), abi.encode(balance)); +// // // called once for reference, once for run +// // vm.expectCall(token, abi.encodeWithSelector(IERC20.balanceOf.selector, account), 2); -// opReferenceCheck( -// opTestDefaultInterpreterState(), -// operand, -// LibOpUint256ERC20BalanceOf.referenceFn, -// LibOpUint256ERC20BalanceOf.integrity, -// LibOpUint256ERC20BalanceOf.run, -// inputs -// ); -// } +// // opReferenceCheck( +// // opTestDefaultInterpreterState(), +// // operand, +// // LibOpUint256ERC20BalanceOf.referenceFn, +// // LibOpUint256ERC20BalanceOf.integrity, +// // LibOpUint256ERC20BalanceOf.run, +// // inputs +// // ); +// // } -// /// Test the eval of balanceOf parsed from a string. -// function testOpERC20BalanceOfNPEvalHappy(uint256 balance) external { -// vm.mockCall( -// address(0xdeadbeef), -// abi.encodeWithSelector(IERC20.balanceOf.selector, address(0xdeadc0de)), -// abi.encode(balance) -// ); -// checkHappy("_: uint256-erc20-balance-of(0xdeadbeef 0xdeadc0de);", balance, "0xdeadbeef 0xdeadc0de"); -// } +// // /// Test the eval of balanceOf parsed from a string. +// // function testOpERC20BalanceOfNPEvalHappy(uint256 balance) external { +// // vm.mockCall( +// // address(0xdeadbeef), +// // abi.encodeWithSelector(IERC20.balanceOf.selector, address(0xdeadc0de)), +// // abi.encode(balance) +// // ); +// // checkHappy("_: uint256-erc20-balance-of(0xdeadbeef 0xdeadc0de);", balance, "0xdeadbeef 0xdeadc0de"); +// // } -// /// Test that a balanceOf with bad inputs fails integrity. -// function testOpERC20BalanceOfNPEvalZeroInputs() external { -// checkBadInputs("_: uint256-erc20-balance-of();", 0, 2, 0); -// } +// // /// Test that a balanceOf with bad inputs fails integrity. +// // function testOpERC20BalanceOfNPEvalZeroInputs() external { +// // checkBadInputs("_: uint256-erc20-balance-of();", 0, 2, 0); +// // } -// function testOpERC20BalanceOfNPEvalOneInput() external { -// checkBadInputs("_: uint256-erc20-balance-of(0xdeadbeef);", 1, 2, 1); -// } +// // function testOpERC20BalanceOfNPEvalOneInput() external { +// // checkBadInputs("_: uint256-erc20-balance-of(0xdeadbeef);", 1, 2, 1); +// // } -// function testOpERC20BalanceOfNPEvalThreeInputs() external { -// checkBadInputs("_: uint256-erc20-balance-of(0xdeadbeef 0xdeadc0de 0xdeadc0de);", 3, 2, 3); -// } +// // function testOpERC20BalanceOfNPEvalThreeInputs() external { +// // checkBadInputs("_: uint256-erc20-balance-of(0xdeadbeef 0xdeadc0de 0xdeadc0de);", 3, 2, 3); +// // } -// function testOpERC20BalanceOfNPEvalZeroOutputs() external { -// checkBadOutputs(": uint256-erc20-balance-of(0xdeadbeef 0xdeadc0de);", 2, 1, 0); -// } +// // function testOpERC20BalanceOfNPEvalZeroOutputs() external { +// // checkBadOutputs(": uint256-erc20-balance-of(0xdeadbeef 0xdeadc0de);", 2, 1, 0); +// // } -// function testOpERC20BalanceOfNPEvalTwoOutputs() external { -// checkBadOutputs("_ _: uint256-erc20-balance-of(0xdeadbeef 0xdeadc0de);", 2, 1, 2); -// } +// // function testOpERC20BalanceOfNPEvalTwoOutputs() external { +// // checkBadOutputs("_ _: uint256-erc20-balance-of(0xdeadbeef 0xdeadc0de);", 2, 1, 2); +// // } -// /// Test that operand is disallowed. -// function testOpERC20BalanceOfNPEvalOperandDisallowed() external { -// checkUnhappyParse( -// "_: uint256-erc20-balance-of<0>(0xdeadbeef 0xdeadc0de);", abi.encodeWithSelector(UnexpectedOperand.selector) -// ); -// } -// } +// // /// Test that operand is disallowed. +// // function testOpERC20BalanceOfNPEvalOperandDisallowed() external { +// // checkUnhappyParse( +// // "_: uint256-erc20-balance-of<0>(0xdeadbeef 0xdeadc0de);", abi.encodeWithSelector(UnexpectedOperand.selector) +// // ); +// // } +// // } diff --git a/test/src/lib/op/erc20/uint256/LibOpUint256ERC20TotalSupply.t.sol b/test/src/lib/op/erc20/uint256/LibOpUint256ERC20TotalSupply.t.sol index aa2d8a0f2..222028f8e 100644 --- a/test/src/lib/op/erc20/uint256/LibOpUint256ERC20TotalSupply.t.sol +++ b/test/src/lib/op/erc20/uint256/LibOpUint256ERC20TotalSupply.t.sol @@ -1,73 +1,73 @@ -// // SPDX-License-Identifier: CAL -// pragma solidity =0.8.25; +// // // SPDX-License-Identifier: CAL +// // pragma solidity =0.8.25; -// import {OpTest} from "test/abstract/OpTest.sol"; -// import {IntegrityCheckStateNP} from "src/lib/integrity/LibIntegrityCheckNP.sol"; -// import {Operand} from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; -// import {LibOpUint256ERC20TotalSupply} from "src/lib/op/erc20/uint256/LibOpUint256ERC20TotalSupply.sol"; -// import {IERC20} from "openzeppelin-contracts/contracts/interfaces/IERC20.sol"; -// import {UnexpectedOperand} from "src/error/ErrParse.sol"; -// import {LibOperand} from "test/lib/operand/LibOperand.sol"; +// // import {OpTest} from "test/abstract/OpTest.sol"; +// // import {IntegrityCheckStateNP} from "src/lib/integrity/LibIntegrityCheckNP.sol"; +// // import {Operand} from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; +// // import {LibOpUint256ERC20TotalSupply} from "src/lib/op/erc20/uint256/LibOpUint256ERC20TotalSupply.sol"; +// // import {IERC20} from "openzeppelin-contracts/contracts/interfaces/IERC20.sol"; +// // import {UnexpectedOperand} from "src/error/ErrParse.sol"; +// // import {LibOperand} from "test/lib/operand/LibOperand.sol"; // /// @title LibOpUint256ERC20TotalSupplyTest // /// @notice Test the opcode for getting the total supply of an erc20 contract. // contract LibOpUint256ERC20TotalSupplyTest is OpTest { -// function testOpERC20TotalSupplyNPIntegrity(IntegrityCheckStateNP memory state, Operand operand) external { +// function testOpERC20TotalSupplyNPIntegrity(IntegrityCheckStateNP memory state, Operand operand) external pure { // (uint256 calcInputs, uint256 calcOutputs) = LibOpUint256ERC20TotalSupply.integrity(state, operand); -// assertEq(calcInputs, 1); -// assertEq(calcOutputs, 1); -// } +// // assertEq(calcInputs, 1); +// // assertEq(calcOutputs, 1); +// // } -// function testOpERC20TotalSupplyNPRun(address account, uint256 totalSupply, uint16 operandData) external { -// assumeEtchable(account); -// vm.etch(account, hex"fe"); +// // function testOpERC20TotalSupplyNPRun(address account, uint256 totalSupply, uint16 operandData) external { +// // assumeEtchable(account); +// // vm.etch(account, hex"fe"); -// uint256[] memory inputs = new uint256[](1); -// inputs[0] = uint256(uint160(account)); -// Operand operand = LibOperand.build(1, 1, operandData); +// // uint256[] memory inputs = new uint256[](1); +// // inputs[0] = uint256(uint160(account)); +// // Operand operand = LibOperand.build(1, 1, operandData); -// vm.mockCall(account, abi.encodeWithSelector(IERC20.totalSupply.selector), abi.encode(totalSupply)); -// // called once for reference, once for run -// vm.expectCall(account, abi.encodeWithSelector(IERC20.totalSupply.selector), 2); +// // vm.mockCall(account, abi.encodeWithSelector(IERC20.totalSupply.selector), abi.encode(totalSupply)); +// // // called once for reference, once for run +// // vm.expectCall(account, abi.encodeWithSelector(IERC20.totalSupply.selector), 2); -// opReferenceCheck( -// opTestDefaultInterpreterState(), -// operand, -// LibOpUint256ERC20TotalSupply.referenceFn, -// LibOpUint256ERC20TotalSupply.integrity, -// LibOpUint256ERC20TotalSupply.run, -// inputs -// ); -// } +// // opReferenceCheck( +// // opTestDefaultInterpreterState(), +// // operand, +// // LibOpUint256ERC20TotalSupply.referenceFn, +// // LibOpUint256ERC20TotalSupply.integrity, +// // LibOpUint256ERC20TotalSupply.run, +// // inputs +// // ); +// // } -// /// Test the eval of totalSupply parsed from a string. -// function testOpERC20TotalSupplyNPEvalHappy(uint256 totalSupply) external { -// vm.mockCall(address(0xdeadbeef), abi.encodeWithSelector(IERC20.totalSupply.selector), abi.encode(totalSupply)); -// checkHappy("_: uint256-erc20-total-supply(0xdeadbeef);", totalSupply, "0xdeadbeef 0xdeadc0de"); -// } +// // /// Test the eval of totalSupply parsed from a string. +// // function testOpERC20TotalSupplyNPEvalHappy(uint256 totalSupply) external { +// // vm.mockCall(address(0xdeadbeef), abi.encodeWithSelector(IERC20.totalSupply.selector), abi.encode(totalSupply)); +// // checkHappy("_: uint256-erc20-total-supply(0xdeadbeef);", totalSupply, "0xdeadbeef 0xdeadc0de"); +// // } -// /// Test that a totalSupply with bad inputs fails integrity. -// function testOpERC20TotalSupplyNPEvalZeroInputs() external { -// checkBadInputs("_: uint256-erc20-total-supply();", 0, 1, 0); -// } +// // /// Test that a totalSupply with bad inputs fails integrity. +// // function testOpERC20TotalSupplyNPEvalZeroInputs() external { +// // checkBadInputs("_: uint256-erc20-total-supply();", 0, 1, 0); +// // } -// function testOpERC20TotalSupplyNPEvalTwoInputs() external { -// checkBadInputs("_: uint256-erc20-total-supply(0xdeadbeef 0xdeadc0de);", 2, 1, 2); -// } +// // function testOpERC20TotalSupplyNPEvalTwoInputs() external { +// // checkBadInputs("_: uint256-erc20-total-supply(0xdeadbeef 0xdeadc0de);", 2, 1, 2); +// // } -// function testOpERC20TotalSupplyNPEvalZeroOutputs() external { -// checkBadOutputs(": uint256-erc20-total-supply(0xdeadbeef);", 1, 1, 0); -// } +// // function testOpERC20TotalSupplyNPEvalZeroOutputs() external { +// // checkBadOutputs(": uint256-erc20-total-supply(0xdeadbeef);", 1, 1, 0); +// // } -// function testOpERC20TotalSupplyNPEvalTwoOutputs() external { -// checkBadOutputs("_ _: uint256-erc20-total-supply(0xdeadbeef);", 1, 1, 2); -// } +// // function testOpERC20TotalSupplyNPEvalTwoOutputs() external { +// // checkBadOutputs("_ _: uint256-erc20-total-supply(0xdeadbeef);", 1, 1, 2); +// // } -// /// Test that operand is disallowed. -// function testOpERC20TotalSupplyNPEvalOperandDisallowed() external { -// checkUnhappyParse( -// "_: uint256-erc20-total-supply<0>(0xdeadbeef);", abi.encodeWithSelector(UnexpectedOperand.selector) -// ); -// } -// } +// // /// Test that operand is disallowed. +// // function testOpERC20TotalSupplyNPEvalOperandDisallowed() external { +// // checkUnhappyParse( +// // "_: uint256-erc20-total-supply<0>(0xdeadbeef);", abi.encodeWithSelector(UnexpectedOperand.selector) +// // ); +// // } +// // } diff --git a/test/src/lib/op/erc5313/LibOpERC5313OwnerNP.t.sol b/test/src/lib/op/erc5313/LibOpERC5313OwnerNP.t.sol index e18bdaa5f..05974b4d8 100644 --- a/test/src/lib/op/erc5313/LibOpERC5313OwnerNP.t.sol +++ b/test/src/lib/op/erc5313/LibOpERC5313OwnerNP.t.sol @@ -12,7 +12,7 @@ import {LibOperand} from "test/lib/operand/LibOperand.sol"; /// @title LibOpERC5313OwnerNPTest /// @notice Test the opcode for getting the owner of an erc5313 contract. contract LibOpERC5313OwnerNPTest is OpTest { - function testOpERC5313OwnerOfNPIntegrity(IntegrityCheckStateNP memory state, Operand operand) external { + function testOpERC5313OwnerOfNPIntegrity(IntegrityCheckStateNP memory state, Operand operand) external pure { (uint256 calcInputs, uint256 calcOutputs) = LibOpERC5313OwnerNP.integrity(state, operand); assertEq(calcInputs, 1); diff --git a/test/src/lib/op/erc721/LibOpERC721OwnerOf.t.sol b/test/src/lib/op/erc721/LibOpERC721OwnerOf.t.sol index ee6bf5c6b..bd04dbb58 100644 --- a/test/src/lib/op/erc721/LibOpERC721OwnerOf.t.sol +++ b/test/src/lib/op/erc721/LibOpERC721OwnerOf.t.sol @@ -23,7 +23,7 @@ import {Strings} from "openzeppelin-contracts/contracts/utils/Strings.sol"; /// @title LibOpERC721OwnerOfTest /// @notice Test the opcode for getting the owner of an erc721 token. contract LibOpERC721OwnerOfTest is OpTest { - function testOpERC721OwnerOfNPIntegrity(IntegrityCheckStateNP memory state, uint8 inputs) external { + function testOpERC721OwnerOfNPIntegrity(IntegrityCheckStateNP memory state, uint8 inputs) external pure { (uint256 calcInputs, uint256 calcOutputs) = LibOpERC721OwnerOf.integrity(state, Operand.wrap(uint256(inputs) << 0x10)); diff --git a/test/src/lib/op/erc721/uint256/LibOpUint256ERC721BalanceOf.t.sol b/test/src/lib/op/erc721/uint256/LibOpUint256ERC721BalanceOf.t.sol index fabd07263..d52f7d226 100644 --- a/test/src/lib/op/erc721/uint256/LibOpUint256ERC721BalanceOf.t.sol +++ b/test/src/lib/op/erc721/uint256/LibOpUint256ERC721BalanceOf.t.sol @@ -1,24 +1,24 @@ -// // SPDX-License-Identifier: CAL -// pragma solidity =0.8.25; - -// import {OpTest} from "test/abstract/OpTest.sol"; -// import {IntegrityCheckStateNP, BadOpInputsLength} from "src/lib/integrity/LibIntegrityCheckNP.sol"; -// import {LibOpUint256ERC721BalanceOf} from "src/lib/op/erc721/uint256/LibOpUint256ERC721BalanceOf.sol"; -// import {IERC721} from "openzeppelin-contracts/contracts/token/ERC721/IERC721.sol"; -// import { -// IInterpreterV4, -// FullyQualifiedNamespace, -// Operand, -// SourceIndexV2, -// EvalV4 -// } from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; -// import {IInterpreterStoreV2} from "rain.interpreter.interface/interface/IInterpreterStoreV2.sol"; -// import {LibContext} from "rain.interpreter.interface/lib/caller/LibContext.sol"; -// import {SignedContextV1} from "rain.interpreter.interface/interface/IInterpreterCallerV3.sol"; -// import {UnexpectedOperand} from "src/error/ErrParse.sol"; -// import {LibOperand} from "test/lib/operand/LibOperand.sol"; - -// import {Strings} from "openzeppelin-contracts/contracts/utils/Strings.sol"; +// // // SPDX-License-Identifier: CAL +// // pragma solidity =0.8.25; + +// // import {OpTest} from "test/abstract/OpTest.sol"; +// // import {IntegrityCheckStateNP, BadOpInputsLength} from "src/lib/integrity/LibIntegrityCheckNP.sol"; +// // import {LibOpUint256ERC721BalanceOf} from "src/lib/op/erc721/uint256/LibOpUint256ERC721BalanceOf.sol"; +// // import {IERC721} from "openzeppelin-contracts/contracts/token/ERC721/IERC721.sol"; +// // import { +// // IInterpreterV4, +// // FullyQualifiedNamespace, +// // Operand, +// // SourceIndexV2, +// // EvalV4 +// // } from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; +// // import {IInterpreterStoreV2} from "rain.interpreter.interface/interface/IInterpreterStoreV2.sol"; +// // import {LibContext} from "rain.interpreter.interface/lib/caller/LibContext.sol"; +// // import {SignedContextV1} from "rain.interpreter.interface/interface/IInterpreterCallerV3.sol"; +// // import {UnexpectedOperand} from "src/error/ErrParse.sol"; +// // import {LibOperand} from "test/lib/operand/LibOperand.sol"; + +// // import {Strings} from "openzeppelin-contracts/contracts/utils/Strings.sol"; // /// @title LibOpUint256ERC721BalanceOfTest // /// @notice Test the opcode for getting the balance of an erc721 token. @@ -28,115 +28,115 @@ // uint8 inputs, // uint8 outputs, // uint16 operandData -// ) external { +// ) external pure { // inputs = uint8(bound(inputs, 0, 0x0F)); // outputs = uint8(bound(outputs, 0, 0x0F)); // (uint256 calcInputs, uint256 calcOutputs) = // LibOpUint256ERC721BalanceOf.integrity(state, LibOperand.build(inputs, outputs, operandData)); -// assertEq(calcInputs, 2); -// assertEq(calcOutputs, 1); -// } - -// function testOpERC721BalanceOfRun(address token, address account, uint256 balance, uint16 operandData) external { -// assumeEtchable(token); -// vm.etch(token, hex"fe"); - -// uint256[] memory inputs = new uint256[](2); -// inputs[0] = uint256(uint160(token)); -// inputs[1] = uint256(uint160(account)); -// Operand operand = LibOperand.build(2, 1, operandData); - -// // invalid token -// vm.mockCall(token, abi.encodeWithSelector(IERC721.balanceOf.selector, account), abi.encode(balance)); -// // called once for reference, once for run -// vm.expectCall(token, abi.encodeWithSelector(IERC721.balanceOf.selector, account), 2); - -// opReferenceCheck( -// opTestDefaultInterpreterState(), -// operand, -// LibOpUint256ERC721BalanceOf.referenceFn, -// LibOpUint256ERC721BalanceOf.integrity, -// LibOpUint256ERC721BalanceOf.run, -// inputs -// ); -// } - -// function testOpERC721BalanceOfEvalHappy(address token, address account, uint256 balance) public { -// bytes memory bytecode = iDeployer.parse2( -// bytes( -// string.concat( -// "_: uint256-erc721-balance-of(", Strings.toHexString(token), " ", Strings.toHexString(account), ");" -// ) -// ) -// ); - -// assumeEtchable(token); -// vm.etch(token, hex"fe"); -// vm.mockCall(token, abi.encodeWithSelector(IERC721.balanceOf.selector, account), abi.encode(balance)); -// vm.expectCall(token, abi.encodeWithSelector(IERC721.balanceOf.selector, account), 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], balance); -// assertEq(kvs.length, 0); -// } - -// /// Test that balance of without inputs fails integrity check. -// function testOpERC721BalanceOfIntegrityFail0() external { -// vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 0, 2, 0)); -// bytes memory bytecode = iDeployer.parse2("_: uint256-erc721-balance-of();"); -// (bytecode); -// } - -// /// Test that balance of with one input fails integrity check. -// function testOpERC721BalanceOfIntegrityFail1() external { -// vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 1, 2, 1)); -// bytes memory bytecode = iDeployer.parse2("_: uint256-erc721-balance-of(0x00);"); -// (bytecode); -// } - -// /// Test that balance of with three inputs fails integrity check. -// function testOpERC721BalanceOfIntegrityFail3() external { -// vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 3, 2, 3)); -// bytes memory bytecode = iDeployer.parse2("_: uint256-erc721-balance-of(0x00 0x01 0x02);"); -// (bytecode); -// } - -// /// Test that operand fails integrity check. -// function testOpERC721BalanceOfIntegrityFailOperand() external { -// vm.expectRevert(abi.encodeWithSelector(UnexpectedOperand.selector)); -// bytes memory bytecode = iDeployer.parse2("_: uint256-erc721-balance-of<0>(0x00 0x01);"); -// (bytecode); -// } - -// function testOpERC721BalanceOfZeroInputs() external { -// checkBadInputs("_: uint256-erc721-balance-of();", 0, 2, 0); -// } - -// function testOpERC721BalanceOfOneInput() external { -// checkBadInputs("_: uint256-erc721-balance-of(0x00);", 1, 2, 1); -// } - -// function testOpERC721BalanceOfThreeInputs() external { -// checkBadInputs("_: uint256-erc721-balance-of(0x00 0x01 0x02);", 3, 2, 3); -// } - -// function testOpERC721BalanceOfZeroOutputs() external { -// checkBadOutputs(": uint256-erc721-balance-of(0x00 0x01);", 2, 1, 0); -// } - -// function testOpERC721BalanceOfTwoOutputs() external { -// checkBadOutputs("_ _: uint256-erc721-balance-of(0x00 0x01);", 2, 1, 2); -// } -// } +// // assertEq(calcInputs, 2); +// // assertEq(calcOutputs, 1); +// // } + +// // function testOpERC721BalanceOfRun(address token, address account, uint256 balance, uint16 operandData) external { +// // assumeEtchable(token); +// // vm.etch(token, hex"fe"); + +// // uint256[] memory inputs = new uint256[](2); +// // inputs[0] = uint256(uint160(token)); +// // inputs[1] = uint256(uint160(account)); +// // Operand operand = LibOperand.build(2, 1, operandData); + +// // // invalid token +// // vm.mockCall(token, abi.encodeWithSelector(IERC721.balanceOf.selector, account), abi.encode(balance)); +// // // called once for reference, once for run +// // vm.expectCall(token, abi.encodeWithSelector(IERC721.balanceOf.selector, account), 2); + +// // opReferenceCheck( +// // opTestDefaultInterpreterState(), +// // operand, +// // LibOpUint256ERC721BalanceOf.referenceFn, +// // LibOpUint256ERC721BalanceOf.integrity, +// // LibOpUint256ERC721BalanceOf.run, +// // inputs +// // ); +// // } + +// // function testOpERC721BalanceOfEvalHappy(address token, address account, uint256 balance) public { +// // bytes memory bytecode = iDeployer.parse2( +// // bytes( +// // string.concat( +// // "_: uint256-erc721-balance-of(", Strings.toHexString(token), " ", Strings.toHexString(account), ");" +// // ) +// // ) +// // ); + +// // assumeEtchable(token); +// // vm.etch(token, hex"fe"); +// // vm.mockCall(token, abi.encodeWithSelector(IERC721.balanceOf.selector, account), abi.encode(balance)); +// // vm.expectCall(token, abi.encodeWithSelector(IERC721.balanceOf.selector, account), 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], balance); +// // assertEq(kvs.length, 0); +// // } + +// // /// Test that balance of without inputs fails integrity check. +// // function testOpERC721BalanceOfIntegrityFail0() external { +// // vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 0, 2, 0)); +// // bytes memory bytecode = iDeployer.parse2("_: uint256-erc721-balance-of();"); +// // (bytecode); +// // } + +// // /// Test that balance of with one input fails integrity check. +// // function testOpERC721BalanceOfIntegrityFail1() external { +// // vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 1, 2, 1)); +// // bytes memory bytecode = iDeployer.parse2("_: uint256-erc721-balance-of(0x00);"); +// // (bytecode); +// // } + +// // /// Test that balance of with three inputs fails integrity check. +// // function testOpERC721BalanceOfIntegrityFail3() external { +// // vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 3, 2, 3)); +// // bytes memory bytecode = iDeployer.parse2("_: uint256-erc721-balance-of(0x00 0x01 0x02);"); +// // (bytecode); +// // } + +// // /// Test that operand fails integrity check. +// // function testOpERC721BalanceOfIntegrityFailOperand() external { +// // vm.expectRevert(abi.encodeWithSelector(UnexpectedOperand.selector)); +// // bytes memory bytecode = iDeployer.parse2("_: uint256-erc721-balance-of<0>(0x00 0x01);"); +// // (bytecode); +// // } + +// // function testOpERC721BalanceOfZeroInputs() external { +// // checkBadInputs("_: uint256-erc721-balance-of();", 0, 2, 0); +// // } + +// // function testOpERC721BalanceOfOneInput() external { +// // checkBadInputs("_: uint256-erc721-balance-of(0x00);", 1, 2, 1); +// // } + +// // function testOpERC721BalanceOfThreeInputs() external { +// // checkBadInputs("_: uint256-erc721-balance-of(0x00 0x01 0x02);", 3, 2, 3); +// // } + +// // function testOpERC721BalanceOfZeroOutputs() external { +// // checkBadOutputs(": uint256-erc721-balance-of(0x00 0x01);", 2, 1, 0); +// // } + +// // function testOpERC721BalanceOfTwoOutputs() external { +// // checkBadOutputs("_ _: uint256-erc721-balance-of(0x00 0x01);", 2, 1, 2); +// // } +// // } diff --git a/test/src/lib/op/evm/LibOpBlockNumberNP.t.sol b/test/src/lib/op/evm/LibOpBlockNumberNP.t.sol index 8dde1dd3d..a73de3feb 100644 --- a/test/src/lib/op/evm/LibOpBlockNumberNP.t.sol +++ b/test/src/lib/op/evm/LibOpBlockNumberNP.t.sol @@ -1,7 +1,7 @@ -// // SPDX-License-Identifier: CAL -// pragma solidity =0.8.25; +// // // SPDX-License-Identifier: CAL +// // pragma solidity =0.8.25; -// import {OpTest} from "test/abstract/OpTest.sol"; +// // import {OpTest} from "test/abstract/OpTest.sol"; // import {LibPointer, Pointer} from "rain.solmem/lib/LibPointer.sol"; // import { @@ -11,7 +11,7 @@ // FullyQualifiedNamespace // } from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; // import {LibStackPointer} from "rain.solmem/lib/LibStackPointer.sol"; -// import {IMetaV1} from "rain.metadata/interface/IMetaV1.sol"; +// import {IMetaV1} from "rain.metadata/interface/deprecated/IMetaV1.sol"; // import {IInterpreterStoreV2} from "rain.interpreter.interface/interface/IInterpreterStoreV2.sol"; // import {LibInterpreterStateNP, InterpreterStateNP} from "src/lib/state/LibInterpreterStateNP.sol"; // import {IntegrityCheckStateNP, BadOpInputsLength} from "src/lib/integrity/LibIntegrityCheckNP.sol"; @@ -20,12 +20,12 @@ // import {LibOpBlockNumberNP} from "src/lib/op/evm/LibOpBlockNumberNP.sol"; // import {LibOperand} from "test/lib/operand/LibOperand.sol"; -// /// @title LibOpBlockNumberNPTest -// /// @notice Test the runtime and integrity time logic of LibOpBlockNumberNP. -// contract LibOpBlockNumberNPTest is OpTest { -// using LibPointer for Pointer; -// using LibStackPointer for Pointer; -// using LibInterpreterStateNP for InterpreterStateNP; +// // /// @title LibOpBlockNumberNPTest +// // /// @notice Test the runtime and integrity time logic of LibOpBlockNumberNP. +// // contract LibOpBlockNumberNPTest is OpTest { +// // using LibPointer for Pointer; +// // using LibStackPointer for Pointer; +// // using LibInterpreterStateNP for InterpreterStateNP; // /// Directly test the integrity logic of LibOpBlockNumberNP. // function testOpBlockNumberNPIntegrity( @@ -33,45 +33,45 @@ // uint8 inputs, // uint8 outputs, // uint16 operandData -// ) external { +// ) external pure { // inputs = uint8(bound(inputs, 0, 0x0F)); // outputs = uint8(bound(outputs, 0, 0x0F)); // (uint256 calcInputs, uint256 calcOutputs) = // LibOpBlockNumberNP.integrity(state, LibOperand.build(inputs, outputs, operandData)); -// assertEq(calcInputs, 0); -// assertEq(calcOutputs, 1); -// } +// // assertEq(calcInputs, 0); +// // assertEq(calcOutputs, 1); +// // } -// /// Directly test the runtime logic of LibOpBlockNumberNP. This tests that the -// /// opcode correctly pushes the block number onto the stack. -// function testOpBlockNumberNPRun(uint256 blockNumber, uint16 operandData) external { -// blockNumber = bound(blockNumber, 0, type(uint256).max / 1e18); -// InterpreterStateNP memory state = opTestDefaultInterpreterState(); -// vm.roll(blockNumber); -// uint256[] memory inputs = new uint256[](0); -// Operand operand = LibOperand.build(0, 1, operandData); -// opReferenceCheck( -// state, operand, LibOpBlockNumberNP.referenceFn, LibOpBlockNumberNP.integrity, LibOpBlockNumberNP.run, inputs -// ); -// } +// // /// Directly test the runtime logic of LibOpBlockNumberNP. This tests that the +// // /// opcode correctly pushes the block number onto the stack. +// // function testOpBlockNumberNPRun(uint256 blockNumber, uint16 operandData) external { +// // blockNumber = bound(blockNumber, 0, type(uint256).max / 1e18); +// // InterpreterStateNP memory state = opTestDefaultInterpreterState(); +// // vm.roll(blockNumber); +// // uint256[] memory inputs = new uint256[](0); +// // Operand operand = LibOperand.build(0, 1, operandData); +// // opReferenceCheck( +// // state, operand, LibOpBlockNumberNP.referenceFn, LibOpBlockNumberNP.integrity, LibOpBlockNumberNP.run, inputs +// // ); +// // } -// /// Test the eval of a block number opcode parsed from a string. -// function testOpBlockNumberNPEval(uint256 blockNumber) public { -// blockNumber = bound(blockNumber, 0, type(uint256).max / 1e18); -// vm.roll(blockNumber); -// checkHappy("_: block-number();", blockNumber * 1e18, ""); -// } +// // /// Test the eval of a block number opcode parsed from a string. +// // function testOpBlockNumberNPEval(uint256 blockNumber) public { +// // blockNumber = bound(blockNumber, 0, type(uint256).max / 1e18); +// // vm.roll(blockNumber); +// // checkHappy("_: block-number();", blockNumber * 1e18, ""); +// // } -// function testOpBlockNumberNPEvalOneInput() external { -// checkBadInputs("_: block-number(0x00);", 1, 0, 1); -// } +// // function testOpBlockNumberNPEvalOneInput() external { +// // checkBadInputs("_: block-number(0x00);", 1, 0, 1); +// // } -// function testOpBlockNumberNPEvalZeroOutputs() external { -// checkBadOutputs(": block-number();", 0, 1, 0); -// } +// // function testOpBlockNumberNPEvalZeroOutputs() external { +// // checkBadOutputs(": block-number();", 0, 1, 0); +// // } -// function testOpBlockNumberNPEvalTwoOutputs() external { -// checkBadOutputs("_ _: block-number();", 0, 1, 2); -// } -// } +// // function testOpBlockNumberNPEvalTwoOutputs() external { +// // checkBadOutputs("_ _: block-number();", 0, 1, 2); +// // } +// // } diff --git a/test/src/lib/op/evm/LibOpChainIdNP.t.sol b/test/src/lib/op/evm/LibOpChainIdNP.t.sol index b68eb3af3..865fd93be 100644 --- a/test/src/lib/op/evm/LibOpChainIdNP.t.sol +++ b/test/src/lib/op/evm/LibOpChainIdNP.t.sol @@ -1,32 +1,32 @@ -// // SPDX-License-Identifier: CAL -// pragma solidity =0.8.25; +// // // SPDX-License-Identifier: CAL +// // pragma solidity =0.8.25; // import {Pointer} from "rain.solmem/lib/LibPointer.sol"; // import {LibStackPointer} from "rain.solmem/lib/LibStackPointer.sol"; -// import {IMetaV1} from "rain.metadata/interface/IMetaV1.sol"; +// import {IMetaV1} from "rain.metadata/interface/deprecated/IMetaV1.sol"; -// import {OpTest} from "test/abstract/OpTest.sol"; -// import {INVALID_BYTECODE} from "test/lib/etch/LibEtch.sol"; +// // import {OpTest} from "test/abstract/OpTest.sol"; +// // import {INVALID_BYTECODE} from "test/lib/etch/LibEtch.sol"; -// import {LibInterpreterStateNP, InterpreterStateNP} from "src/lib/state/LibInterpreterStateNP.sol"; -// import {IntegrityCheckStateNP, BadOpInputsLength} from "src/lib/integrity/LibIntegrityCheckNP.sol"; -// import {LibOpChainIdNP} from "src/lib/op/evm/LibOpChainIdNP.sol"; +// // import {LibInterpreterStateNP, InterpreterStateNP} from "src/lib/state/LibInterpreterStateNP.sol"; +// // import {IntegrityCheckStateNP, BadOpInputsLength} from "src/lib/integrity/LibIntegrityCheckNP.sol"; +// // import {LibOpChainIdNP} from "src/lib/op/evm/LibOpChainIdNP.sol"; -// import {RainterpreterNPE2} from "src/concrete/RainterpreterNPE2.sol"; -// import {RainterpreterStoreNPE2, FullyQualifiedNamespace} from "src/concrete/RainterpreterStoreNPE2.sol"; -// import {RainterpreterExpressionDeployerNPE2} from "src/concrete/RainterpreterExpressionDeployerNPE2.sol"; -// import { -// Operand, IInterpreterV4, SourceIndexV2 -// } from "rain.interpreter.interface/interface/unstable/IInterpreterV4.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"; +// // import {RainterpreterNPE2} from "src/concrete/RainterpreterNPE2.sol"; +// // import {RainterpreterStoreNPE2, FullyQualifiedNamespace} from "src/concrete/RainterpreterStoreNPE2.sol"; +// // import {RainterpreterExpressionDeployerNPE2} from "src/concrete/RainterpreterExpressionDeployerNPE2.sol"; +// // import { +// // Operand, IInterpreterV4, SourceIndexV2 +// // } from "rain.interpreter.interface/interface/unstable/IInterpreterV4.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"; -// /// @title LibOpChainIdNPTest -// /// @notice Test the runtime and integrity time logic of LibOpChainIdNP. -// contract LibOpChainIdNPTest is OpTest { -// using LibInterpreterStateNP for InterpreterStateNP; +// // /// @title LibOpChainIdNPTest +// // /// @notice Test the runtime and integrity time logic of LibOpChainIdNP. +// // contract LibOpChainIdNPTest is OpTest { +// // using LibInterpreterStateNP for InterpreterStateNP; // /// Directly test the integrity logic of LibOpChainIdNP. // function testOpChainIDNPIntegrity( @@ -34,46 +34,46 @@ // uint8 inputs, // uint8 outputs, // uint16 operandData -// ) external { +// ) external pure { // inputs = uint8(bound(inputs, 0, 0x0F)); // outputs = uint8(bound(outputs, 0, 0x0F)); // (uint256 calcInputs, uint256 calcOutputs) = // LibOpChainIdNP.integrity(state, LibOperand.build(inputs, outputs, operandData)); -// assertEq(calcInputs, 0); -// assertEq(calcOutputs, 1); -// } +// // assertEq(calcInputs, 0); +// // assertEq(calcOutputs, 1); +// // } -// /// Directly test the runtime logic of LibOpChainId. This tests that the -// /// opcode correctly pushes the chain ID onto the stack. -// function testOpChainIdNPRun(uint64 chainId, uint16 operandData) external { -// InterpreterStateNP memory state = opTestDefaultInterpreterState(); -// vm.chainId(chainId); -// uint256[] memory inputs = new uint256[](0); -// Operand operand = LibOperand.build(0, 1, operandData); -// opReferenceCheck( -// state, operand, LibOpChainIdNP.referenceFn, LibOpChainIdNP.integrity, LibOpChainIdNP.run, inputs -// ); -// } +// // /// Directly test the runtime logic of LibOpChainId. This tests that the +// // /// opcode correctly pushes the chain ID onto the stack. +// // function testOpChainIdNPRun(uint64 chainId, uint16 operandData) external { +// // InterpreterStateNP memory state = opTestDefaultInterpreterState(); +// // vm.chainId(chainId); +// // uint256[] memory inputs = new uint256[](0); +// // Operand operand = LibOperand.build(0, 1, operandData); +// // opReferenceCheck( +// // state, operand, LibOpChainIdNP.referenceFn, LibOpChainIdNP.integrity, LibOpChainIdNP.run, inputs +// // ); +// // } -// /// Test the eval of a chain ID opcode parsed from a string. -// function testOpChainIDNPEval(uint64 chainId) public { -// vm.chainId(chainId); -// checkHappy("_: chain-id();", uint256(chainId) * 1e18, ""); -// } +// // /// Test the eval of a chain ID opcode parsed from a string. +// // function testOpChainIDNPEval(uint64 chainId) public { +// // vm.chainId(chainId); +// // checkHappy("_: chain-id();", uint256(chainId) * 1e18, ""); +// // } -// /// Test that a chain ID with inputs fails integrity check. -// function testOpChainIdNPEvalFail() public { -// vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 1, 0, 1)); -// bytes memory bytecode = iDeployer.parse2("_: chain-id(0x00);"); -// (bytecode); -// } +// // /// Test that a chain ID with inputs fails integrity check. +// // function testOpChainIdNPEvalFail() public { +// // vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 1, 0, 1)); +// // bytes memory bytecode = iDeployer.parse2("_: chain-id(0x00);"); +// // (bytecode); +// // } -// function testOpChainIdNPZeroOutputs() external { -// checkBadOutputs(": chain-id();", 0, 1, 0); -// } +// // function testOpChainIdNPZeroOutputs() external { +// // checkBadOutputs(": chain-id();", 0, 1, 0); +// // } -// function testOpChainIdNPTwoOutputs() external { -// checkBadOutputs("_ _: chain-id();", 0, 1, 2); -// } -// } +// // function testOpChainIdNPTwoOutputs() external { +// // checkBadOutputs("_ _: chain-id();", 0, 1, 2); +// // } +// // } diff --git a/test/src/lib/op/evm/LibOpMaxUint256NP.t.sol b/test/src/lib/op/evm/LibOpMaxUint256NP.t.sol index 778cbaef7..c9a09dc9b 100644 --- a/test/src/lib/op/evm/LibOpMaxUint256NP.t.sol +++ b/test/src/lib/op/evm/LibOpMaxUint256NP.t.sol @@ -1,70 +1,70 @@ -// // SPDX-License-Identifier: CAL -// pragma solidity =0.8.25; +// SPDX-License-Identifier: CAL +pragma solidity =0.8.25; -// import {OpTest} from "test/abstract/OpTest.sol"; -// import {LibOpMaxUint256NP} from "src/lib/op/evm/LibOpMaxUint256NP.sol"; -// import {IntegrityCheckStateNP, BadOpInputsLength} from "src/lib/integrity/LibIntegrityCheckNP.sol"; -// import { -// IInterpreterV4, -// Operand, -// SourceIndexV2, -// FullyQualifiedNamespace -// } from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; -// import {InterpreterStateNP, LibInterpreterStateNP} from "src/lib/state/LibInterpreterStateNP.sol"; -// import {LibContext} from "rain.interpreter.interface/lib/caller/LibContext.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 {OpTest} from "test/abstract/OpTest.sol"; +import {LibOpMaxUint256NP} from "src/lib/op/evm/LibOpMaxUint256NP.sol"; +import {IntegrityCheckStateNP, BadOpInputsLength} from "src/lib/integrity/LibIntegrityCheckNP.sol"; +import { + IInterpreterV4, + Operand, + SourceIndexV2, + FullyQualifiedNamespace +} from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; +import {InterpreterStateNP, LibInterpreterStateNP} from "src/lib/state/LibInterpreterStateNP.sol"; +import {LibContext} from "rain.interpreter.interface/lib/caller/LibContext.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"; -// /// @title LibOpMaxUint256NPTest -// /// @notice Test the runtime and integrity time logic of LibOpMaxUint256NP. -// contract LibOpMaxUint256NPTest is OpTest { -// using LibInterpreterStateNP for InterpreterStateNP; +/// @title LibOpMaxUint256NPTest +/// @notice Test the runtime and integrity time logic of LibOpMaxUint256NP. +contract LibOpMaxUint256NPTest is OpTest { + using LibInterpreterStateNP for InterpreterStateNP; -// /// Directly test the integrity logic of LibOpMaxUint256NP. -// function testOpMaxUint256NPIntegrity( -// IntegrityCheckStateNP memory state, -// uint8 inputs, -// uint8 outputs, -// uint16 operandData -// ) external { -// inputs = uint8(bound(inputs, 0, 0x0F)); -// outputs = uint8(bound(outputs, 0, 0x0F)); -// (uint256 calcInputs, uint256 calcOutputs) = -// LibOpMaxUint256NP.integrity(state, LibOperand.build(inputs, outputs, operandData)); + /// Directly test the integrity logic of LibOpMaxUint256NP. + function testOpMaxUint256NPIntegrity( + IntegrityCheckStateNP 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) = + LibOpMaxUint256NP.integrity(state, LibOperand.build(inputs, outputs, operandData)); -// assertEq(calcInputs, 0); -// assertEq(calcOutputs, 1); -// } + assertEq(calcInputs, 0); + assertEq(calcOutputs, 1); + } -// /// Directly test the runtime logic of LibOpMaxUint256NP. This tests that the -// /// opcode correctly pushes the max uint256 onto the stack. -// function testOpMaxUint256NPRun() external { -// InterpreterStateNP memory state = opTestDefaultInterpreterState(); -// uint256[] memory inputs = new uint256[](0); -// Operand operand = LibOperand.build(0, 1, 0); -// opReferenceCheck( -// state, operand, LibOpMaxUint256NP.referenceFn, LibOpMaxUint256NP.integrity, LibOpMaxUint256NP.run, inputs -// ); -// } + /// Directly test the runtime logic of LibOpMaxUint256NP. This tests that the + /// opcode correctly pushes the max uint256 onto the stack. + function testOpMaxUint256NPRun() external view { + InterpreterStateNP memory state = opTestDefaultInterpreterState(); + uint256[] memory inputs = new uint256[](0); + Operand operand = LibOperand.build(0, 1, 0); + opReferenceCheck( + state, operand, LibOpMaxUint256NP.referenceFn, LibOpMaxUint256NP.integrity, LibOpMaxUint256NP.run, inputs + ); + } -// /// Test the eval of LibOpMaxUint256NP parsed from a string. -// function testOpMaxUint256NPEval() external { -// checkHappy("_: max-value();", type(uint256).max, ""); -// } + /// Test the eval of LibOpMaxUint256NP parsed from a string. + function testOpMaxUint256NPEval() external { + checkHappy("_: uint256-max-value();", type(uint256).max, ""); + } -// /// Test that a max-value with inputs fails integrity check. -// function testOpMaxUint256NPEvalFail() public { -// vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 1, 0, 1)); -// bytes memory bytecode = iDeployer.parse2("_: max-value(0x00);"); -// (bytecode); -// } + /// Test that a max-value with inputs fails integrity check. + function testOpMaxUint256NPEvalFail() public { + vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 1, 0, 1)); + bytes memory bytecode = iDeployer.parse2("_: uint256-max-value(0x00);"); + (bytecode); + } -// function testOpMaxUint256NPZeroOutputs() external { -// checkBadOutputs(": max-value();", 0, 1, 0); -// } + function testOpMaxUint256NPZeroOutputs() external { + checkBadOutputs(": uint256-max-value();", 0, 1, 0); + } -// function testOpMaxUint256NPTwoOutputs() external { -// checkBadOutputs("_ _: max-value();", 0, 1, 2); -// } -// } + function testOpMaxUint256NPTwoOutputs() external { + checkBadOutputs("_ _: uint256-max-value();", 0, 1, 2); + } +} diff --git a/test/src/lib/op/evm/LibOpTimestampNP.t.sol b/test/src/lib/op/evm/LibOpTimestampNP.t.sol index ad33c6941..14bece911 100644 --- a/test/src/lib/op/evm/LibOpTimestampNP.t.sol +++ b/test/src/lib/op/evm/LibOpTimestampNP.t.sol @@ -1,40 +1,40 @@ -// // SPDX-License-Identifier: CAL -// pragma solidity =0.8.25; +// // // SPDX-License-Identifier: CAL +// // pragma solidity =0.8.25; -// import {OpTest} from "test/abstract/OpTest.sol"; -// import {Pointer, LibPointer} from "rain.solmem/lib/LibPointer.sol"; -// import {LibStackPointer} from "rain.solmem/lib/LibStackPointer.sol"; -// import {LibInterpreterStateNP} from "src/lib/state/LibInterpreterStateNP.sol"; -// import { -// IInterpreterV4, -// Operand, -// SourceIndexV2, -// EvalV4 -// } from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; -// import {InterpreterStateNP} from "src/lib/state/LibInterpreterStateNP.sol"; -// import {IntegrityCheckStateNP, BadOpInputsLength} from "src/lib/integrity/LibIntegrityCheckNP.sol"; -// import { -// IInterpreterStoreV2, FullyQualifiedNamespace -// } 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 {OpTest} from "test/abstract/OpTest.sol"; +// // import {Pointer, LibPointer} from "rain.solmem/lib/LibPointer.sol"; +// // import {LibStackPointer} from "rain.solmem/lib/LibStackPointer.sol"; +// // import {LibInterpreterStateNP} from "src/lib/state/LibInterpreterStateNP.sol"; +// // import { +// // IInterpreterV4, +// // Operand, +// // SourceIndexV2, +// // EvalV4 +// // } from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; +// // import {InterpreterStateNP} from "src/lib/state/LibInterpreterStateNP.sol"; +// // import {IntegrityCheckStateNP, BadOpInputsLength} from "src/lib/integrity/LibIntegrityCheckNP.sol"; +// // import { +// // IInterpreterStoreV2, FullyQualifiedNamespace +// // } 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 {LibOpTimestampNP} from "src/lib/op/evm/LibOpTimestampNP.sol"; -// import {LibOperand} from "test/lib/operand/LibOperand.sol"; +// // import {LibOpTimestampNP} from "src/lib/op/evm/LibOpTimestampNP.sol"; +// // import {LibOperand} from "test/lib/operand/LibOperand.sol"; -// /// @title LibOpTimestampNPTest -// /// @notice Test the runtime and integrity time logic of LibOpTimestampNP. -// contract LibOpTimestampNPTest is OpTest { -// using LibPointer for Pointer; -// using LibStackPointer for Pointer; -// using LibInterpreterStateNP for InterpreterStateNP; +// // /// @title LibOpTimestampNPTest +// // /// @notice Test the runtime and integrity time logic of LibOpTimestampNP. +// // contract LibOpTimestampNPTest is OpTest { +// // using LibPointer for Pointer; +// // using LibStackPointer for Pointer; +// // using LibInterpreterStateNP for InterpreterStateNP; -// function timestampWords() internal pure returns (string[] memory) { -// string[] memory words = new string[](2); -// words[0] = "block-timestamp"; -// words[1] = "now"; -// return words; -// } +// // function timestampWords() internal pure returns (string[] memory) { +// // string[] memory words = new string[](2); +// // words[0] = "block-timestamp"; +// // words[1] = "now"; +// // return words; +// // } // /// Directly test the integrity logic of LibOpTimestampNP. // function testOpTimestampNPIntegrity( @@ -42,78 +42,78 @@ // uint8 inputs, // uint8 outputs, // uint16 operandData -// ) external { +// ) external pure { // inputs = uint8(bound(inputs, 0, 0x0F)); // outputs = uint8(bound(outputs, 0, 0x0F)); // (uint256 calcInputs, uint256 calcOutputs) = // LibOpTimestampNP.integrity(state, LibOperand.build(inputs, outputs, operandData)); -// assertEq(calcInputs, 0); -// assertEq(calcOutputs, 1); -// } +// // assertEq(calcInputs, 0); +// // assertEq(calcOutputs, 1); +// // } -// /// Directly test the runtime logic of LibOpTimestamp. This tests that the -// /// opcode correctly pushes the timestamp onto the stack. -// function testOpTimestampNPRun(uint256 blockTimestamp) external { -// blockTimestamp = bound(blockTimestamp, 0, type(uint256).max / 1e18); -// InterpreterStateNP memory state = opTestDefaultInterpreterState(); -// vm.warp(blockTimestamp); -// uint256[] memory inputs = new uint256[](0); -// Operand operand = LibOperand.build(0, 1, 0); -// opReferenceCheck( -// state, operand, LibOpTimestampNP.referenceFn, LibOpTimestampNP.integrity, LibOpTimestampNP.run, inputs -// ); -// } +// // /// Directly test the runtime logic of LibOpTimestamp. This tests that the +// // /// opcode correctly pushes the timestamp onto the stack. +// // function testOpTimestampNPRun(uint256 blockTimestamp) external { +// // blockTimestamp = bound(blockTimestamp, 0, type(uint256).max / 1e18); +// // InterpreterStateNP memory state = opTestDefaultInterpreterState(); +// // vm.warp(blockTimestamp); +// // uint256[] memory inputs = new uint256[](0); +// // Operand operand = LibOperand.build(0, 1, 0); +// // opReferenceCheck( +// // state, operand, LibOpTimestampNP.referenceFn, LibOpTimestampNP.integrity, LibOpTimestampNP.run, inputs +// // ); +// // } -// /// Test the eval of a timestamp opcode parsed from a string. -// function testOpTimestampNPEval(uint256 blockTimestamp) external { -// string[] memory words = timestampWords(); +// // /// Test the eval of a timestamp opcode parsed from a string. +// // function testOpTimestampNPEval(uint256 blockTimestamp) external { +// // string[] memory words = timestampWords(); -// for (uint256 i; i < words.length; ++i) { -// blockTimestamp = bound(blockTimestamp, 0, type(uint256).max / 1e18); -// vm.warp(blockTimestamp); -// bytes memory bytecode = iDeployer.parse2(bytes(string.concat("_: ", words[i], "();"))); -// (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], blockTimestamp * 1e18); -// assertEq(kvs.length, 0); -// } -// } +// // for (uint256 i; i < words.length; ++i) { +// // blockTimestamp = bound(blockTimestamp, 0, type(uint256).max / 1e18); +// // vm.warp(blockTimestamp); +// // bytes memory bytecode = iDeployer.parse2(bytes(string.concat("_: ", words[i], "();"))); +// // (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], blockTimestamp * 1e18); +// // assertEq(kvs.length, 0); +// // } +// // } -// /// Test that a block timestamp with inputs fails integrity check. -// function testOpBlockTimestampNPEvalFail() external { -// string[] memory words = timestampWords(); +// // /// Test that a block timestamp with inputs fails integrity check. +// // function testOpBlockTimestampNPEvalFail() external { +// // string[] memory words = timestampWords(); -// for (uint256 i; i < words.length; ++i) { -// vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 1, 0, 1)); -// bytes memory bytecode = iDeployer.parse2(bytes(string.concat("_: ", words[i], "(0x00);"))); -// (bytecode); -// } -// } +// // for (uint256 i; i < words.length; ++i) { +// // vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 1, 0, 1)); +// // bytes memory bytecode = iDeployer.parse2(bytes(string.concat("_: ", words[i], "(0x00);"))); +// // (bytecode); +// // } +// // } -// function testOpBlockTimestampNPZeroOutputs() external { -// string[] memory words = timestampWords(); +// // function testOpBlockTimestampNPZeroOutputs() external { +// // string[] memory words = timestampWords(); -// for (uint256 i; i < words.length; ++i) { -// checkBadOutputs(bytes(string.concat(": ", words[i], "();")), 0, 1, 0); -// } -// } +// // for (uint256 i; i < words.length; ++i) { +// // checkBadOutputs(bytes(string.concat(": ", words[i], "();")), 0, 1, 0); +// // } +// // } -// function testOpBlockTimestampNPTwoOutputs() external { -// string[] memory words = timestampWords(); +// // function testOpBlockTimestampNPTwoOutputs() external { +// // string[] memory words = timestampWords(); -// for (uint256 i; i < words.length; ++i) { -// checkBadOutputs(bytes(string.concat("_ _: ", words[i], "();")), 0, 1, 2); -// } -// } -// } +// // for (uint256 i; i < words.length; ++i) { +// // checkBadOutputs(bytes(string.concat("_ _: ", words[i], "();")), 0, 1, 2); +// // } +// // } +// // } diff --git a/test/src/lib/op/logic/LibOpAnyNP.t.sol b/test/src/lib/op/logic/LibOpAnyNP.t.sol index f0bd86a4b..c5063ebc6 100644 --- a/test/src/lib/op/logic/LibOpAnyNP.t.sol +++ b/test/src/lib/op/logic/LibOpAnyNP.t.sol @@ -1,55 +1,55 @@ -// // SPDX-License-Identifier: CAL -// pragma solidity =0.8.25; - -// import {Pointer} from "rain.solmem/lib/LibPointer.sol"; -// import {LibUint256Array} from "rain.solmem/lib/LibUint256Array.sol"; -// import {MemoryKV} from "rain.lib.memkv/lib/LibMemoryKV.sol"; - -// import {OpTest} from "test/abstract/OpTest.sol"; -// import {LibContext} from "rain.interpreter.interface/lib/caller/LibContext.sol"; -// import {LibOpAnyNP} from "src/lib/op/logic/LibOpAnyNP.sol"; -// import { -// IInterpreterV4, Operand, SourceIndexV2 -// } from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; -// import { -// IInterpreterStoreV2, FullyQualifiedNamespace -// } from "rain.interpreter.interface/interface/IInterpreterStoreV2.sol"; -// import {SignedContextV1} from "rain.interpreter.interface/interface/IInterpreterCallerV3.sol"; -// import {LibIntegrityCheckNP, IntegrityCheckStateNP} from "src/lib/integrity/LibIntegrityCheckNP.sol"; -// import {LibInterpreterStateNP, InterpreterStateNP} from "src/lib/state/LibInterpreterStateNP.sol"; -// import {BadOpInputsLength} from "src/lib/integrity/LibIntegrityCheckNP.sol"; -// import {LibOperand} from "test/lib/operand/LibOperand.sol"; - -// contract LibOpAnyNPTest is OpTest { -// using LibUint256Array for uint256[]; +// // // SPDX-License-Identifier: CAL +// // pragma solidity =0.8.25; + +// // import {Pointer} from "rain.solmem/lib/LibPointer.sol"; +// // import {LibUint256Array} from "rain.solmem/lib/LibUint256Array.sol"; +// // import {MemoryKV} from "rain.lib.memkv/lib/LibMemoryKV.sol"; + +// // import {OpTest} from "test/abstract/OpTest.sol"; +// // import {LibContext} from "rain.interpreter.interface/lib/caller/LibContext.sol"; +// // import {LibOpAnyNP} from "src/lib/op/logic/LibOpAnyNP.sol"; +// // import { +// // IInterpreterV4, Operand, SourceIndexV2 +// // } from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; +// // import { +// // IInterpreterStoreV2, FullyQualifiedNamespace +// // } from "rain.interpreter.interface/interface/IInterpreterStoreV2.sol"; +// // import {SignedContextV1} from "rain.interpreter.interface/interface/IInterpreterCallerV3.sol"; +// // import {LibIntegrityCheckNP, IntegrityCheckStateNP} from "src/lib/integrity/LibIntegrityCheckNP.sol"; +// // import {LibInterpreterStateNP, InterpreterStateNP} from "src/lib/state/LibInterpreterStateNP.sol"; +// // import {BadOpInputsLength} from "src/lib/integrity/LibIntegrityCheckNP.sol"; +// // import {LibOperand} from "test/lib/operand/LibOperand.sol"; + +// // contract LibOpAnyNPTest is OpTest { +// // using LibUint256Array for uint256[]; // /// Directly test the integrity logic of LibOpAnyNP. This tests the happy // /// path where the operand is valid. -// function testOpAnyNPIntegrityHappy(uint8 inputs, uint16 operandData) external { +// function testOpAnyNPIntegrityHappy(uint8 inputs, uint16 operandData) external pure { // IntegrityCheckStateNP memory state = opTestDefaultIngegrityCheckState(); // inputs = uint8(bound(uint256(inputs), 1, 0x0F)); // (uint256 calcInputs, uint256 calcOutputs) = // LibOpAnyNP.integrity(state, LibOperand.build(inputs, 1, operandData)); -// assertEq(calcInputs, inputs); -// assertEq(calcOutputs, 1); -// } - -// /// Sample the gas cost of the integrity check. -// function testOpAnyNPIntegrityGas0() external { -// vm.pauseGasMetering(); -// IntegrityCheckStateNP memory state = IntegrityCheckStateNP(6, 6, 6, new uint256[](3), 9, ""); -// Operand operand = Operand.wrap(0x50000); -// vm.resumeGasMetering(); -// // 5 inputs. Any stack index above this is fine for the state. -// (uint256 calcInputs, uint256 calcOutputs) = LibOpAnyNP.integrity(state, operand); -// (calcInputs); -// (calcOutputs); -// } +// // assertEq(calcInputs, inputs); +// // assertEq(calcOutputs, 1); +// // } + +// // /// Sample the gas cost of the integrity check. +// // function testOpAnyNPIntegrityGas0() external { +// // vm.pauseGasMetering(); +// // IntegrityCheckStateNP memory state = IntegrityCheckStateNP(6, 6, 6, new uint256[](3), 9, ""); +// // Operand operand = Operand.wrap(0x50000); +// // vm.resumeGasMetering(); +// // // 5 inputs. Any stack index above this is fine for the state. +// // (uint256 calcInputs, uint256 calcOutputs) = LibOpAnyNP.integrity(state, operand); +// // (calcInputs); +// // (calcOutputs); +// // } // /// Directly test the integrity logic of LibOpAnyNP. This tests the unhappy // /// path where the operand is invalid due to 0 inputs. -// function testOpAnyNPIntegrityUnhappyZeroInputs() external { +// function testOpAnyNPIntegrityUnhappyZeroInputs() external pure { // IntegrityCheckStateNP memory state = opTestDefaultIngegrityCheckState(); // (uint256 calcInputs, uint256 calcOutputs) = LibOpAnyNP.integrity(state, Operand.wrap(0)); // // Calc inputs will be minimum 1. @@ -58,7 +58,7 @@ // } // /// Directly test the runtime logic of LibOpAnyNP. -// function testOpAnyNPRun(uint256[] memory inputs, uint16 operandData) external { +// function testOpAnyNPRun(uint256[] memory inputs, uint16 operandData) external view { // InterpreterStateNP memory state = opTestDefaultInterpreterState(); // vm.assume(inputs.length != 0); // vm.assume(inputs.length <= 0x0F); @@ -66,76 +66,76 @@ // opReferenceCheck(state, operand, LibOpAnyNP.referenceFn, LibOpAnyNP.integrity, LibOpAnyNP.run, inputs); // } -// /// Sample the gas cost of the run function. -// function testOpAnyNPRunGas0() external { -// vm.pauseGasMetering(); -// uint256[][] memory stacks = new uint256[][](1); -// stacks[0] = new uint256[](1); -// Pointer stackTop = stacks[0].dataPointer(); -// InterpreterStateNP memory state = InterpreterStateNP( -// LibInterpreterStateNP.stackBottoms(stacks), -// new uint256[](0), -// 0, -// MemoryKV.wrap(0), -// FullyQualifiedNamespace.wrap(0), -// IInterpreterStoreV2(address(0)), -// new uint256[][](0), -// "", -// "" -// ); -// Operand operand = Operand.wrap(0x10000); -// vm.resumeGasMetering(); -// // 1 inputs. Any stack index above this is fine for the state. -// LibOpAnyNP.run(state, operand, stackTop); -// } - -// /// Test the eval of any opcode parsed from a string. Tests 1 true input. -// function testOpAnyNPEval1TrueInput() external { -// checkHappy("_: any(5);", 5e18, ""); -// } - -// /// Test the eval of any opcode parsed from a string. Tests 1 false input. -// function testOpAnyNPEval1FalseInput() external { -// checkHappy("_: any(0);", 0, ""); -// } - -// /// Test the eval of any opcode parsed from a string. Tests 2 true inputs. -// /// The first true input should be the overall result. -// function testOpAnyNPEval2TrueInputs() external { -// checkHappy("_: any(5 6);", 5e18, ""); -// } - -// /// Test the eval of any opcode parsed from a string. Tests 2 false inputs. -// function testOpAnyNPEval2FalseInputs() external { -// checkHappy("_: any(0 0);", 0, ""); -// } - -// /// Test the eval of any opcode parsed from a string. Tests 2 inputs, one -// /// true and one false. The first true input should be the overall result. -// /// The first value is the true value. -// function testOpAnyNPEval2MixedInputs() external { -// checkHappy("_: any(5 0);", 5e18, ""); -// } - -// /// Test the eval of any opcode parsed from a string. Tests 2 inputs, one -// /// true and one false. The first true input should be the overall result. -// /// The first value is the false value. -// function testOpAnyNPEval2MixedInputs2() external { -// checkHappy("_: any(0 5);", 5e18, ""); -// } - -// /// Test that any without inputs fails integrity check. -// function testOpAnyNPEvalFail() public { -// vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 0, 1, 0)); -// bytes memory bytecode = iDeployer.parse2("_: any();"); -// (bytecode); -// } - -// function testOpAnyNPZeroOutputs() external { -// checkBadOutputs(": any(0);", 1, 1, 0); -// } - -// function testOpAnyNPTwoOutputs() external { -// checkBadOutputs("_ _: any(0);", 1, 1, 2); -// } -// } +// // /// Sample the gas cost of the run function. +// // function testOpAnyNPRunGas0() external { +// // vm.pauseGasMetering(); +// // uint256[][] memory stacks = new uint256[][](1); +// // stacks[0] = new uint256[](1); +// // Pointer stackTop = stacks[0].dataPointer(); +// // InterpreterStateNP memory state = InterpreterStateNP( +// // LibInterpreterStateNP.stackBottoms(stacks), +// // new uint256[](0), +// // 0, +// // MemoryKV.wrap(0), +// // FullyQualifiedNamespace.wrap(0), +// // IInterpreterStoreV2(address(0)), +// // new uint256[][](0), +// // "", +// // "" +// // ); +// // Operand operand = Operand.wrap(0x10000); +// // vm.resumeGasMetering(); +// // // 1 inputs. Any stack index above this is fine for the state. +// // LibOpAnyNP.run(state, operand, stackTop); +// // } + +// // /// Test the eval of any opcode parsed from a string. Tests 1 true input. +// // function testOpAnyNPEval1TrueInput() external { +// // checkHappy("_: any(5);", 5e18, ""); +// // } + +// // /// Test the eval of any opcode parsed from a string. Tests 1 false input. +// // function testOpAnyNPEval1FalseInput() external { +// // checkHappy("_: any(0);", 0, ""); +// // } + +// // /// Test the eval of any opcode parsed from a string. Tests 2 true inputs. +// // /// The first true input should be the overall result. +// // function testOpAnyNPEval2TrueInputs() external { +// // checkHappy("_: any(5 6);", 5e18, ""); +// // } + +// // /// Test the eval of any opcode parsed from a string. Tests 2 false inputs. +// // function testOpAnyNPEval2FalseInputs() external { +// // checkHappy("_: any(0 0);", 0, ""); +// // } + +// // /// Test the eval of any opcode parsed from a string. Tests 2 inputs, one +// // /// true and one false. The first true input should be the overall result. +// // /// The first value is the true value. +// // function testOpAnyNPEval2MixedInputs() external { +// // checkHappy("_: any(5 0);", 5e18, ""); +// // } + +// // /// Test the eval of any opcode parsed from a string. Tests 2 inputs, one +// // /// true and one false. The first true input should be the overall result. +// // /// The first value is the false value. +// // function testOpAnyNPEval2MixedInputs2() external { +// // checkHappy("_: any(0 5);", 5e18, ""); +// // } + +// // /// Test that any without inputs fails integrity check. +// // function testOpAnyNPEvalFail() public { +// // vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 0, 1, 0)); +// // bytes memory bytecode = iDeployer.parse2("_: any();"); +// // (bytecode); +// // } + +// // function testOpAnyNPZeroOutputs() external { +// // checkBadOutputs(": any(0);", 1, 1, 0); +// // } + +// // function testOpAnyNPTwoOutputs() external { +// // checkBadOutputs("_ _: any(0);", 1, 1, 2); +// // } +// // } diff --git a/test/src/lib/op/logic/LibOpConditionsNP.t.sol b/test/src/lib/op/logic/LibOpConditionsNP.t.sol index f1bc7b15c..8019fc104 100644 --- a/test/src/lib/op/logic/LibOpConditionsNP.t.sol +++ b/test/src/lib/op/logic/LibOpConditionsNP.t.sol @@ -1,26 +1,26 @@ -// // SPDX-License-Identifier: CAL -// pragma solidity =0.8.25; - -// import {LibUint256Array} from "rain.solmem/lib/LibUint256Array.sol"; - -// import {OpTest, UnexpectedOperand} from "test/abstract/OpTest.sol"; -// import {LibContext} from "rain.interpreter.interface/lib/caller/LibContext.sol"; -// import {LibOpConditionsNP} from "src/lib/op/logic/LibOpConditionsNP.sol"; -// import {IntegrityCheckStateNP, BadOpInputsLength} from "src/lib/integrity/LibIntegrityCheckNP.sol"; -// import {InterpreterStateNP} from "src/lib/state/LibInterpreterStateNP.sol"; -// import { -// IInterpreterV4, -// Operand, -// SourceIndexV2, -// FullyQualifiedNamespace -// } from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; -// import {IInterpreterStoreV2} from "rain.interpreter.interface/interface/IInterpreterStoreV2.sol"; -// import {SignedContextV1} from "rain.interpreter.interface/interface/IInterpreterCallerV3.sol"; -// import {LibIntOrAString, IntOrAString} from "rain.intorastring/src/lib/LibIntOrAString.sol"; -// import {LibOperand} from "test/lib/operand/LibOperand.sol"; - -// contract LibOpConditionsNPTest is OpTest { -// using LibUint256Array for uint256[]; +// // // SPDX-License-Identifier: CAL +// // pragma solidity =0.8.25; + +// // import {LibUint256Array} from "rain.solmem/lib/LibUint256Array.sol"; + +// // import {OpTest, UnexpectedOperand} from "test/abstract/OpTest.sol"; +// // import {LibContext} from "rain.interpreter.interface/lib/caller/LibContext.sol"; +// // import {LibOpConditionsNP} from "src/lib/op/logic/LibOpConditionsNP.sol"; +// // import {IntegrityCheckStateNP, BadOpInputsLength} from "src/lib/integrity/LibIntegrityCheckNP.sol"; +// // import {InterpreterStateNP} from "src/lib/state/LibInterpreterStateNP.sol"; +// // import { +// // IInterpreterV4, +// // Operand, +// // SourceIndexV2, +// // FullyQualifiedNamespace +// // } from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; +// // import {IInterpreterStoreV2} from "rain.interpreter.interface/interface/IInterpreterStoreV2.sol"; +// // import {SignedContextV1} from "rain.interpreter.interface/interface/IInterpreterCallerV3.sol"; +// // import {LibIntOrAString, IntOrAString} from "rain.intorastring/src/lib/LibIntOrAString.sol"; +// // import {LibOperand} from "test/lib/operand/LibOperand.sol"; + +// // contract LibOpConditionsNPTest is OpTest { +// // using LibUint256Array for uint256[]; // /// Directly test the integrity logic of LibOpConditionsNP. This tests the happy // /// path where the operand is valid. @@ -29,135 +29,135 @@ // uint8 inputs, // uint8 outputs, // uint16 operandData -// ) external { +// ) external pure { // inputs = uint8(bound(inputs, 0, 0x0F)); // outputs = uint8(bound(outputs, 0, 0x0F)); // (uint256 calcInputs, uint256 calcOutputs) = // LibOpConditionsNP.integrity(state, LibOperand.build(inputs, outputs, operandData)); -// uint256 expectedCalcInputs = inputs; -// // Calc inputs will be minimum 2. -// if (inputs < 2) { -// expectedCalcInputs = 2; -// } -// assertEq(calcInputs, expectedCalcInputs, "calc inputs"); -// assertEq(calcOutputs, 1); -// } +// // uint256 expectedCalcInputs = inputs; +// // // Calc inputs will be minimum 2. +// // if (inputs < 2) { +// // expectedCalcInputs = 2; +// // } +// // assertEq(calcInputs, expectedCalcInputs, "calc inputs"); +// // assertEq(calcOutputs, 1); +// // } // /// Directly test the runtime logic of LibOpConditionsNP. -// function testOpConditionsNPRun(uint256[] memory inputs, uint256 finalNonZero) external { +// function testOpConditionsNPRun(uint256[] memory inputs, uint256 finalNonZero) external view { // InterpreterStateNP memory state = opTestDefaultInterpreterState(); -// // Ensure that we have inputs that are a valid pairwise conditions. -// vm.assume(inputs.length > 1); -// vm.assume(inputs.length <= 0x0F); -// if (inputs.length % 2 != 0) { -// inputs.truncate(inputs.length - 1); -// } -// // Ensure the final condition is nonzero so that we don't error. -// if (inputs[inputs.length - 2] == 0) { -// vm.assume(finalNonZero != 0); -// inputs[inputs.length - 2] = finalNonZero; -// } -// Operand operand = LibOperand.build(uint8(inputs.length), 1, 0); -// opReferenceCheck( -// state, operand, LibOpConditionsNP.referenceFn, LibOpConditionsNP.integrity, LibOpConditionsNP.run, inputs -// ); -// } - -// /// Test the error case where no conditions are met. -// function testOpConditionsNPRunNoConditionsMet(uint256[] memory inputs, string memory reason) external { -// vm.assume(bytes(reason).length <= 31); -// InterpreterStateNP memory state = opTestDefaultInterpreterState(); -// // Ensure that we have inputs that are a valid pairwise conditions. -// vm.assume(inputs.length > 1); -// if (inputs.length > 0x0F) { -// inputs.truncate(0x0F); -// } - -// Operand operand = LibOperand.build(uint8(inputs.length), 1, 0); - -// // Ensure all the conditions are zero so that we error. -// for (uint256 i = 0; i < inputs.length; i += 2) { -// inputs[i] = 0; -// } - -// if (inputs.length % 2 != 0) { -// inputs[inputs.length - 1] = IntOrAString.unwrap(LibIntOrAString.fromString2(reason)); -// } else { -// reason = ""; -// } - -// vm.expectRevert(bytes(reason)); -// opReferenceCheck( -// state, operand, LibOpConditionsNP.referenceFn, LibOpConditionsNP.integrity, LibOpConditionsNP.run, inputs -// ); -// } - -// /// Test the eval of conditions opcode parsed from a string. Tests 1 true input 1 zero output. -// function testOpConditionsNPEval1TrueInputZeroOutput() external { -// checkHappy("_: conditions(5 0);", 0, ""); -// } - -// /// Test the eval of conditions opcode parsed from a string. Tests 1 nonzero -// /// input 1 nonzero output. -// function testOpConditionsNPEval2MixedInputs() external { -// checkHappy("_: conditions(5 6);", 6e18, ""); -// } - -// /// Test that if conditions are NOT met, the expression reverts. -// function testOpConditionsNPEval1FalseInputRevert() external { -// checkUnhappy("_: conditions(0 5);", ""); -// } - -// /// Test that conditions can take an error code as an operand. -// function testOpConditionsNPEvalErrorCode() external { -// checkUnhappy("_: conditions(0x00 0x00 0x00 0x00 \"fail\");", "fail"); -// } - -// /// Test the eval of conditions opcode parsed from a string. Tests 1 zero -// /// then 1 nonzero condition. -// function testOpConditionsNPEval1FalseInput1TrueInput() external { -// checkHappy("_: conditions(0 9 3 4);", 4e18, ""); -// } - -// /// Test the eval of conditions opcode parsed from a string. Tests 2 true -// /// conditions. The first should be used. -// function testOpConditionsNPEval2TrueInputs() external { -// checkHappy("_: conditions(5 6 7 8);", 6e18, ""); -// } - -// /// Test the eval of conditions opcode parsed from a string. Tests 1 nonzero -// /// condition then 1 zero condition. -// function testOpConditionsNPEval1TrueInput1FalseInput() external { -// checkHappy("_: conditions(5 6 0 9);", 6e18, ""); -// } - -// /// Test that conditions without inputs fails integrity check. -// function testOpConditionsNPEvalFail0Inputs() public { -// vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 0, 2, 0)); -// bytes memory bytecode = iDeployer.parse2("_: conditions();"); -// (bytecode); -// } - -// /// Test that conditions with 1 inputs fails integrity check. -// function testOpConditionsNPEvalFail1Inputs() public { -// vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 1, 2, 1)); -// bytes memory bytecode = iDeployer.parse2("_: conditions(0x00);"); -// (bytecode); -// } - -// /// Test the eval of `conditions` parsed from a string. Tests the unhappy path -// /// where an operand is provided. -// function testOpConditionsNPEvalUnhappyOperand() external { -// checkUnhappyParse("_ :conditions<0>(1 1 \"foo\");", abi.encodeWithSelector(UnexpectedOperand.selector)); -// } - -// function testOpConditionsNPZeroOutputs() external { -// checkBadOutputs(": conditions(0x00 0x00);", 2, 1, 0); -// } - -// function testOpConditionsNPTwoOutputs() external { -// checkBadOutputs("_ _: conditions(0x00 0x00);", 2, 1, 2); -// } -// } +// // // Ensure that we have inputs that are a valid pairwise conditions. +// // vm.assume(inputs.length > 1); +// // vm.assume(inputs.length <= 0x0F); +// // if (inputs.length % 2 != 0) { +// // inputs.truncate(inputs.length - 1); +// // } +// // // Ensure the final condition is nonzero so that we don't error. +// // if (inputs[inputs.length - 2] == 0) { +// // vm.assume(finalNonZero != 0); +// // inputs[inputs.length - 2] = finalNonZero; +// // } +// // Operand operand = LibOperand.build(uint8(inputs.length), 1, 0); +// // opReferenceCheck( +// // state, operand, LibOpConditionsNP.referenceFn, LibOpConditionsNP.integrity, LibOpConditionsNP.run, inputs +// // ); +// // } + +// // /// Test the error case where no conditions are met. +// // function testOpConditionsNPRunNoConditionsMet(uint256[] memory inputs, string memory reason) external { +// // vm.assume(bytes(reason).length <= 31); +// // InterpreterStateNP memory state = opTestDefaultInterpreterState(); +// // // Ensure that we have inputs that are a valid pairwise conditions. +// // vm.assume(inputs.length > 1); +// // if (inputs.length > 0x0F) { +// // inputs.truncate(0x0F); +// // } + +// // Operand operand = LibOperand.build(uint8(inputs.length), 1, 0); + +// // // Ensure all the conditions are zero so that we error. +// // for (uint256 i = 0; i < inputs.length; i += 2) { +// // inputs[i] = 0; +// // } + +// // if (inputs.length % 2 != 0) { +// // inputs[inputs.length - 1] = IntOrAString.unwrap(LibIntOrAString.fromString2(reason)); +// // } else { +// // reason = ""; +// // } + +// // vm.expectRevert(bytes(reason)); +// // opReferenceCheck( +// // state, operand, LibOpConditionsNP.referenceFn, LibOpConditionsNP.integrity, LibOpConditionsNP.run, inputs +// // ); +// // } + +// // /// Test the eval of conditions opcode parsed from a string. Tests 1 true input 1 zero output. +// // function testOpConditionsNPEval1TrueInputZeroOutput() external { +// // checkHappy("_: conditions(5 0);", 0, ""); +// // } + +// // /// Test the eval of conditions opcode parsed from a string. Tests 1 nonzero +// // /// input 1 nonzero output. +// // function testOpConditionsNPEval2MixedInputs() external { +// // checkHappy("_: conditions(5 6);", 6e18, ""); +// // } + +// // /// Test that if conditions are NOT met, the expression reverts. +// // function testOpConditionsNPEval1FalseInputRevert() external { +// // checkUnhappy("_: conditions(0 5);", ""); +// // } + +// // /// Test that conditions can take an error code as an operand. +// // function testOpConditionsNPEvalErrorCode() external { +// // checkUnhappy("_: conditions(0x00 0x00 0x00 0x00 \"fail\");", "fail"); +// // } + +// // /// Test the eval of conditions opcode parsed from a string. Tests 1 zero +// // /// then 1 nonzero condition. +// // function testOpConditionsNPEval1FalseInput1TrueInput() external { +// // checkHappy("_: conditions(0 9 3 4);", 4e18, ""); +// // } + +// // /// Test the eval of conditions opcode parsed from a string. Tests 2 true +// // /// conditions. The first should be used. +// // function testOpConditionsNPEval2TrueInputs() external { +// // checkHappy("_: conditions(5 6 7 8);", 6e18, ""); +// // } + +// // /// Test the eval of conditions opcode parsed from a string. Tests 1 nonzero +// // /// condition then 1 zero condition. +// // function testOpConditionsNPEval1TrueInput1FalseInput() external { +// // checkHappy("_: conditions(5 6 0 9);", 6e18, ""); +// // } + +// // /// Test that conditions without inputs fails integrity check. +// // function testOpConditionsNPEvalFail0Inputs() public { +// // vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 0, 2, 0)); +// // bytes memory bytecode = iDeployer.parse2("_: conditions();"); +// // (bytecode); +// // } + +// // /// Test that conditions with 1 inputs fails integrity check. +// // function testOpConditionsNPEvalFail1Inputs() public { +// // vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 1, 2, 1)); +// // bytes memory bytecode = iDeployer.parse2("_: conditions(0x00);"); +// // (bytecode); +// // } + +// // /// Test the eval of `conditions` parsed from a string. Tests the unhappy path +// // /// where an operand is provided. +// // function testOpConditionsNPEvalUnhappyOperand() external { +// // checkUnhappyParse("_ :conditions<0>(1 1 \"foo\");", abi.encodeWithSelector(UnexpectedOperand.selector)); +// // } + +// // function testOpConditionsNPZeroOutputs() external { +// // checkBadOutputs(": conditions(0x00 0x00);", 2, 1, 0); +// // } + +// // function testOpConditionsNPTwoOutputs() external { +// // checkBadOutputs("_ _: conditions(0x00 0x00);", 2, 1, 2); +// // } +// // } diff --git a/test/src/lib/op/logic/LibOpEnsureNP.t.sol b/test/src/lib/op/logic/LibOpEnsureNP.t.sol index 0d2d744c2..dcf2ebed3 100644 --- a/test/src/lib/op/logic/LibOpEnsureNP.t.sol +++ b/test/src/lib/op/logic/LibOpEnsureNP.t.sol @@ -1,20 +1,20 @@ -// // SPDX-License-Identifier: CAL -// pragma solidity =0.8.25; - -// import {OpTest, UnexpectedOperand} from "test/abstract/OpTest.sol"; -// import {LibContext} from "rain.interpreter.interface/lib/caller/LibContext.sol"; -// import {ExcessRHSItems} from "src/lib/parse/LibParse.sol"; -// import {LibOpEnsureNP} from "src/lib/op/logic/LibOpEnsureNP.sol"; -// import {IntegrityCheckStateNP, BadOpInputsLength} from "src/lib/integrity/LibIntegrityCheckNP.sol"; -// import { -// IInterpreterV4, -// Operand, -// SourceIndexV2, -// FullyQualifiedNamespace -// } from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; -// import {InterpreterStateNP} from "src/lib/state/LibInterpreterStateNP.sol"; -// import {LibIntOrAString, IntOrAString} from "rain.intorastring/src/lib/LibIntOrAString.sol"; -// import {LibOperand} from "test/lib/operand/LibOperand.sol"; +// // // SPDX-License-Identifier: CAL +// // pragma solidity =0.8.25; + +// // import {OpTest, UnexpectedOperand} from "test/abstract/OpTest.sol"; +// // import {LibContext} from "rain.interpreter.interface/lib/caller/LibContext.sol"; +// // import {ExcessRHSItems} from "src/lib/parse/LibParse.sol"; +// // import {LibOpEnsureNP} from "src/lib/op/logic/LibOpEnsureNP.sol"; +// // import {IntegrityCheckStateNP, BadOpInputsLength} from "src/lib/integrity/LibIntegrityCheckNP.sol"; +// // import { +// // IInterpreterV4, +// // Operand, +// // SourceIndexV2, +// // FullyQualifiedNamespace +// // } from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; +// // import {InterpreterStateNP} from "src/lib/state/LibInterpreterStateNP.sol"; +// // import {LibIntOrAString, IntOrAString} from "rain.intorastring/src/lib/LibIntOrAString.sol"; +// // import {LibOperand} from "test/lib/operand/LibOperand.sol"; // contract LibOpEnsureNPTest is OpTest { // /// Directly test the integrity logic of LibOpEnsureNP. This tests the @@ -24,7 +24,7 @@ // uint8 inputs, // uint8 outputs, // uint16 operandData -// ) external { +// ) external pure { // inputs = uint8(bound(inputs, 0, 0x0F)); // outputs = uint8(bound(outputs, 0, 0x0F)); // (uint256 calcInputs, uint256 calcOutputs) = @@ -35,89 +35,89 @@ // /// Directly test the integrity logic of LibOpEnsureNP. This tests the // /// unhappy path where there are no inputs. -// function testOpEnsureNPIntegrityUnhappy(IntegrityCheckStateNP memory state) external { +// function testOpEnsureNPIntegrityUnhappy(IntegrityCheckStateNP memory state) external pure { // (uint256 calcInputs, uint256 calcOutputs) = LibOpEnsureNP.integrity(state, Operand.wrap(0)); // assertEq(calcInputs, 2); // assertEq(calcOutputs, 0); // } -// /// Directly test the run logic of LibOpEnsureNP. -// function testOpEnsureNPRun(uint256 condition, string memory reason) external { -// vm.assume(bytes(reason).length <= 31); -// InterpreterStateNP memory state = opTestDefaultInterpreterState(); -// uint256[] memory inputs = new uint256[](2); -// inputs[0] = condition; -// inputs[1] = IntOrAString.unwrap(LibIntOrAString.fromString2(reason)); - -// Operand operand = LibOperand.build(2, 0, 0); -// if (condition == 0) { -// vm.expectRevert(bytes(reason)); -// } -// opReferenceCheck(state, operand, LibOpEnsureNP.referenceFn, LibOpEnsureNP.integrity, LibOpEnsureNP.run, inputs); -// } - -// /// Test the eval of `ensure` parsed from a string. Tests zero inputs. -// function testOpEnsureNPEvalZero() external { -// checkBadInputs(":ensure();", 0, 2, 0); -// } - -// /// Test the eval of `ensure` parsed from a string. Tests one input. -// function testOpEnsureNPEvalOne() external { -// checkBadInputs(":ensure(1);", 1, 2, 1); -// } - -// /// Test the eval of `ensure` parsed from a string. Tests three inputs. -// function testOpEnsureNPEvalThree() external { -// checkBadInputs(":ensure(1 2 3);", 3, 2, 3); -// } - -// /// Test the eval of `ensure` parsed from a string. Tests that ensure cannot -// /// be used on the same line as another word as it has non-one outputs. -// /// Tests ensuring with an addition on the same line. -// function testOpEnsureNPEvalBadOutputs() external { -// vm.expectRevert(abi.encodeWithSelector(ExcessRHSItems.selector, 34)); -// (bytes memory bytecode, uint256[] memory constants) = iParser.parse("_:ensure(1 \"always true\") add(1 1);"); -// (bytecode); -// (constants); -// } - -// /// Test the eval of `ensure` parsed from a string. Tests that ensure cannot -// /// be used on the same line as another word as it has non-one outputs. -// /// Tests ensuring with another ensure on the same line. -// function testOpEnsureNPEvalBadOutputs2() external { -// vm.expectRevert(abi.encodeWithSelector(ExcessRHSItems.selector, 48)); -// (bytes memory bytecode, uint256[] memory constants) = -// iParser.parse(":ensure(1 \"always true\") ensure(1 \"always true\");"); -// (bytecode); -// (constants); -// } +// // /// Directly test the run logic of LibOpEnsureNP. +// // function testOpEnsureNPRun(uint256 condition, string memory reason) external { +// // vm.assume(bytes(reason).length <= 31); +// // InterpreterStateNP memory state = opTestDefaultInterpreterState(); +// // uint256[] memory inputs = new uint256[](2); +// // inputs[0] = condition; +// // inputs[1] = IntOrAString.unwrap(LibIntOrAString.fromString2(reason)); + +// // Operand operand = LibOperand.build(2, 0, 0); +// // if (condition == 0) { +// // vm.expectRevert(bytes(reason)); +// // } +// // opReferenceCheck(state, operand, LibOpEnsureNP.referenceFn, LibOpEnsureNP.integrity, LibOpEnsureNP.run, inputs); +// // } + +// // /// Test the eval of `ensure` parsed from a string. Tests zero inputs. +// // function testOpEnsureNPEvalZero() external { +// // checkBadInputs(":ensure();", 0, 2, 0); +// // } + +// // /// Test the eval of `ensure` parsed from a string. Tests one input. +// // function testOpEnsureNPEvalOne() external { +// // checkBadInputs(":ensure(1);", 1, 2, 1); +// // } + +// // /// Test the eval of `ensure` parsed from a string. Tests three inputs. +// // function testOpEnsureNPEvalThree() external { +// // checkBadInputs(":ensure(1 2 3);", 3, 2, 3); +// // } + +// // /// Test the eval of `ensure` parsed from a string. Tests that ensure cannot +// // /// be used on the same line as another word as it has non-one outputs. +// // /// Tests ensuring with an addition on the same line. +// // function testOpEnsureNPEvalBadOutputs() external { +// // vm.expectRevert(abi.encodeWithSelector(ExcessRHSItems.selector, 34)); +// // (bytes memory bytecode, uint256[] memory constants) = iParser.parse("_:ensure(1 \"always true\") add(1 1);"); +// // (bytecode); +// // (constants); +// // } + +// // /// Test the eval of `ensure` parsed from a string. Tests that ensure cannot +// // /// be used on the same line as another word as it has non-one outputs. +// // /// Tests ensuring with another ensure on the same line. +// // function testOpEnsureNPEvalBadOutputs2() external { +// // vm.expectRevert(abi.encodeWithSelector(ExcessRHSItems.selector, 48)); +// // (bytes memory bytecode, uint256[] memory constants) = +// // iParser.parse(":ensure(1 \"always true\") ensure(1 \"always true\");"); +// // (bytecode); +// // (constants); +// // } // /// Test the eval of `ensure` parsed from a string. Tests the happy path // /// where all inputs are nonzero. -// function testOpEnsureNPEvalHappy() external { +// function testOpEnsureNPEvalHappy() external view { // checkHappy(":ensure(1 \"always 1\"), _:1;", 1e18, "1"); // checkHappy(":ensure(5 \"always 5\"), _:1;", 1e18, "5"); -// // Empty reason should be fine. -// checkHappy(":ensure(1 \"\"), _:1;", 1e18, ""); -// } - -// /// Test the eval of `ensure` parsed from a string. Tests the unhappy path -// /// where the input is 0. -// function testOpEnsureNPEvalUnhappy() external { -// checkUnhappy(":ensure(0 \"foo\"), _:1;", "foo"); - -// // Empty reason should be fine. -// checkUnhappy(":ensure(0 \"\"), _:1;", ""); -// } - -// /// Test the eval of `ensure` parsed from a string. Tests the unhappy path -// /// where an operand is provided. -// function testOpEnsureNPEvalUnhappyOperand() external { -// checkUnhappyParse(":ensure<0>(1 \"foo\");", abi.encodeWithSelector(UnexpectedOperand.selector)); -// } - -// function testOpEnsureNPOneOutput() external { -// checkBadOutputs("_:ensure(1 \"foo\");", 2, 0, 1); -// } -// } +// // // Empty reason should be fine. +// // checkHappy(":ensure(1 \"\"), _:1;", 1e18, ""); +// // } + +// // /// Test the eval of `ensure` parsed from a string. Tests the unhappy path +// // /// where the input is 0. +// // function testOpEnsureNPEvalUnhappy() external { +// // checkUnhappy(":ensure(0 \"foo\"), _:1;", "foo"); + +// // // Empty reason should be fine. +// // checkUnhappy(":ensure(0 \"\"), _:1;", ""); +// // } + +// // /// Test the eval of `ensure` parsed from a string. Tests the unhappy path +// // /// where an operand is provided. +// // function testOpEnsureNPEvalUnhappyOperand() external { +// // checkUnhappyParse(":ensure<0>(1 \"foo\");", abi.encodeWithSelector(UnexpectedOperand.selector)); +// // } + +// // function testOpEnsureNPOneOutput() external { +// // checkBadOutputs("_:ensure(1 \"foo\");", 2, 0, 1); +// // } +// // } diff --git a/test/src/lib/op/logic/LibOpEqualToNP.t.sol b/test/src/lib/op/logic/LibOpEqualToNP.t.sol index 979705da0..30af3c6d1 100644 --- a/test/src/lib/op/logic/LibOpEqualToNP.t.sol +++ b/test/src/lib/op/logic/LibOpEqualToNP.t.sol @@ -1,20 +1,20 @@ -// // SPDX-License-Identifier: CAL -// pragma solidity =0.8.25; +// // // 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 {LibOpEqualToNP} from "src/lib/op/logic/LibOpEqualToNP.sol"; -// import {IntegrityCheckStateNP, BadOpInputsLength} from "src/lib/integrity/LibIntegrityCheckNP.sol"; -// import { -// IInterpreterV4, -// Operand, -// SourceIndexV2, -// FullyQualifiedNamespace -// } from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; -// import {InterpreterStateNP} from "src/lib/state/LibInterpreterStateNP.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 {OpTest} from "test/abstract/OpTest.sol"; +// // import {LibContext} from "rain.interpreter.interface/lib/caller/LibContext.sol"; +// // import {LibOpEqualToNP} from "src/lib/op/logic/LibOpEqualToNP.sol"; +// // import {IntegrityCheckStateNP, BadOpInputsLength} from "src/lib/integrity/LibIntegrityCheckNP.sol"; +// // import { +// // IInterpreterV4, +// // Operand, +// // SourceIndexV2, +// // FullyQualifiedNamespace +// // } from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; +// // import {InterpreterStateNP} from "src/lib/state/LibInterpreterStateNP.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 LibOpEqualToNPTest is OpTest { // /// Directly test the integrity logic of LibOpEqualToNP. No matter the @@ -25,19 +25,19 @@ // uint8 inputs, // uint8 outputs, // uint16 operandData -// ) external { +// ) external pure { // inputs = uint8(bound(inputs, 0, 0x0F)); // outputs = uint8(bound(outputs, 0, 0x0F)); // (uint256 calcInputs, uint256 calcOutputs) = // LibOpEqualToNP.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); -// } +// // // 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 LibOpEqualToNP. -// function testOpEqualToNPRun(uint256 input1, uint256 input2) external { +// function testOpEqualToNPRun(uint256 input1, uint256 input2) external view { // InterpreterStateNP memory state = opTestDefaultInterpreterState(); // uint256[] memory inputs = new uint256[](2); // inputs[0] = input1; @@ -48,56 +48,56 @@ // ); // } -// /// Test the eval of greater than opcode parsed from a string. Tests 2 -// /// inputs. Both inputs are 0. -// function testOpEqualToNPEval2ZeroInputs() external { -// checkHappy("_: equal-to(0 0);", 1, ""); -// } +// // /// Test the eval of greater than opcode parsed from a string. Tests 2 +// // /// inputs. Both inputs are 0. +// // function testOpEqualToNPEval2ZeroInputs() external { +// // checkHappy("_: equal-to(0 0);", 1, ""); +// // } -// /// Test the eval of greater than opcode parsed from a string. Tests 2 -// /// inputs. The first input is 0, the second input is 1. -// function testOpEqualToNPEval2InputsFirstZeroSecondOne() external { -// checkHappy("_: equal-to(0 1);", 0, ""); -// } +// // /// Test the eval of greater than opcode parsed from a string. Tests 2 +// // /// inputs. The first input is 0, the second input is 1. +// // function testOpEqualToNPEval2InputsFirstZeroSecondOne() external { +// // checkHappy("_: equal-to(0 1);", 0, ""); +// // } -// /// Test the eval of greater than opcode parsed from a string. Tests 2 -// /// inputs. The first input is 1, the second input is 0. -// function testOpEqualToNPEval2InputsFirstOneSecondZero() external { -// checkHappy("_: equal-to(1 0);", 0, ""); -// } +// // /// Test the eval of greater than opcode parsed from a string. Tests 2 +// // /// inputs. The first input is 1, the second input is 0. +// // function testOpEqualToNPEval2InputsFirstOneSecondZero() external { +// // checkHappy("_: equal-to(1 0);", 0, ""); +// // } -// /// Test the eval of greater than opcode parsed from a string. Tests 2 -// /// inputs. Both inputs are 1. -// function testOpEqualToNPEval2InputsBothOne() external { -// checkHappy("_: equal-to(1 1);", 1, ""); -// } +// // /// Test the eval of greater than opcode parsed from a string. Tests 2 +// // /// inputs. Both inputs are 1. +// // function testOpEqualToNPEval2InputsBothOne() external { +// // checkHappy("_: equal-to(1 1);", 1, ""); +// // } -// /// Test that an equal to without inputs fails integrity check. -// function testOpEqualToNPEvalFail0Inputs() public { -// vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 0, 2, 0)); -// bytes memory bytecode = iDeployer.parse2("_: equal-to();"); -// (bytecode); -// } +// // /// Test that an equal to without inputs fails integrity check. +// // function testOpEqualToNPEvalFail0Inputs() public { +// // vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 0, 2, 0)); +// // bytes memory bytecode = iDeployer.parse2("_: equal-to();"); +// // (bytecode); +// // } -// /// Test that an equal to with 1 input fails integrity check. -// function testOpEqualToNPEvalFail1Input() public { -// vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 1, 2, 1)); -// bytes memory bytecode = iDeployer.parse2("_: equal-to(0x00);"); -// (bytecode); -// } +// // /// Test that an equal to with 1 input fails integrity check. +// // function testOpEqualToNPEvalFail1Input() public { +// // vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 1, 2, 1)); +// // bytes memory bytecode = iDeployer.parse2("_: equal-to(0x00);"); +// // (bytecode); +// // } -// /// Test that an equal to with 3 inputs fails integrity check. -// function testOpEqualToNPEvalFail3Inputs() public { -// vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 3, 2, 3)); -// bytes memory bytecode = iDeployer.parse2("_: equal-to(0x00 0x00 0x00);"); -// (bytecode); -// } +// // /// Test that an equal to with 3 inputs fails integrity check. +// // function testOpEqualToNPEvalFail3Inputs() public { +// // vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 3, 2, 3)); +// // bytes memory bytecode = iDeployer.parse2("_: equal-to(0x00 0x00 0x00);"); +// // (bytecode); +// // } -// function testOpEqualToNPZeroOutputs() external { -// checkBadOutputs(": equal-to(0 0);", 2, 1, 0); -// } +// // function testOpEqualToNPZeroOutputs() external { +// // checkBadOutputs(": equal-to(0 0);", 2, 1, 0); +// // } -// function testOpEqualToNPTwoOutputs() external { -// checkBadOutputs("_ _: equal-to(0 0);", 2, 1, 2); -// } -// } +// // function testOpEqualToNPTwoOutputs() external { +// // checkBadOutputs("_ _: equal-to(0 0);", 2, 1, 2); +// // } +// // } diff --git a/test/src/lib/op/logic/LibOpEveryNP.t.sol b/test/src/lib/op/logic/LibOpEveryNP.t.sol index cc1be7465..2eba6ab86 100644 --- a/test/src/lib/op/logic/LibOpEveryNP.t.sol +++ b/test/src/lib/op/logic/LibOpEveryNP.t.sol @@ -1,20 +1,20 @@ -// // SPDX-License-Identifier: CAL -// pragma solidity =0.8.25; +// // // 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 {LibOpEveryNP} from "src/lib/op/logic/LibOpEveryNP.sol"; -// import {IntegrityCheckStateNP, BadOpInputsLength} from "src/lib/integrity/LibIntegrityCheckNP.sol"; -// import { -// IInterpreterV4, -// Operand, -// SourceIndexV2, -// FullyQualifiedNamespace -// } from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; -// import {InterpreterStateNP} from "src/lib/state/LibInterpreterStateNP.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 {OpTest} from "test/abstract/OpTest.sol"; +// // import {LibContext} from "rain.interpreter.interface/lib/caller/LibContext.sol"; +// // import {LibOpEveryNP} from "src/lib/op/logic/LibOpEveryNP.sol"; +// // import {IntegrityCheckStateNP, BadOpInputsLength} from "src/lib/integrity/LibIntegrityCheckNP.sol"; +// // import { +// // IInterpreterV4, +// // Operand, +// // SourceIndexV2, +// // FullyQualifiedNamespace +// // } from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; +// // import {InterpreterStateNP} from "src/lib/state/LibInterpreterStateNP.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 LibOpEveryNPTest is OpTest { // /// Directly test the integrity logic of LibOpEveryNP. This tests the happy @@ -24,20 +24,20 @@ // uint8 inputs, // uint8 outputs, // uint16 operandData -// ) external { +// ) external pure { // inputs = uint8(bound(inputs, 1, 0x0F)); // outputs = uint8(bound(outputs, 1, 0x0F)); -// (uint256 calcInputs, uint256 calcOutputs) = -// LibOpEveryNP.integrity(state, LibOperand.build(inputs, outputs, operandData)); +// // (uint256 calcInputs, uint256 calcOutputs) = +// // LibOpEveryNP.integrity(state, LibOperand.build(inputs, outputs, operandData)); -// assertEq(calcInputs, inputs); -// assertEq(calcOutputs, 1); -// } +// // assertEq(calcInputs, inputs); +// // assertEq(calcOutputs, 1); +// // } // /// Directly test the integrity logic of LibOpEveryNP. This tests the unhappy // /// path where the operand is invalid due to 0 inputs. -// function testOpEveryNPIntegrityUnhappyZeroInputs(IntegrityCheckStateNP memory state) external { +// function testOpEveryNPIntegrityUnhappyZeroInputs(IntegrityCheckStateNP memory state) external pure { // (uint256 calcInputs, uint256 calcOutputs) = LibOpEveryNP.integrity(state, Operand.wrap(0)); // // Calc inputs will be minimum 1. // assertEq(calcInputs, 1); @@ -45,7 +45,7 @@ // } // /// Directly test the runtime logic of LibOpEveryNP. -// function testOpEveryNPRun(uint256[] memory inputs) external { +// function testOpEveryNPRun(uint256[] memory inputs) external view { // InterpreterStateNP memory state = opTestDefaultInterpreterState(); // vm.assume(inputs.length != 0); // vm.assume(inputs.length <= 0x0F); @@ -53,51 +53,51 @@ // opReferenceCheck(state, operand, LibOpEveryNP.referenceFn, LibOpEveryNP.integrity, LibOpEveryNP.run, inputs); // } -// /// Test the eval of every opcode parsed from a string. Tests 1 true input. -// function testOpEveryNPEval1TrueInput() external { -// checkHappy("_: every(5);", 5e18, ""); -// } +// // /// Test the eval of every opcode parsed from a string. Tests 1 true input. +// // function testOpEveryNPEval1TrueInput() external { +// // checkHappy("_: every(5);", 5e18, ""); +// // } -// /// Test the eval of every opcode parsed from a string. Tests 1 false input. -// function testOpEveryNPEval1FalseInput() external { -// checkHappy("_: every(0);", 0, ""); -// } +// // /// Test the eval of every opcode parsed from a string. Tests 1 false input. +// // function testOpEveryNPEval1FalseInput() external { +// // checkHappy("_: every(0);", 0, ""); +// // } -// /// Test the eval of every opcode parsed from a string. Tests 2 true inputs. -// /// The last true input should be the overall result. -// function testOpEveryNPEval2TrueInputs() external { -// checkHappy("_: every(5 6);", 6e18, ""); -// } +// // /// Test the eval of every opcode parsed from a string. Tests 2 true inputs. +// // /// The last true input should be the overall result. +// // function testOpEveryNPEval2TrueInputs() external { +// // checkHappy("_: every(5 6);", 6e18, ""); +// // } -// /// Test the eval of every opcode parsed from a string. Tests 2 false inputs. -// function testOpEveryNPEval2FalseInputs() external { -// checkHappy("_: every(0 0);", 0, ""); -// } +// // /// Test the eval of every opcode parsed from a string. Tests 2 false inputs. +// // function testOpEveryNPEval2FalseInputs() external { +// // checkHappy("_: every(0 0);", 0, ""); +// // } -// /// Test the eval of every opcode parsed from a string. Tests 2 inputs, one -// /// true and one false. The overall result is false. -// function testOpEveryNPEval2MixedInputs() external { -// checkHappy("_: every(5 0);", 0, ""); -// } +// // /// Test the eval of every opcode parsed from a string. Tests 2 inputs, one +// // /// true and one false. The overall result is false. +// // function testOpEveryNPEval2MixedInputs() external { +// // checkHappy("_: every(5 0);", 0, ""); +// // } -// /// Test the eval of every opcode parsed from a string. Tests 2 inputs, one -// /// true and one false. The overall result is false. -// function testOpEveryNPEval2MixedInputs2() external { -// checkHappy("_: every(0 5);", 0, ""); -// } +// // /// Test the eval of every opcode parsed from a string. Tests 2 inputs, one +// // /// true and one false. The overall result is false. +// // function testOpEveryNPEval2MixedInputs2() external { +// // checkHappy("_: every(0 5);", 0, ""); +// // } -// /// Test that every without inputs fails integrity check. -// function testOpAnyNPEvalFail() public { -// vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 0, 1, 0)); -// bytes memory bytecode = iDeployer.parse2("_: every();"); -// (bytecode); -// } +// // /// Test that every without inputs fails integrity check. +// // function testOpAnyNPEvalFail() public { +// // vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 0, 1, 0)); +// // bytes memory bytecode = iDeployer.parse2("_: every();"); +// // (bytecode); +// // } -// function testOpEveryNPZeroOutputs() external { -// checkBadOutputs(": every(5);", 1, 1, 0); -// } +// // function testOpEveryNPZeroOutputs() external { +// // checkBadOutputs(": every(5);", 1, 1, 0); +// // } -// function testOpEveryNPTwoOutputs() external { -// checkBadOutputs("_ _: every(5);", 1, 1, 2); -// } -// } +// // function testOpEveryNPTwoOutputs() external { +// // checkBadOutputs("_ _: every(5);", 1, 1, 2); +// // } +// // } diff --git a/test/src/lib/op/logic/LibOpGreaterThanNP.t.sol b/test/src/lib/op/logic/LibOpGreaterThanNP.t.sol index 83581cfe1..2d5f4906f 100644 --- a/test/src/lib/op/logic/LibOpGreaterThanNP.t.sol +++ b/test/src/lib/op/logic/LibOpGreaterThanNP.t.sol @@ -1,20 +1,20 @@ -// // SPDX-License-Identifier: CAL -// pragma solidity =0.8.25; +// // // 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 {LibOpGreaterThanNP} from "src/lib/op/logic/LibOpGreaterThanNP.sol"; -// import {IntegrityCheckStateNP, BadOpInputsLength} from "src/lib/integrity/LibIntegrityCheckNP.sol"; -// import { -// IInterpreterV4, -// Operand, -// SourceIndexV2, -// FullyQualifiedNamespace -// } from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; -// import {InterpreterStateNP} from "src/lib/state/LibInterpreterStateNP.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 {OpTest} from "test/abstract/OpTest.sol"; +// // import {LibContext} from "rain.interpreter.interface/lib/caller/LibContext.sol"; +// // import {LibOpGreaterThanNP} from "src/lib/op/logic/LibOpGreaterThanNP.sol"; +// // import {IntegrityCheckStateNP, BadOpInputsLength} from "src/lib/integrity/LibIntegrityCheckNP.sol"; +// // import { +// // IInterpreterV4, +// // Operand, +// // SourceIndexV2, +// // FullyQualifiedNamespace +// // } from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; +// // import {InterpreterStateNP} from "src/lib/state/LibInterpreterStateNP.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 LibOpGreaterThanNPTest is OpTest { // /// Directly test the integrity logic of LibOpGreaterThanNP. No matter the @@ -25,19 +25,19 @@ // uint8 inputs, // uint8 outputs, // uint16 operandData -// ) external { +// ) external pure { // inputs = uint8(bound(inputs, 0, 0x0F)); // outputs = uint8(bound(outputs, 0, 0x0F)); // (uint256 calcInputs, uint256 calcOutputs) = // LibOpGreaterThanNP.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); -// } +// // // 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 LibOpGreaterThanNP. -// function testOpGreaterThanNPRun(uint256 input1, uint256 input2) external { +// function testOpGreaterThanNPRun(uint256 input1, uint256 input2) external view { // InterpreterStateNP memory state = opTestDefaultInterpreterState(); // uint256[] memory inputs = new uint256[](2); // inputs[0] = input1; @@ -48,56 +48,56 @@ // ); // } -// /// Test the eval of greater than opcode parsed from a string. Tests 2 -// /// inputs. Both inputs are 0. -// function testOpGreaterThanNPEval2ZeroInputs() external { -// checkHappy("_: greater-than(0 0);", 0, ""); -// } +// // /// Test the eval of greater than opcode parsed from a string. Tests 2 +// // /// inputs. Both inputs are 0. +// // function testOpGreaterThanNPEval2ZeroInputs() external { +// // checkHappy("_: greater-than(0 0);", 0, ""); +// // } -// /// Test the eval of greater than opcode parsed from a string. Tests 2 -// /// inputs. The first input is 0, the second input is 1. -// function testOpGreaterThanNPEval2InputsFirstZeroSecondOne() external { -// checkHappy("_: greater-than(0 1);", 0, ""); -// } +// // /// Test the eval of greater than opcode parsed from a string. Tests 2 +// // /// inputs. The first input is 0, the second input is 1. +// // function testOpGreaterThanNPEval2InputsFirstZeroSecondOne() external { +// // checkHappy("_: greater-than(0 1);", 0, ""); +// // } -// /// Test the eval of greater than opcode parsed from a string. Tests 2 -// /// inputs. The first input is 1, the second input is 0. -// function testOpGreaterThanNPEval2InputsFirstOneSecondZero() external { -// checkHappy("_: greater-than(1 0);", 1, ""); -// } +// // /// Test the eval of greater than opcode parsed from a string. Tests 2 +// // /// inputs. The first input is 1, the second input is 0. +// // function testOpGreaterThanNPEval2InputsFirstOneSecondZero() external { +// // checkHappy("_: greater-than(1 0);", 1, ""); +// // } -// /// Test the eval of greater than opcode parsed from a string. Tests 2 -// /// inputs. Both inputs are 1. -// function testOpGreaterThanNPEval2InputsBothOne() external { -// checkHappy("_: greater-than(1 1);", 0, ""); -// } +// // /// Test the eval of greater than opcode parsed from a string. Tests 2 +// // /// inputs. Both inputs are 1. +// // function testOpGreaterThanNPEval2InputsBothOne() external { +// // checkHappy("_: greater-than(1 1);", 0, ""); +// // } -// /// Test that a greater than without inputs fails integrity check. -// function testOpGreaterThanNPEvalFail0Inputs() public { -// vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 0, 2, 0)); -// bytes memory bytecode = iDeployer.parse2("_: greater-than();"); -// (bytecode); -// } +// // /// Test that a greater than without inputs fails integrity check. +// // function testOpGreaterThanNPEvalFail0Inputs() public { +// // vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 0, 2, 0)); +// // bytes memory bytecode = iDeployer.parse2("_: greater-than();"); +// // (bytecode); +// // } -// /// Test that a greater than with 1 input fails integrity check. -// function testOpGreaterThanNPEvalFail1Input() public { -// vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 1, 2, 1)); -// bytes memory bytecode = iDeployer.parse2("_: greater-than(0x00);"); -// (bytecode); -// } +// // /// Test that a greater than with 1 input fails integrity check. +// // function testOpGreaterThanNPEvalFail1Input() public { +// // vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 1, 2, 1)); +// // bytes memory bytecode = iDeployer.parse2("_: greater-than(0x00);"); +// // (bytecode); +// // } -// /// Test that a greater than with 3 inputs fails integrity check. -// function testOpGreaterThanNPEvalFail3Inputs() public { -// vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 3, 2, 3)); -// bytes memory bytecode = iDeployer.parse2("_: greater-than(0x00 0x00 0x00);"); -// (bytecode); -// } +// // /// Test that a greater than with 3 inputs fails integrity check. +// // function testOpGreaterThanNPEvalFail3Inputs() public { +// // vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 3, 2, 3)); +// // bytes memory bytecode = iDeployer.parse2("_: greater-than(0x00 0x00 0x00);"); +// // (bytecode); +// // } -// function testOpGreaterThanNPZeroOutputs() external { -// checkBadOutputs(": greater-than(1 2);", 2, 1, 0); -// } +// // function testOpGreaterThanNPZeroOutputs() external { +// // checkBadOutputs(": greater-than(1 2);", 2, 1, 0); +// // } -// function testOpGreaterThanNPTwoOutputs() external { -// checkBadOutputs("_ _: greater-than(1 2);", 2, 1, 2); -// } -// } +// // function testOpGreaterThanNPTwoOutputs() external { +// // checkBadOutputs("_ _: greater-than(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 index 00cd7e7cd..260d4b222 100644 --- a/test/src/lib/op/logic/LibOpGreaterThanOrEqualToNP.t.sol +++ b/test/src/lib/op/logic/LibOpGreaterThanOrEqualToNP.t.sol @@ -1,36 +1,39 @@ -// // SPDX-License-Identifier: CAL -// pragma solidity =0.8.25; +// // // 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 {IntegrityCheckStateNP, BadOpInputsLength} from "src/lib/integrity/LibIntegrityCheckNP.sol"; -// import { -// IInterpreterV4, -// Operand, -// SourceIndexV2, -// FullyQualifiedNamespace -// } from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; -// import {InterpreterStateNP} from "src/lib/state/LibInterpreterStateNP.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 {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 {IntegrityCheckStateNP, BadOpInputsLength} from "src/lib/integrity/LibIntegrityCheckNP.sol"; +// // import { +// // IInterpreterV4, +// // Operand, +// // SourceIndexV2, +// // FullyQualifiedNamespace +// // } from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; +// // import {InterpreterStateNP} from "src/lib/state/LibInterpreterStateNP.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(IntegrityCheckStateNP memory state, uint8 inputs) external { +// function testOpGreaterThanOrEqualToNPIntegrityHappy(IntegrityCheckStateNP 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); -// } +// // // 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 { +// function testOpGreaterThanOrEqualToNPRun(uint256 input1, uint256 input2) external view { // InterpreterStateNP memory state = opTestDefaultInterpreterState(); // uint256[] memory inputs = new uint256[](2); // inputs[0] = input1; @@ -46,56 +49,56 @@ // ); // } -// /// 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. 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 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. 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 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 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 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); -// } +// // /// 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 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); -// } -// } +// // function testOpGreaterThanOrEqualToNPTwoOutputs() external { +// // checkBadOutputs("_ _: greater-than-or-equal-to(1 2);", 2, 1, 2); +// // } +// // } diff --git a/test/src/lib/op/logic/LibOpIfNP.t.sol b/test/src/lib/op/logic/LibOpIfNP.t.sol index 3b0f0e69f..cf0b32f0e 100644 --- a/test/src/lib/op/logic/LibOpIfNP.t.sol +++ b/test/src/lib/op/logic/LibOpIfNP.t.sol @@ -1,20 +1,20 @@ -// // 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 {LibOpIfNP} from "src/lib/op/logic/LibOpIfNP.sol"; -// import {IntegrityCheckStateNP, BadOpInputsLength} from "src/lib/integrity/LibIntegrityCheckNP.sol"; -// import { -// IInterpreterV4, -// Operand, -// SourceIndexV2, -// FullyQualifiedNamespace -// } from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; -// import {InterpreterStateNP} from "src/lib/state/LibInterpreterStateNP.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"; +// // // 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 {LibOpIfNP} from "src/lib/op/logic/LibOpIfNP.sol"; +// // import {IntegrityCheckStateNP, BadOpInputsLength} from "src/lib/integrity/LibIntegrityCheckNP.sol"; +// // import { +// // IInterpreterV4, +// // Operand, +// // SourceIndexV2, +// // FullyQualifiedNamespace +// // } from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; +// // import {InterpreterStateNP} from "src/lib/state/LibInterpreterStateNP.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 LibOpIfNPTest is OpTest { // /// Directly test the integrity logic of LibOpIfNP. No matter the @@ -25,19 +25,19 @@ // uint8 inputs, // uint8 outputs, // uint16 operandData -// ) external { +// ) external pure { // inputs = uint8(bound(inputs, 0, 0x0F)); // outputs = uint8(bound(outputs, 0, 0x0F)); // (uint256 calcInputs, uint256 calcOutputs) = // LibOpIfNP.integrity(state, LibOperand.build(inputs, outputs, operandData)); -// // The inputs from the operand are ignored. The op is always 2 inputs. -// assertEq(calcInputs, 3); -// assertEq(calcOutputs, 1); -// } +// // // The inputs from the operand are ignored. The op is always 2 inputs. +// // assertEq(calcInputs, 3); +// // assertEq(calcOutputs, 1); +// // } // /// Directly test the runtime logic of LibOpIfNP. -// function testOpIfNPRun(uint256 a, uint256 b, uint256 c) external { +// function testOpIfNPRun(uint256 a, uint256 b, uint256 c) external view { // InterpreterStateNP memory state = opTestDefaultInterpreterState(); // uint256[] memory inputs = new uint256[](3); // inputs[0] = a; @@ -47,92 +47,92 @@ // opReferenceCheck(state, operand, LibOpIfNP.referenceFn, LibOpIfNP.integrity, LibOpIfNP.run, inputs); // } -// /// Test the eval of if parsed from a string. Tests 3 inputs. The first input -// /// is 0, the second input is 1, the third input is 2. -// function testOpIfNPEval3InputsFirstZeroSecondOneThirdTwo() external { -// checkHappy("_: if(0 1 2);", 2e18, ""); -// } - -// /// Test the eval of if parsed from a string. Tests 3 inputs. The first input -// /// is 1, the second input is 2, the third input is 3. -// function testOpIfNPEval3InputsFirstOneSecondTwoThirdThree() external { -// checkHappy("_: if(1 2 3);", 2e18, ""); -// } - -// /// Test the eval of if parsed from a string. Tests 3 inputs. The first input -// /// is 0, the second input is 0, the third input is 3. -// function testOpIfNPEval3InputsFirstZeroSecondZeroThirdThree() external { -// checkHappy("_: if(0 0 3);", 3e18, ""); -// } - -// /// Test the eval of if parsed from a string. Tests 3 inputs. The first input -// /// is 1, the second input is 0, the third input is 3. -// function testOpIfNPEval3InputsFirstOneSecondZeroThirdThree() external { -// checkHappy("_: if(1 0 3);", 0, ""); -// } - -// /// Test the eval of if parsed from a string. Tests 3 inputs. The first input -// /// is 0, the second input is 1, the third input is 0. -// function testOpIfNPEval3InputsFirstZeroSecondOneThirdZero() external { -// checkHappy("_: if(0 1 0);", 0, ""); -// } - -// /// Test the eval of if parsed from a string. Tests 3 inputs. The first input -// /// is 0, the second input is 0, the third input is 1. -// function testOpIfNPEval3InputsFirstZeroSecondZeroThirdOne() external { -// checkHappy("_: if(0 0 1);", 1e18, ""); -// } - -// /// Test the eval of if parsed from a string. Tests 3 inputs. The first input -// /// is 2, the second input is 3, the third input is 4. -// function testOpIfNPEval3InputsFirstTwoSecondThreeThirdFour() external { -// checkHappy("_: if(2 3 4);", 3e18, ""); -// } - -// /// Test the eval of if parsed from a string. Tests 3 inputs. The first input -// /// is 2, the second input is 0, the third input is 4. -// function testOpIfNPEval3InputsFirstTwoSecondZeroThirdFour() external { -// checkHappy("_: if(2 0 4);", 0, ""); -// } - -// /// Test that empty strings are truthy values. -// function testOpIfNPEvalEmptyStringTruthy() external { -// checkHappy("_: if(\"\" 5 50);", 5e18, ""); -// } - -// /// Test that an if without inputs fails integrity check. -// function testOpIfNPEvalFail0Inputs() public { -// vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 0, 3, 0)); -// bytes memory bytecode = iDeployer.parse2("_: if();"); -// (bytecode); -// } - -// /// Test that an if with 1 input fails integrity check. -// function testOpIfNPEvalFail1Input() public { -// vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 1, 3, 1)); -// bytes memory bytecode = iDeployer.parse2("_: if(0x00);"); -// (bytecode); -// } - -// /// Test that an if with 2 inputs fails integrity check. -// function testOpIfNPEvalFail2Inputs() public { -// vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 2, 3, 2)); -// bytes memory bytecode = iDeployer.parse2("_: if(0x00 0x00);"); -// (bytecode); -// } - -// /// Test that an if with 4 inputs fails integrity check. -// function testOpIfNPEvalFail4Inputs() public { -// vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 4, 3, 4)); -// bytes memory bytecode = iDeployer.parse2("_: if(0x00 0x00 0x00 0x00);"); -// (bytecode); -// } - -// function testOpIfNPEvalZeroOutputs() external { -// checkBadOutputs(": if(5 0 0);", 3, 1, 0); -// } - -// function testOpIfNPEvalTwoOutputs() external { -// checkBadOutputs("_ _: if(5 0 0);", 3, 1, 2); -// } -// } +// // /// Test the eval of if parsed from a string. Tests 3 inputs. The first input +// // /// is 0, the second input is 1, the third input is 2. +// // function testOpIfNPEval3InputsFirstZeroSecondOneThirdTwo() external { +// // checkHappy("_: if(0 1 2);", 2e18, ""); +// // } + +// // /// Test the eval of if parsed from a string. Tests 3 inputs. The first input +// // /// is 1, the second input is 2, the third input is 3. +// // function testOpIfNPEval3InputsFirstOneSecondTwoThirdThree() external { +// // checkHappy("_: if(1 2 3);", 2e18, ""); +// // } + +// // /// Test the eval of if parsed from a string. Tests 3 inputs. The first input +// // /// is 0, the second input is 0, the third input is 3. +// // function testOpIfNPEval3InputsFirstZeroSecondZeroThirdThree() external { +// // checkHappy("_: if(0 0 3);", 3e18, ""); +// // } + +// // /// Test the eval of if parsed from a string. Tests 3 inputs. The first input +// // /// is 1, the second input is 0, the third input is 3. +// // function testOpIfNPEval3InputsFirstOneSecondZeroThirdThree() external { +// // checkHappy("_: if(1 0 3);", 0, ""); +// // } + +// // /// Test the eval of if parsed from a string. Tests 3 inputs. The first input +// // /// is 0, the second input is 1, the third input is 0. +// // function testOpIfNPEval3InputsFirstZeroSecondOneThirdZero() external { +// // checkHappy("_: if(0 1 0);", 0, ""); +// // } + +// // /// Test the eval of if parsed from a string. Tests 3 inputs. The first input +// // /// is 0, the second input is 0, the third input is 1. +// // function testOpIfNPEval3InputsFirstZeroSecondZeroThirdOne() external { +// // checkHappy("_: if(0 0 1);", 1e18, ""); +// // } + +// // /// Test the eval of if parsed from a string. Tests 3 inputs. The first input +// // /// is 2, the second input is 3, the third input is 4. +// // function testOpIfNPEval3InputsFirstTwoSecondThreeThirdFour() external { +// // checkHappy("_: if(2 3 4);", 3e18, ""); +// // } + +// // /// Test the eval of if parsed from a string. Tests 3 inputs. The first input +// // /// is 2, the second input is 0, the third input is 4. +// // function testOpIfNPEval3InputsFirstTwoSecondZeroThirdFour() external { +// // checkHappy("_: if(2 0 4);", 0, ""); +// // } + +// // /// Test that empty strings are truthy values. +// // function testOpIfNPEvalEmptyStringTruthy() external { +// // checkHappy("_: if(\"\" 5 50);", 5e18, ""); +// // } + +// // /// Test that an if without inputs fails integrity check. +// // function testOpIfNPEvalFail0Inputs() public { +// // vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 0, 3, 0)); +// // bytes memory bytecode = iDeployer.parse2("_: if();"); +// // (bytecode); +// // } + +// // /// Test that an if with 1 input fails integrity check. +// // function testOpIfNPEvalFail1Input() public { +// // vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 1, 3, 1)); +// // bytes memory bytecode = iDeployer.parse2("_: if(0x00);"); +// // (bytecode); +// // } + +// // /// Test that an if with 2 inputs fails integrity check. +// // function testOpIfNPEvalFail2Inputs() public { +// // vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 2, 3, 2)); +// // bytes memory bytecode = iDeployer.parse2("_: if(0x00 0x00);"); +// // (bytecode); +// // } + +// // /// Test that an if with 4 inputs fails integrity check. +// // function testOpIfNPEvalFail4Inputs() public { +// // vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 4, 3, 4)); +// // bytes memory bytecode = iDeployer.parse2("_: if(0x00 0x00 0x00 0x00);"); +// // (bytecode); +// // } + +// // function testOpIfNPEvalZeroOutputs() external { +// // checkBadOutputs(": if(5 0 0);", 3, 1, 0); +// // } + +// // function testOpIfNPEvalTwoOutputs() external { +// // checkBadOutputs("_ _: if(5 0 0);", 3, 1, 2); +// // } +// // } diff --git a/test/src/lib/op/logic/LibOpIsZeroNP.t.sol b/test/src/lib/op/logic/LibOpIsZeroNP.t.sol index 1bb915501..8b79546b4 100644 --- a/test/src/lib/op/logic/LibOpIsZeroNP.t.sol +++ b/test/src/lib/op/logic/LibOpIsZeroNP.t.sol @@ -1,24 +1,24 @@ -// // SPDX-License-Identifier: CAL -// pragma solidity =0.8.25; +// // // 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 {IntegrityCheckStateNP, BadOpInputsLength} from "src/lib/integrity/LibIntegrityCheckNP.sol"; -// import {LibUint256Array} from "rain.solmem/lib/LibUint256Array.sol"; -// import {LibOpIsZeroNP} from "src/lib/op/logic/LibOpIsZeroNP.sol"; -// import {InterpreterStateNP} from "src/lib/state/LibInterpreterStateNP.sol"; -// import { -// IInterpreterV4, -// Operand, -// SourceIndexV2, -// FullyQualifiedNamespace -// } from "rain.interpreter.interface/interface/unstable/IInterpreterV4.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 {OpTest} from "test/abstract/OpTest.sol"; +// // import {LibContext} from "rain.interpreter.interface/lib/caller/LibContext.sol"; +// // import {IntegrityCheckStateNP, BadOpInputsLength} from "src/lib/integrity/LibIntegrityCheckNP.sol"; +// // import {LibUint256Array} from "rain.solmem/lib/LibUint256Array.sol"; +// // import {LibOpIsZeroNP} from "src/lib/op/logic/LibOpIsZeroNP.sol"; +// // import {InterpreterStateNP} from "src/lib/state/LibInterpreterStateNP.sol"; +// // import { +// // IInterpreterV4, +// // Operand, +// // SourceIndexV2, +// // FullyQualifiedNamespace +// // } from "rain.interpreter.interface/interface/unstable/IInterpreterV4.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 LibOpIsZeroNPTest is OpTest { -// using LibUint256Array for uint256[]; +// // contract LibOpIsZeroNPTest is OpTest { +// // using LibUint256Array for uint256[]; // /// Directly test the integrity logic of LibOpIsZeroNP. This tests the happy // /// path where the operand is valid. IsZero is a 1 input, 1 output op. @@ -27,19 +27,19 @@ // uint8 inputs, // uint8 outputs, // uint16 operandData -// ) external { +// ) external pure { // inputs = uint8(bound(inputs, 1, 0x0F)); // outputs = uint8(bound(outputs, 1, 0x0F)); // (uint256 calcInputs, uint256 calcOutputs) = // LibOpIsZeroNP.integrity(state, LibOperand.build(inputs, outputs, operandData)); -// // The inputs from the operand are ignored. The op is always 1 input. -// assertEq(calcInputs, 1); -// assertEq(calcOutputs, 1); -// } +// // // The inputs from the operand are ignored. The op is always 1 input. +// // assertEq(calcInputs, 1); +// // assertEq(calcOutputs, 1); +// // } // /// Directly test the runtime logic of LibOpIsZeroNP. -// function testOpIsZeroNPRun(uint256 input) external { +// function testOpIsZeroNPRun(uint256 input) external view { // InterpreterStateNP memory state = opTestDefaultInterpreterState(); // uint256[] memory inputs = new uint256[](1); // inputs[0] = input; @@ -47,35 +47,35 @@ // opReferenceCheck(state, operand, LibOpIsZeroNP.referenceFn, LibOpIsZeroNP.integrity, LibOpIsZeroNP.run, inputs); // } -// /// Test the eval of isZero opcode parsed from a string. Tests 1 nonzero input. -// function testOpIsZeroNPEval1NonZeroInput() external { -// checkHappy("_: is-zero(30);", 0, ""); -// } +// // /// Test the eval of isZero opcode parsed from a string. Tests 1 nonzero input. +// // function testOpIsZeroNPEval1NonZeroInput() external { +// // checkHappy("_: is-zero(30);", 0, ""); +// // } -// /// Test the eval of isZero opcode parsed from a string. Tests 1 zero input. -// function testOpIsZeroNPEval1ZeroInput() external { -// checkHappy("_: is-zero(0);", 1, ""); -// } +// // /// Test the eval of isZero opcode parsed from a string. Tests 1 zero input. +// // function testOpIsZeroNPEval1ZeroInput() external { +// // checkHappy("_: is-zero(0);", 1, ""); +// // } -// /// Test that an iszero without inputs fails integrity check. -// function testOpIsZeroNPEvalFail0Inputs() public { -// vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 0, 1, 0)); -// bytes memory bytecode = iDeployer.parse2("_: is-zero();"); -// (bytecode); -// } +// // /// Test that an iszero without inputs fails integrity check. +// // function testOpIsZeroNPEvalFail0Inputs() public { +// // vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 0, 1, 0)); +// // bytes memory bytecode = iDeployer.parse2("_: is-zero();"); +// // (bytecode); +// // } -// /// Test that an iszero with 2 inputs fails integrity check. -// function testOpIsZeroNPEvalFail2Inputs() public { -// vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 2, 1, 2)); -// bytes memory bytecode = iDeployer.parse2("_: is-zero(0x00 0x00);"); -// (bytecode); -// } +// // /// Test that an iszero with 2 inputs fails integrity check. +// // function testOpIsZeroNPEvalFail2Inputs() public { +// // vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 2, 1, 2)); +// // bytes memory bytecode = iDeployer.parse2("_: is-zero(0x00 0x00);"); +// // (bytecode); +// // } -// function testOpIsZeroNPZeroOutputs() external { -// checkBadOutputs(": is-zero(0);", 1, 1, 0); -// } +// // function testOpIsZeroNPZeroOutputs() external { +// // checkBadOutputs(": is-zero(0);", 1, 1, 0); +// // } -// function testOpIsZeroNPTwoOutputs() external { -// checkBadOutputs("_ _: is-zero(30);", 1, 1, 2); -// } -// } +// // function testOpIsZeroNPTwoOutputs() external { +// // checkBadOutputs("_ _: is-zero(30);", 1, 1, 2); +// // } +// // } diff --git a/test/src/lib/op/logic/LibOpLessThanNP.t.sol b/test/src/lib/op/logic/LibOpLessThanNP.t.sol index 3665e8b37..777413995 100644 --- a/test/src/lib/op/logic/LibOpLessThanNP.t.sol +++ b/test/src/lib/op/logic/LibOpLessThanNP.t.sol @@ -1,21 +1,21 @@ -// // 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 {LibOpLessThanNP} from "src/lib/op/logic/LibOpLessThanNP.sol"; -// import { -// IInterpreterV4, -// Operand, -// SourceIndexV2, -// FullyQualifiedNamespace, -// IInterpreterStoreV2, -// EvalV4 -// } from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; -// import {SignedContextV1} from "rain.interpreter.interface/interface/IInterpreterCallerV3.sol"; -// import {InterpreterStateNP} from "src/lib/state/LibInterpreterStateNP.sol"; -// import {IntegrityCheckStateNP, BadOpInputsLength} from "src/lib/integrity/LibIntegrityCheckNP.sol"; -// import {LibOperand} from "test/lib/operand/LibOperand.sol"; +// // // 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 {LibOpLessThanNP} from "src/lib/op/logic/LibOpLessThanNP.sol"; +// // import { +// // IInterpreterV4, +// // Operand, +// // SourceIndexV2, +// // FullyQualifiedNamespace, +// // IInterpreterStoreV2, +// // EvalV4 +// // } from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; +// // import {SignedContextV1} from "rain.interpreter.interface/interface/IInterpreterCallerV3.sol"; +// // import {InterpreterStateNP} from "src/lib/state/LibInterpreterStateNP.sol"; +// // import {IntegrityCheckStateNP, BadOpInputsLength} from "src/lib/integrity/LibIntegrityCheckNP.sol"; +// // import {LibOperand} from "test/lib/operand/LibOperand.sol"; // contract LibOpLessThanNPTest is OpTest { // /// Directly test the integrity logic of LibOpLessThanNP. No matter the @@ -26,19 +26,19 @@ // uint8 inputs, // uint8 outputs, // uint16 operandData -// ) external { +// ) external pure { // inputs = uint8(bound(inputs, 0, 0x0F)); // outputs = uint8(bound(outputs, 0, 0x0F)); // (uint256 calcInputs, uint256 calcOutputs) = // LibOpLessThanNP.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); -// } +// // // 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 LibOpLessThanNP. -// function testOpLessThanNPRun(uint256 input1, uint256 input2) external { +// function testOpLessThanNPRun(uint256 input1, uint256 input2) external view { // InterpreterStateNP memory state = opTestDefaultInterpreterState(); // uint256[] memory inputs = new uint256[](2); // inputs[0] = input1; @@ -51,7 +51,7 @@ // /// Test the eval of less than opcode parsed from a string. Tests 2 inputs. // /// Both inputs are 0. -// function testOpLessThanNPEval2ZeroInputs() external { +// function testOpLessThanNPEval2ZeroInputs() external view { // bytes memory bytecode = iDeployer.parse2("_: less-than(0 0);"); // (uint256[] memory stack, uint256[] memory kvs) = iInterpreter.eval4( // EvalV4({ @@ -65,14 +65,14 @@ // }) // ); -// assertEq(stack.length, 1); -// assertEq(stack[0], 0); -// assertEq(kvs.length, 0); -// } +// // assertEq(stack.length, 1); +// // assertEq(stack[0], 0); +// // assertEq(kvs.length, 0); +// // } // /// Test the eval of less than opcode parsed from a string. Tests 2 inputs. // /// The first input is 0, the second input is 1. -// function testOpLessThanNPEval2InputsFirstZeroSecondOne() external { +// function testOpLessThanNPEval2InputsFirstZeroSecondOne() external view { // bytes memory bytecode = iDeployer.parse2("_: less-than(0 1);"); // (uint256[] memory stack, uint256[] memory kvs) = iInterpreter.eval4( // EvalV4({ @@ -86,14 +86,14 @@ // }) // ); -// assertEq(stack.length, 1); -// assertEq(stack[0], 1); -// assertEq(kvs.length, 0); -// } +// // assertEq(stack.length, 1); +// // assertEq(stack[0], 1); +// // assertEq(kvs.length, 0); +// // } // /// Test the eval of less than opcode parsed from a string. Tests 2 inputs. // /// The first input is 1, the second input is 0. -// function testOpLessThanNPEval2InputsFirstOneSecondZero() external { +// function testOpLessThanNPEval2InputsFirstOneSecondZero() external view { // bytes memory bytecode = iDeployer.parse2("_: less-than(1 0);"); // (uint256[] memory stack, uint256[] memory kvs) = iInterpreter.eval4( // EvalV4({ @@ -107,14 +107,14 @@ // }) // ); -// assertEq(stack.length, 1); -// assertEq(stack[0], 0); -// assertEq(kvs.length, 0); -// } +// // assertEq(stack.length, 1); +// // assertEq(stack[0], 0); +// // assertEq(kvs.length, 0); +// // } // /// Test the eval of less than opcode parsed from a string. Tests 2 inputs. // /// Both inputs are 1. -// function testOpLessThanNPEval2InputsBothOne() external { +// function testOpLessThanNPEval2InputsBothOne() external view { // bytes memory bytecode = iDeployer.parse2("_: less-than(1 1);"); // (uint256[] memory stack, uint256[] memory kvs) = iInterpreter.eval4( // EvalV4({ @@ -128,37 +128,37 @@ // }) // ); -// assertEq(stack.length, 1); -// assertEq(stack[0], 0); -// assertEq(kvs.length, 0); -// } - -// /// Test that a less than to without inputs fails integrity check. -// function testOpLessThanToNPEvalFail0Inputs() public { -// vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 0, 2, 0)); -// bytes memory bytecode = iDeployer.parse2("_: less-than();"); -// (bytecode); -// } - -// /// Test that a less than to with 1 input fails integrity check. -// function testOpLessThanToNPEvalFail1Input() public { -// vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 1, 2, 1)); -// bytes memory bytecode = iDeployer.parse2("_: less-than(0x00);"); -// (bytecode); -// } - -// /// Test that a less than to with 3 inputs fails integrity check. -// function testOpLessThanToNPEvalFail3Inputs() public { -// vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 3, 2, 3)); -// bytes memory bytecode = iDeployer.parse2("_: less-than(0x00 0x00 0x00);"); -// (bytecode); -// } - -// function testOpLessThanNPZeroOutputs() external { -// checkBadOutputs(": less-than(0 0);", 2, 1, 0); -// } - -// function testOpLessThanNPTwoOutputs() external { -// checkBadOutputs("_ _: less-than(30 0);", 2, 1, 2); -// } -// } +// // assertEq(stack.length, 1); +// // assertEq(stack[0], 0); +// // assertEq(kvs.length, 0); +// // } + +// // /// Test that a less than to without inputs fails integrity check. +// // function testOpLessThanToNPEvalFail0Inputs() public { +// // vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 0, 2, 0)); +// // bytes memory bytecode = iDeployer.parse2("_: less-than();"); +// // (bytecode); +// // } + +// // /// Test that a less than to with 1 input fails integrity check. +// // function testOpLessThanToNPEvalFail1Input() public { +// // vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 1, 2, 1)); +// // bytes memory bytecode = iDeployer.parse2("_: less-than(0x00);"); +// // (bytecode); +// // } + +// // /// Test that a less than to with 3 inputs fails integrity check. +// // function testOpLessThanToNPEvalFail3Inputs() public { +// // vm.expectRevert(abi.encodeWithSelector(BadOpInputsLength.selector, 3, 2, 3)); +// // bytes memory bytecode = iDeployer.parse2("_: less-than(0x00 0x00 0x00);"); +// // (bytecode); +// // } + +// // function testOpLessThanNPZeroOutputs() external { +// // checkBadOutputs(": less-than(0 0);", 2, 1, 0); +// // } + +// // function testOpLessThanNPTwoOutputs() external { +// // checkBadOutputs("_ _: less-than(30 0);", 2, 1, 2); +// // } +// // } diff --git a/test/src/lib/op/logic/LibOpLessThanOrEqualToNP.t.sol b/test/src/lib/op/logic/LibOpLessThanOrEqualToNP.t.sol index a60e18d83..71fac4afe 100644 --- a/test/src/lib/op/logic/LibOpLessThanOrEqualToNP.t.sol +++ b/test/src/lib/op/logic/LibOpLessThanOrEqualToNP.t.sol @@ -1,21 +1,21 @@ -// // 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 {IntegrityCheckStateNP, BadOpInputsLength} from "src/lib/integrity/LibIntegrityCheckNP.sol"; -// import { -// IInterpreterV4, -// Operand, -// SourceIndexV2, -// FullyQualifiedNamespace, -// EvalV4 -// } from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; -// import {InterpreterStateNP} from "src/lib/state/LibInterpreterStateNP.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"; +// // // 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 {IntegrityCheckStateNP, BadOpInputsLength} from "src/lib/integrity/LibIntegrityCheckNP.sol"; +// // import { +// // IInterpreterV4, +// // Operand, +// // SourceIndexV2, +// // FullyQualifiedNamespace, +// // EvalV4 +// // } from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; +// // import {InterpreterStateNP} from "src/lib/state/LibInterpreterStateNP.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 @@ -26,19 +26,19 @@ // uint8 inputs, // uint8 outputs, // uint16 operandData -// ) external { +// ) 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); -// } +// // // 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 { +// function testOpLessThanOrEqualToNPRun(uint256 input1, uint256 input2) external view { // InterpreterStateNP memory state = opTestDefaultInterpreterState(); // uint256[] memory inputs = new uint256[](2); // inputs[0] = input1; @@ -56,7 +56,7 @@ // /// Test the eval of greater than or equal to opcode parsed from a string. // /// Tests 2 inputs. Both inputs are 0. -// function testOpLessThanOrEqualToNPEval2ZeroInputs() external { +// 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({ @@ -70,14 +70,14 @@ // }) // ); -// assertEq(stack.length, 1); -// assertEq(stack[0], 1); -// assertEq(kvs.length, 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 { +// 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({ @@ -91,14 +91,14 @@ // }) // ); -// assertEq(stack.length, 1); -// assertEq(stack[0], 1); -// assertEq(kvs.length, 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 { +// 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({ @@ -112,14 +112,14 @@ // }) // ); -// assertEq(stack.length, 1); -// assertEq(stack[0], 0); -// assertEq(kvs.length, 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 { +// 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({ @@ -133,38 +133,38 @@ // }) // ); -// 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); -// } -// } +// // 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); +// // } +// // } diff --git a/test/src/lib/op/math/LibOpAvg.t.sol b/test/src/lib/op/math/LibOpAvg.t.sol index 8e66b124a..b1e07f65e 100644 --- a/test/src/lib/op/math/LibOpAvg.t.sol +++ b/test/src/lib/op/math/LibOpAvg.t.sol @@ -8,14 +8,14 @@ // contract LibOpAvgTest is OpTest { // /// Directly test the integrity logic of LibOpAvg. // /// Inputs are always 2, outputs are always 1. -// function testOpAvgIntegrity(IntegrityCheckStateNP memory state, Operand operand) external { +// function testOpAvgIntegrity(IntegrityCheckStateNP memory state, Operand operand) external pure { // (uint256 calcInputs, uint256 calcOutputs) = LibOpAvg.integrity(state, operand); // assertEq(calcInputs, 2); // assertEq(calcOutputs, 1); // } // /// Directly test the runtime logic of LibOpAvg. -// function testOpAvgRun(uint256 a, uint256 b, uint16 operandData) public { +// function testOpAvgRun(uint256 a, uint256 b, uint16 operandData) public view { // // @TODO This is a hack to get around the fact that we are very likely // // to overflow uint256 if we just fuzz it, and that it's clunky to // // determine whether it will overflow or not. Basically the overflow @@ -34,18 +34,18 @@ // opReferenceCheck(state, operand, LibOpAvg.referenceFn, LibOpAvg.integrity, LibOpAvg.run, inputs); // } -// /// Test the eval of `avg`. -// function testOpAvgEval() external { -// checkHappy("_: avg(0 0);", 0, "0 0"); -// checkHappy("_: avg(0 1);", 5e17, "0 1"); -// checkHappy("_: avg(1 0);", 5e17, "1 0"); -// checkHappy("_: avg(1 1);", 1e18, "1 1"); -// checkHappy("_: avg(1 2);", 1.5e18, "1 2"); -// checkHappy("_: avg(2 2);", 2e18, "2 2"); -// checkHappy("_: avg(2 3);", 2.5e18, "2 3"); -// checkHappy("_: avg(2 4);", 3e18, "2 4"); -// checkHappy("_: avg(4 0.5);", 2.25e18, "4 5"); -// } +// /// Test the eval of `avg`. +// function testOpAvgEval() external view { +// checkHappy("_: avg(0 0);", 0, "0 0"); +// checkHappy("_: avg(0 1);", 5e17, "0 1"); +// checkHappy("_: avg(1 0);", 5e17, "1 0"); +// checkHappy("_: avg(1 1);", 1e18, "1 1"); +// checkHappy("_: avg(1 2);", 1.5e18, "1 2"); +// checkHappy("_: avg(2 2);", 2e18, "2 2"); +// checkHappy("_: avg(2 3);", 2.5e18, "2 3"); +// checkHappy("_: avg(2 4);", 3e18, "2 4"); +// checkHappy("_: avg(4 0.5);", 2.25e18, "4 5"); +// } // /// Test the eval of `avg` for bad inputs. // function testOpAvgEvalOneInput() external { diff --git a/test/src/lib/op/math/LibOpCeil.t.sol b/test/src/lib/op/math/LibOpCeil.t.sol index dffbf0f4b..c51a28504 100644 --- a/test/src/lib/op/math/LibOpCeil.t.sol +++ b/test/src/lib/op/math/LibOpCeil.t.sol @@ -8,14 +8,14 @@ // contract LibOpCeilTest is OpTest { // /// Directly test the integrity logic of LibOpCeil. // /// Inputs are always 1, outputs are always 1. -// function testOpCeilIntegrity(IntegrityCheckStateNP memory state, Operand operand) external { +// function testOpCeilIntegrity(IntegrityCheckStateNP memory state, Operand operand) external pure { // (uint256 calcInputs, uint256 calcOutputs) = LibOpCeil.integrity(state, operand); // assertEq(calcInputs, 1); // assertEq(calcOutputs, 1); // } // /// Directly test the runtime logic of LibOpCeil. -// function testOpCeilRun(uint256 a, uint16 operandData) public { +// function testOpCeilRun(uint256 a, uint16 operandData) public view { // a = bound(a, 0, type(uint64).max - 1e18); // InterpreterStateNP memory state = opTestDefaultInterpreterState(); @@ -26,14 +26,14 @@ // opReferenceCheck(state, operand, LibOpCeil.referenceFn, LibOpCeil.integrity, LibOpCeil.run, inputs); // } -// /// Test the eval of `ceil`. -// function testOpCeilEval() external { -// checkHappy("_: ceil(0);", 0, "0"); -// checkHappy("_: ceil(1);", 1e18, "1"); -// checkHappy("_: ceil(0.5);", 1e18, "0.5"); -// checkHappy("_: ceil(2);", 2e18, "2"); -// checkHappy("_: ceil(2.5);", 3e18, "2.5"); -// } +// /// Test the eval of `ceil`. +// function testOpCeilEval() external view { +// checkHappy("_: ceil(0);", 0, "0"); +// checkHappy("_: ceil(1);", 1e18, "1"); +// checkHappy("_: ceil(0.5);", 1e18, "0.5"); +// checkHappy("_: ceil(2);", 2e18, "2"); +// checkHappy("_: ceil(2.5);", 3e18, "2.5"); +// } // /// Test the eval of `ceil` for bad inputs. // function testOpCeilZeroInputs() external { diff --git a/test/src/lib/op/math/LibOpDiv.t.sol b/test/src/lib/op/math/LibOpDiv.t.sol index 365fb7b4d..d5df139bb 100644 --- a/test/src/lib/op/math/LibOpDiv.t.sol +++ b/test/src/lib/op/math/LibOpDiv.t.sol @@ -13,7 +13,10 @@ // contract LibOpDivTest is OpTest { // /// Directly test the integrity logic of LibOpDiv. This tests the // /// happy path where the inputs input and calc match. -// function testOpDivIntegrityHappy(IntegrityCheckStateNP memory state, uint8 inputs, uint16 operandData) external { +// function testOpDivIntegrityHappy(IntegrityCheckStateNP memory state, uint8 inputs, uint16 operandData) +// external +// pure +// { // inputs = uint8(bound(inputs, 2, 0x0F)); // (uint256 calcInputs, uint256 calcOutputs) = LibOpDiv.integrity(state, LibOperand.build(inputs, 1, operandData)); @@ -21,23 +24,23 @@ // assertEq(calcOutputs, 1); // } -// /// Directly test the integrity logic of LibOpDiv. This tests the -// /// unhappy path where the operand is invalid due to 0 inputs. -// function testOpDivIntegrityUnhappyZeroInputs(IntegrityCheckStateNP memory state) external { -// (uint256 calcInputs, uint256 calcOutputs) = LibOpDiv.integrity(state, Operand.wrap(0)); -// // Calc inputs will be minimum 2. -// assertEq(calcInputs, 2); -// assertEq(calcOutputs, 1); -// } +// /// Directly test the integrity logic of LibOpDiv. This tests the +// /// unhappy path where the operand is invalid due to 0 inputs. +// function testOpDivIntegrityUnhappyZeroInputs(IntegrityCheckStateNP memory state) external pure { +// (uint256 calcInputs, uint256 calcOutputs) = LibOpDiv.integrity(state, Operand.wrap(0)); +// // Calc inputs will be minimum 2. +// assertEq(calcInputs, 2); +// assertEq(calcOutputs, 1); +// } -// /// Directly test the integrity logic of LibOpDiv. This tests the -// /// unhappy path where the operand is invalid due to 1 inputs. -// function testOpDivIntegrityUnhappyOneInput(IntegrityCheckStateNP memory state) external { -// (uint256 calcInputs, uint256 calcOutputs) = LibOpDiv.integrity(state, Operand.wrap(0x110000)); -// // Calc inputs will be minimum 2. -// assertEq(calcInputs, 2); -// assertEq(calcOutputs, 1); -// } +// /// Directly test the integrity logic of LibOpDiv. This tests the +// /// unhappy path where the operand is invalid due to 1 inputs. +// function testOpDivIntegrityUnhappyOneInput(IntegrityCheckStateNP memory state) external pure { +// (uint256 calcInputs, uint256 calcOutputs) = LibOpDiv.integrity(state, Operand.wrap(0x110000)); +// // Calc inputs will be minimum 2. +// assertEq(calcInputs, 2); +// assertEq(calcOutputs, 1); +// } // /// Directly test the runtime logic of LibOpDiv. // function testOpDivRun(uint256[] memory inputs) public { @@ -101,20 +104,20 @@ // checkBadInputs("_: div(max-value());", 1, 2, 1); // } -// /// Test the eval of `div` opcode parsed from a string. -// /// Tests two inputs. -// /// Tests the happy path where we do not divide by zero or overflow. -// function testOpDivEvalTwoInputsHappy() external { -// checkHappy("_: div(0 1);", 0, "0 1"); -// checkHappy("_: div(1 1);", 1e18, "1 1"); -// checkHappy("_: div(1 2);", 5e17, "1 2"); -// checkHappy("_: div(2 1);", 2e18, "2 1"); -// checkHappy("_: div(2 2);", 1e18, "2 2"); -// checkHappy("_: div(2 0.1);", 2e19, "2 0.1"); -// // This one is interesting because it overflows internally before -// // reaching a final result. -// checkHappy("_: div(max-value() 1);", type(uint256).max, "max-value() 1"); -// } +// /// Test the eval of `div` opcode parsed from a string. +// /// Tests two inputs. +// /// Tests the happy path where we do not divide by zero or overflow. +// function testOpDivEvalTwoInputsHappy() external view { +// checkHappy("_: div(0 1);", 0, "0 1"); +// checkHappy("_: div(1 1);", 1e18, "1 1"); +// checkHappy("_: div(1 2);", 5e17, "1 2"); +// checkHappy("_: div(2 1);", 2e18, "2 1"); +// checkHappy("_: div(2 2);", 1e18, "2 2"); +// checkHappy("_: div(2 0.1);", 2e19, "2 0.1"); +// // This one is interesting because it overflows internally before +// // reaching a final result. +// checkHappy("_: div(max-value() 1);", type(uint256).max, "max-value() 1"); +// } // /// Test the eval of `div` opcode parsed from a string. // /// Tests two inputs. @@ -139,20 +142,20 @@ // checkUnhappy("_: div(1e52 1e-8);", abi.encodeWithSelector(PRBMath_MulDiv_Overflow.selector, 1e70, 1e18, 1e10)); // } -// /// Test the eval of `div` opcode parsed from a string. -// /// Tests three inputs. -// /// Tests the happy path where we do not divide by zero or overflow. -// function testOpDivEvalThreeInputsHappy() external { -// checkHappy("_: div(0 1 1);", 0, "0 1 1"); -// checkHappy("_: div(1 1 1);", 1e18, "1 1 1"); -// checkHappy("_: div(1 1 2);", 5e17, "1 1 2"); -// checkHappy("_: div(1 2 1);", 5e17, "1 2 1"); -// checkHappy("_: div(1 2 2);", 25e16, "1 2 2"); -// checkHappy("_: div(1 2 0.1);", 5e18, "1 2 0.1"); -// // This one is interesting because it overflows internally before -// // reaching a final result. -// checkHappy("_: div(max-value() 1 1);", type(uint256).max, "max-value() 1 1"); -// } +// /// Test the eval of `div` opcode parsed from a string. +// /// Tests three inputs. +// /// Tests the happy path where we do not divide by zero or overflow. +// function testOpDivEvalThreeInputsHappy() external view { +// checkHappy("_: div(0 1 1);", 0, "0 1 1"); +// checkHappy("_: div(1 1 1);", 1e18, "1 1 1"); +// checkHappy("_: div(1 1 2);", 5e17, "1 1 2"); +// checkHappy("_: div(1 2 1);", 5e17, "1 2 1"); +// checkHappy("_: div(1 2 2);", 25e16, "1 2 2"); +// checkHappy("_: div(1 2 0.1);", 5e18, "1 2 0.1"); +// // This one is interesting because it overflows internally before +// // reaching a final result. +// checkHappy("_: div(max-value() 1 1);", type(uint256).max, "max-value() 1 1"); +// } // /// Test the eval of `div` opcode parsed from a string. // /// Tests three inputs. diff --git a/test/src/lib/op/math/LibOpE.t.sol b/test/src/lib/op/math/LibOpE.t.sol index bc88cd1e5..500235874 100644 --- a/test/src/lib/op/math/LibOpE.t.sol +++ b/test/src/lib/op/math/LibOpE.t.sol @@ -19,6 +19,7 @@ // /// Directly test the integrity logic of LibOpE. // function testOpEIntegrity(IntegrityCheckStateNP memory state, uint8 inputs, uint8 outputs, uint16 operandData) // external +// pure // { // inputs = uint8(bound(inputs, 0, 0x0F)); // outputs = uint8(bound(outputs, 0, 0x0F)); @@ -29,18 +30,18 @@ // assertEq(calcOutputs, 1); // } -// /// Directly test the runtime logic of LibOpE. This tests that the -// /// opcode correctly pushes the mathematical constant e onto the stack. -// function testOpERun(uint16 operandData) external { -// InterpreterStateNP memory state = opTestDefaultInterpreterState(); -// Operand operand = LibOperand.build(0, 1, operandData); -// uint256[] memory inputs = new uint256[](0); -// opReferenceCheck(state, operand, LibOpE.referenceFn, LibOpE.integrity, LibOpE.run, inputs); -// } +// /// Directly test the runtime logic of LibOpE. This tests that the +// /// opcode correctly pushes the mathematical constant e onto the stack. +// function testOpERun(uint16 operandData) external view { +// InterpreterStateNP memory state = opTestDefaultInterpreterState(); +// Operand operand = LibOperand.build(0, 1, operandData); +// uint256[] memory inputs = new uint256[](0); +// opReferenceCheck(state, operand, LibOpE.referenceFn, LibOpE.integrity, LibOpE.run, inputs); +// } -// /// Test the eval of a mathematical constant e opcode parsed from a string. -// function testOpEEval() external { -// bytes memory bytecode = iDeployer.parse2("_: e();"); +// /// Test the eval of a mathematical constant e opcode parsed from a string. +// function testOpEEval() external view { +// bytes memory bytecode = iDeployer.parse2("_: e();"); // (uint256[] memory stack, uint256[] memory kvs) = iInterpreter.eval4( // EvalV4({ diff --git a/test/src/lib/op/math/LibOpExp.t.sol b/test/src/lib/op/math/LibOpExp.t.sol index 0a2bdcc14..2d34024ba 100644 --- a/test/src/lib/op/math/LibOpExp.t.sol +++ b/test/src/lib/op/math/LibOpExp.t.sol @@ -8,14 +8,14 @@ // contract LibOpExpTest is OpTest { // /// Directly test the integrity logic of LibOpExp. // /// Inputs are always 1, outputs are always 1. -// function testOpExpIntegrity(IntegrityCheckStateNP memory state, Operand operand) external { +// function testOpExpIntegrity(IntegrityCheckStateNP memory state, Operand operand) external pure { // (uint256 calcInputs, uint256 calcOutputs) = LibOpExp.integrity(state, operand); // assertEq(calcInputs, 1); // assertEq(calcOutputs, 1); // } // /// Directly test the runtime logic of LibOpExp. -// function testOpExpRun(uint256 a, uint16 operandData) public { +// function testOpExpRun(uint256 a, uint16 operandData) public view { // a = bound(a, 0, type(uint64).max - 1e18); // InterpreterStateNP memory state = opTestDefaultInterpreterState(); @@ -26,14 +26,14 @@ // opReferenceCheck(state, operand, LibOpExp.referenceFn, LibOpExp.integrity, LibOpExp.run, inputs); // } -// /// Test the eval of `exp`. -// function testOpExpEval() external { -// checkHappy("_: exp(0);", 1e18, "e^0"); -// checkHappy("_: exp(1);", 2718281828459045234, "e^1"); -// checkHappy("_: exp(0.5);", 1648721270700128145, "e^0.5"); -// checkHappy("_: exp(2);", 7389056098930650223, "e^2"); -// checkHappy("_: exp(3);", 20085536923187667724, "e^3"); -// } +// /// Test the eval of `exp`. +// function testOpExpEval() external view { +// checkHappy("_: exp(0);", 1e18, "e^0"); +// checkHappy("_: exp(1);", 2718281828459045234, "e^1"); +// checkHappy("_: exp(0.5);", 1648721270700128145, "e^0.5"); +// checkHappy("_: exp(2);", 7389056098930650223, "e^2"); +// checkHappy("_: exp(3);", 20085536923187667724, "e^3"); +// } // /// Test the eval of `exp` for bad inputs. // function testOpExpEvalZeroInputs() external { diff --git a/test/src/lib/op/math/LibOpExp2.t.sol b/test/src/lib/op/math/LibOpExp2.t.sol index 970eda700..71db01838 100644 --- a/test/src/lib/op/math/LibOpExp2.t.sol +++ b/test/src/lib/op/math/LibOpExp2.t.sol @@ -8,14 +8,14 @@ // contract LibOpExp2Test is OpTest { // /// Directly test the integrity logic of LibOpExp2. // /// Inputs are always 1, outputs are always 1. -// function testOpExp2Integrity(IntegrityCheckStateNP memory state, Operand operand) external { +// function testOpExp2Integrity(IntegrityCheckStateNP memory state, Operand operand) external pure { // (uint256 calcInputs, uint256 calcOutputs) = LibOpExp2.integrity(state, operand); // assertEq(calcInputs, 1); // assertEq(calcOutputs, 1); // } // /// Directly test the runtime logic of LibOpExp2. -// function testOpExp2Run(uint256 a, uint16 operandData) public { +// function testOpExp2Run(uint256 a, uint16 operandData) public view { // a = bound(a, 0, type(uint64).max - 1e18); // InterpreterStateNP memory state = opTestDefaultInterpreterState(); @@ -26,14 +26,14 @@ // opReferenceCheck(state, operand, LibOpExp2.referenceFn, LibOpExp2.integrity, LibOpExp2.run, inputs); // } -// /// Test the eval of `exp2`. -// function testOpExp2Eval() external { -// checkHappy("_: exp2(0);", 1e18, "2^0"); -// checkHappy("_: exp2(1);", 2e18, "2^1"); -// checkHappy("_: exp2(0.5);", 1414213562373095048, "2^0.5"); -// checkHappy("_: exp2(2);", 4e18, "2^2"); -// checkHappy("_: exp2(3);", 8e18, "2^3"); -// } +// /// Test the eval of `exp2`. +// function testOpExp2Eval() external view { +// checkHappy("_: exp2(0);", 1e18, "2^0"); +// checkHappy("_: exp2(1);", 2e18, "2^1"); +// checkHappy("_: exp2(0.5);", 1414213562373095048, "2^0.5"); +// checkHappy("_: exp2(2);", 4e18, "2^2"); +// checkHappy("_: exp2(3);", 8e18, "2^3"); +// } // /// Test the eval of `exp2` for bad inputs. // function testOpExp2EvalBad() external { diff --git a/test/src/lib/op/math/LibOpFloor.t.sol b/test/src/lib/op/math/LibOpFloor.t.sol index 21ae9b889..f0c0f194b 100644 --- a/test/src/lib/op/math/LibOpFloor.t.sol +++ b/test/src/lib/op/math/LibOpFloor.t.sol @@ -8,14 +8,14 @@ // contract LibOpFloorTest is OpTest { // /// Directly test the integrity logic of LibOpFloor. // /// Inputs are always 1, outputs are always 1. -// function testOpFloorIntegrity(IntegrityCheckStateNP memory state, Operand operand) external { +// function testOpFloorIntegrity(IntegrityCheckStateNP memory state, Operand operand) external pure { // (uint256 calcInputs, uint256 calcOutputs) = LibOpFloor.integrity(state, operand); // assertEq(calcInputs, 1); // assertEq(calcOutputs, 1); // } // /// Directly test the runtime logic of LibOpFloor. -// function testOpFloorRun(uint256 a, uint16 operandData) public { +// function testOpFloorRun(uint256 a, uint16 operandData) public view { // a = bound(a, 0, type(uint64).max - 1e18); // InterpreterStateNP memory state = opTestDefaultInterpreterState(); @@ -26,15 +26,15 @@ // opReferenceCheck(state, operand, LibOpFloor.referenceFn, LibOpFloor.integrity, LibOpFloor.run, inputs); // } -// /// Test the eval of `floor`. -// function testOpFloorEval() external { -// checkHappy("_: floor(0);", 0, "0"); -// checkHappy("_: floor(1);", 1e18, "1"); -// checkHappy("_: floor(0.5);", 0, "0.5"); -// checkHappy("_: floor(2);", 2e18, "2"); -// checkHappy("_: floor(3);", 3e18, "3"); -// checkHappy("_: floor(3.8);", 3e18, "3.8"); -// } +// /// Test the eval of `floor`. +// function testOpFloorEval() external view { +// checkHappy("_: floor(0);", 0, "0"); +// checkHappy("_: floor(1);", 1e18, "1"); +// checkHappy("_: floor(0.5);", 0, "0.5"); +// checkHappy("_: floor(2);", 2e18, "2"); +// checkHappy("_: floor(3);", 3e18, "3"); +// checkHappy("_: floor(3.8);", 3e18, "3.8"); +// } // /// Test the eval of `floor` for bad inputs. // function testOpFloorZeroInputs() external { diff --git a/test/src/lib/op/math/LibOpFrac.t.sol b/test/src/lib/op/math/LibOpFrac.t.sol index b45565f54..da5c3c606 100644 --- a/test/src/lib/op/math/LibOpFrac.t.sol +++ b/test/src/lib/op/math/LibOpFrac.t.sol @@ -8,14 +8,14 @@ // contract LibOpFracTest is OpTest { // /// Directly test the integrity logic of LibOpFrac. // /// Inputs are always 1, outputs are always 1. -// function testOpFracIntegrity(IntegrityCheckStateNP memory state, Operand operand) external { +// function testOpFracIntegrity(IntegrityCheckStateNP memory state, Operand operand) external pure { // (uint256 calcInputs, uint256 calcOutputs) = LibOpFrac.integrity(state, operand); // assertEq(calcInputs, 1); // assertEq(calcOutputs, 1); // } // /// Directly test the runtime logic of LibOpFrac. -// function testOpFracRun(uint256 a, uint16 operandData) public { +// function testOpFracRun(uint256 a, uint16 operandData) public view { // a = bound(a, 0, type(uint64).max - 1e18); // InterpreterStateNP memory state = opTestDefaultInterpreterState(); @@ -26,15 +26,15 @@ // opReferenceCheck(state, operand, LibOpFrac.referenceFn, LibOpFrac.integrity, LibOpFrac.run, inputs); // } -// /// Test the eval of `frac`. -// function testOpFracEval() external { -// checkHappy("_: frac(0);", 0, "0"); -// checkHappy("_: frac(1);", 0, "1"); -// checkHappy("_: frac(0.5);", 0.5e18, "0.5"); -// checkHappy("_: frac(2);", 0, "2"); -// checkHappy("_: frac(3);", 0, "3"); -// checkHappy("_: frac(3.8);", 0.8e18, "3.8"); -// } +// /// Test the eval of `frac`. +// function testOpFracEval() external view { +// checkHappy("_: frac(0);", 0, "0"); +// checkHappy("_: frac(1);", 0, "1"); +// checkHappy("_: frac(0.5);", 0.5e18, "0.5"); +// checkHappy("_: frac(2);", 0, "2"); +// checkHappy("_: frac(3);", 0, "3"); +// checkHappy("_: frac(3.8);", 0.8e18, "3.8"); +// } // /// Test the eval of `frac` for bad inputs. // function testOpFracZeroInputs() external { diff --git a/test/src/lib/op/math/LibOpGm.t.sol b/test/src/lib/op/math/LibOpGm.t.sol index 35c79ae80..48015621d 100644 --- a/test/src/lib/op/math/LibOpGm.t.sol +++ b/test/src/lib/op/math/LibOpGm.t.sol @@ -8,14 +8,14 @@ // contract LibOpGmTest is OpTest { // /// Directly test the integrity logic of LibOpGm. // /// Inputs are always 2, outputs are always 1. -// function testOpGmIntegrity(IntegrityCheckStateNP memory state, Operand operand) external { +// function testOpGmIntegrity(IntegrityCheckStateNP memory state, Operand operand) external pure { // (uint256 calcInputs, uint256 calcOutputs) = LibOpGm.integrity(state, operand); // assertEq(calcInputs, 2); // assertEq(calcOutputs, 1); // } // /// Directly test the runtime logic of LibOpGm. -// function testOpGmRun(uint256 a, uint256 b, uint16 operandData) public { +// function testOpGmRun(uint256 a, uint256 b, uint16 operandData) public view { // // @TODO This is a hack to get around the fact that we are very likely // // to overflow uint256 if we just fuzz it, and that it's clunky to // // determine whether it will overflow or not. Basically the overflow @@ -34,18 +34,18 @@ // opReferenceCheck(state, operand, LibOpGm.referenceFn, LibOpGm.integrity, LibOpGm.run, inputs); // } -// /// Test the eval of `gm`. -// function testOpGmEval() external { -// checkHappy("_: gm(0 0);", 0, "0 0"); -// checkHappy("_: gm(0 1);", 0, "0 1"); -// checkHappy("_: gm(1 0);", 0, "1 0"); -// checkHappy("_: gm(1 1);", 1e18, "1 1"); -// checkHappy("_: gm(1 2);", 1414213562373095048, "1 2"); -// checkHappy("_: gm(2 2);", 2e18, "2 2"); -// checkHappy("_: gm(2 3);", 2449489742783178098, "2 3"); -// checkHappy("_: gm(2 4);", 2828427124746190097, "2 4"); -// checkHappy("_: gm(4 0.5);", 1414213562373095048, "4 0.5"); -// } +// /// Test the eval of `gm`. +// function testOpGmEval() external view { +// checkHappy("_: gm(0 0);", 0, "0 0"); +// checkHappy("_: gm(0 1);", 0, "0 1"); +// checkHappy("_: gm(1 0);", 0, "1 0"); +// checkHappy("_: gm(1 1);", 1e18, "1 1"); +// checkHappy("_: gm(1 2);", 1414213562373095048, "1 2"); +// checkHappy("_: gm(2 2);", 2e18, "2 2"); +// checkHappy("_: gm(2 3);", 2449489742783178098, "2 3"); +// checkHappy("_: gm(2 4);", 2828427124746190097, "2 4"); +// checkHappy("_: gm(4 0.5);", 1414213562373095048, "4 0.5"); +// } // /// Test the eval of `gm` for bad inputs. // function testOpGmOneInput() external { diff --git a/test/src/lib/op/math/LibOpHeadroom.t.sol b/test/src/lib/op/math/LibOpHeadroom.t.sol index 57f0ccfc2..4077c10b7 100644 --- a/test/src/lib/op/math/LibOpHeadroom.t.sol +++ b/test/src/lib/op/math/LibOpHeadroom.t.sol @@ -8,14 +8,14 @@ // contract LibOpHeadroomTest is OpTest { // /// Directly test the integrity logic of LibOpHeadroom. // /// Inputs are always 1, outputs are always 1. -// function testOpHeadroomIntegrity(IntegrityCheckStateNP memory state, Operand operand) external { +// function testOpHeadroomIntegrity(IntegrityCheckStateNP memory state, Operand operand) external pure { // (uint256 calcInputs, uint256 calcOutputs) = LibOpHeadroom.integrity(state, operand); // assertEq(calcInputs, 1); // assertEq(calcOutputs, 1); // } // /// Directly test the runtime logic of LibOpHeadroom. -// function testOpHeadroomRun(uint256 a, uint16 operandData) public { +// function testOpHeadroomRun(uint256 a, uint16 operandData) public view { // a = bound(a, 0, type(uint64).max - 1e18); // InterpreterStateNP memory state = opTestDefaultInterpreterState(); @@ -26,15 +26,15 @@ // opReferenceCheck(state, operand, LibOpHeadroom.referenceFn, LibOpHeadroom.integrity, LibOpHeadroom.run, inputs); // } -// /// Test the eval of `headroom`. -// function testOpHeadroomEval() external { -// checkHappy("_: headroom(0);", 1e18, "0"); -// checkHappy("_: headroom(1);", 1e18, "1"); -// checkHappy("_: headroom(0.5);", 0.5e18, "0.5"); -// checkHappy("_: headroom(2);", 1e18, "2"); -// checkHappy("_: headroom(3);", 1e18, "3"); -// checkHappy("_: headroom(3.8);", 0.2e18, "3.8"); -// } +// /// Test the eval of `headroom`. +// function testOpHeadroomEval() external view { +// checkHappy("_: headroom(0);", 1e18, "0"); +// checkHappy("_: headroom(1);", 1e18, "1"); +// checkHappy("_: headroom(0.5);", 0.5e18, "0.5"); +// checkHappy("_: headroom(2);", 1e18, "2"); +// checkHappy("_: headroom(3);", 1e18, "3"); +// checkHappy("_: headroom(3.8);", 0.2e18, "3.8"); +// } // /// Test the eval of `headroom` for bad inputs. // function testOpHeadroomZeroInputs() external { diff --git a/test/src/lib/op/math/LibOpIntAddNP.t.sol b/test/src/lib/op/math/LibOpIntAddNP.t.sol index 4af6dbfe1..7aaa8f262 100644 --- a/test/src/lib/op/math/LibOpIntAddNP.t.sol +++ b/test/src/lib/op/math/LibOpIntAddNP.t.sol @@ -9,7 +9,10 @@ // contract LibOpAddTest is OpTest { // /// Directly test the integrity logic of LibOpAdd. This tests the happy // /// path where the inputs and calc match. -// function testOpAddIntegrityHappy(IntegrityCheckStateNP memory state, uint8 inputs, uint16 operandData) external { +// function testOpAddIntegrityHappy(IntegrityCheckStateNP memory state, uint8 inputs, uint16 operandData) +// external +// pure +// { // inputs = uint8(bound(inputs, 2, 0x0F)); // (uint256 calcInputs, uint256 calcOutputs) = LibOpAdd.integrity(state, LibOperand.build(inputs, 1, operandData)); @@ -17,23 +20,23 @@ // assertEq(calcOutputs, 1); // } -// /// Directly test the integrity logic of LibOpAdd. This tests the unhappy -// /// path where the operand is invalid due to 0 inputs. -// function testOpAddIntegrityUnhappyZeroInputs(IntegrityCheckStateNP memory state) external { -// (uint256 calcInputs, uint256 calcOutputs) = LibOpAdd.integrity(state, Operand.wrap(0)); -// // Calc inputs will be minimum 2. -// assertEq(calcInputs, 2); -// assertEq(calcOutputs, 1); -// } +// /// Directly test the integrity logic of LibOpAdd. This tests the unhappy +// /// path where the operand is invalid due to 0 inputs. +// function testOpAddIntegrityUnhappyZeroInputs(IntegrityCheckStateNP memory state) external pure { +// (uint256 calcInputs, uint256 calcOutputs) = LibOpAdd.integrity(state, Operand.wrap(0)); +// // Calc inputs will be minimum 2. +// assertEq(calcInputs, 2); +// assertEq(calcOutputs, 1); +// } -// /// Directly test the integrity logic of LibOpAdd. This tests the unhappy -// /// path where the operand is invalid due to 1 inputs. -// function testOpAddIntegrityUnhappyOneInput(IntegrityCheckStateNP memory state) external { -// (uint256 calcInputs, uint256 calcOutputs) = LibOpAdd.integrity(state, Operand.wrap(0x010000)); -// // Calc inputs will be minimum 2. -// assertEq(calcInputs, 2); -// assertEq(calcOutputs, 1); -// } +// /// Directly test the integrity logic of LibOpAdd. This tests the unhappy +// /// path where the operand is invalid due to 1 inputs. +// function testOpAddIntegrityUnhappyOneInput(IntegrityCheckStateNP memory state) external pure { +// (uint256 calcInputs, uint256 calcOutputs) = LibOpAdd.integrity(state, Operand.wrap(0x010000)); +// // Calc inputs will be minimum 2. +// assertEq(calcInputs, 2); +// assertEq(calcOutputs, 1); +// } // /// Directly test the runtime logic of LibOpAdd. // function testOpAddRun(uint256[] memory inputs) external { @@ -76,32 +79,32 @@ // checkBadOutputs("_ _: add(5e-18 6e-18);", 2, 1, 2); // } -// /// Test the eval of `add` opcode parsed from a string. Tests two inputs. -// /// Tests the happy path where the addition does not overflow. -// function testOpAddEval2InputsHappy() external { -// checkHappy("_: add(5e-18 6e-18);", 11, "5 + 6"); -// checkHappy("_: add(6e-18 5e-18);", 11, "6 + 5"); -// } +// /// Test the eval of `add` opcode parsed from a string. Tests two inputs. +// /// Tests the happy path where the addition does not overflow. +// function testOpAddEval2InputsHappy() external view { +// checkHappy("_: add(5e-18 6e-18);", 11, "5 + 6"); +// checkHappy("_: add(6e-18 5e-18);", 11, "6 + 5"); +// } -// /// Test the eval of `add` opcode parsed from a string. Tests two inputs. -// /// Tests that adding 0 to 0 is 0. -// function testOpAddEval2InputsHappyZero() external { -// checkHappy("_: add(0 0);", 0, "0 + 0"); -// } +// /// Test the eval of `add` opcode parsed from a string. Tests two inputs. +// /// Tests that adding 0 to 0 is 0. +// function testOpAddEval2InputsHappyZero() external view { +// checkHappy("_: add(0 0);", 0, "0 + 0"); +// } -// /// Test the eval of `add` opcode parsed from a string. Tests two inputs. -// /// Tests that adding 0 to 1 is 1. -// function testOpAddEval2InputsHappyZeroOne() external { -// checkHappy("_: add(0 1e-18);", 1, "0 + 1"); -// checkHappy("_: add(1e-18 0);", 1, "1 + 0"); -// } +// /// Test the eval of `add` opcode parsed from a string. Tests two inputs. +// /// Tests that adding 0 to 1 is 1. +// function testOpAddEval2InputsHappyZeroOne() external view { +// checkHappy("_: add(0 1e-18);", 1, "0 + 1"); +// checkHappy("_: add(1e-18 0);", 1, "1 + 0"); +// } -// /// Test the eval of `add` opcode parsed from a string. Tests two inputs. -// /// Tests that adding 0 to max-value() is max-value(). -// function testOpAddEval2InputsHappyZeroMax() external { -// checkHappy("_: add(0 max-value());", type(uint256).max, "0 + max-value()"); -// checkHappy("_: add(max-value() 0);", type(uint256).max, "max-value() + 0"); -// } +// /// Test the eval of `add` opcode parsed from a string. Tests two inputs. +// /// Tests that adding 0 to max-value() is max-value(). +// function testOpAddEval2InputsHappyZeroMax() external view { +// checkHappy("_: add(0 max-value());", type(uint256).max, "0 + max-value()"); +// checkHappy("_: add(max-value() 0);", type(uint256).max, "max-value() + 0"); +// } // /// Test the eval of `add` opcode parsed from a string. Tests two inputs. // /// Tests the unhappy path where the addition does overflow. @@ -110,16 +113,16 @@ // checkUnhappyOverflow("_: add(1e-18 max-value());"); // } -// /// Test the eval of `add` opcode parsed from a string. Tests three inputs. -// /// Tests the happy path where the addition does not overflow. -// function testOpAddEval3InputsHappy() external { -// checkHappy("_: add(5e-18 6e-18 7e-18);", 18, "5 + 6 + 7"); -// checkHappy("_: add(6e-18 5e-18 7e-18);", 18, "6 + 5 + 7"); -// checkHappy("_: add(7e-18 6e-18 5e-18);", 18, "7 + 6 + 5"); -// checkHappy("_: add(5e-18 7e-18 6e-18);", 18, "5 + 7 + 6"); -// checkHappy("_: add(6e-18 7e-18 5e-18);", 18, "6 + 7 + 5"); -// checkHappy("_: add(7e-18 5e-18 6e-18);", 18, "7 + 5 + 6"); -// } +// /// Test the eval of `add` opcode parsed from a string. Tests three inputs. +// /// Tests the happy path where the addition does not overflow. +// function testOpAddEval3InputsHappy() external view { +// checkHappy("_: add(5e-18 6e-18 7e-18);", 18, "5 + 6 + 7"); +// checkHappy("_: add(6e-18 5e-18 7e-18);", 18, "6 + 5 + 7"); +// checkHappy("_: add(7e-18 6e-18 5e-18);", 18, "7 + 6 + 5"); +// checkHappy("_: add(5e-18 7e-18 6e-18);", 18, "5 + 7 + 6"); +// checkHappy("_: add(6e-18 7e-18 5e-18);", 18, "6 + 7 + 5"); +// checkHappy("_: add(7e-18 5e-18 6e-18);", 18, "7 + 5 + 6"); +// } // /// Test the eval of `add` opcode parsed from a string. Tests three inputs. // /// Tests the unhappy path where the addition does overflow. diff --git a/test/src/lib/op/math/LibOpInv.t.sol b/test/src/lib/op/math/LibOpInv.t.sol index f7be3e93a..bda491825 100644 --- a/test/src/lib/op/math/LibOpInv.t.sol +++ b/test/src/lib/op/math/LibOpInv.t.sol @@ -8,14 +8,14 @@ // contract LibOpInvTest is OpTest { // /// Directly test the integrity logic of LibOpInv. // /// Inputs are always 1, outputs are always 1. -// function testOpInvIntegrity(IntegrityCheckStateNP memory state, Operand operand) external { +// function testOpInvIntegrity(IntegrityCheckStateNP memory state, Operand operand) external pure { // (uint256 calcInputs, uint256 calcOutputs) = LibOpInv.integrity(state, operand); // assertEq(calcInputs, 1); // assertEq(calcOutputs, 1); // } // /// Directly test the runtime logic of LibOpInv. -// function testOpInvRun(uint256 a, uint16 operandData) public { +// function testOpInvRun(uint256 a, uint16 operandData) public view { // // 0 is division by 0. // a = bound(a, 1, type(uint64).max - 1e18); // InterpreterStateNP memory state = opTestDefaultInterpreterState(); @@ -27,13 +27,13 @@ // opReferenceCheck(state, operand, LibOpInv.referenceFn, LibOpInv.integrity, LibOpInv.run, inputs); // } -// /// Test the eval of `inv`. -// function testOpInvEval() external { -// checkHappy("_: inv(1);", 1e18, "1"); -// checkHappy("_: inv(0.5);", 2e18, "0.5"); -// checkHappy("_: inv(2);", 0.5e18, "2"); -// checkHappy("_: inv(3);", 333333333333333333, "3"); -// } +// /// Test the eval of `inv`. +// function testOpInvEval() external view { +// checkHappy("_: inv(1);", 1e18, "1"); +// checkHappy("_: inv(0.5);", 2e18, "0.5"); +// checkHappy("_: inv(2);", 0.5e18, "2"); +// checkHappy("_: inv(3);", 333333333333333333, "3"); +// } // /// Test the eval of `inv` for bad inputs. // function testOpInvZeroInputs() external { diff --git a/test/src/lib/op/math/LibOpLn.t.sol b/test/src/lib/op/math/LibOpLn.t.sol index 56a260dcb..7fa525043 100644 --- a/test/src/lib/op/math/LibOpLn.t.sol +++ b/test/src/lib/op/math/LibOpLn.t.sol @@ -8,14 +8,14 @@ // contract LibOpLnTest is OpTest { // /// Directly test the integrity logic of LibOpLn. // /// Inputs are always 1, outputs are always 1. -// function testOpLnIntegrity(IntegrityCheckStateNP memory state, Operand operand) external { +// function testOpLnIntegrity(IntegrityCheckStateNP memory state, Operand operand) external pure { // (uint256 calcInputs, uint256 calcOutputs) = LibOpLn.integrity(state, operand); // assertEq(calcInputs, 1); // assertEq(calcOutputs, 1); // } // /// Directly test the runtime logic of LibOpLn. -// function testOpLnRun(uint256 a, uint16 operandData) public { +// function testOpLnRun(uint256 a, uint16 operandData) public view { // // e lifted from prb math. // a = bound(a, 2_718281828459045235, type(uint64).max - 1e18); // InterpreterStateNP memory state = opTestDefaultInterpreterState(); @@ -27,16 +27,16 @@ // opReferenceCheck(state, operand, LibOpLn.referenceFn, LibOpLn.integrity, LibOpLn.run, inputs); // } -// /// Test the eval of `ln`. -// function testOpLnEval() external { -// // Any number less than e other than 1 is negative which doesn't exist -// // in unsigned integers. -// checkHappy("_: ln(1);", 0, "ln 1"); -// checkHappy("_: ln(2.718281828459045235);", 999999999999999990, "ln e"); -// checkHappy("_: ln(3);", 1098612288668109680, "ln 3"); -// checkHappy("_: ln(4);", 1386294361119890619, "ln 4"); -// checkHappy("_: ln(5);", 1609437912434100365, "ln 5"); -// } +// /// Test the eval of `ln`. +// function testOpLnEval() external view { +// // Any number less than e other than 1 is negative which doesn't exist +// // in unsigned integers. +// checkHappy("_: ln(1);", 0, "ln 1"); +// checkHappy("_: ln(2.718281828459045235);", 999999999999999990, "ln e"); +// checkHappy("_: ln(3);", 1098612288668109680, "ln 3"); +// checkHappy("_: ln(4);", 1386294361119890619, "ln 4"); +// checkHappy("_: ln(5);", 1609437912434100365, "ln 5"); +// } // /// Test the eval of `ln` for bad inputs. // function testOpLnZeroInputs() external { diff --git a/test/src/lib/op/math/LibOpLog10.t.sol b/test/src/lib/op/math/LibOpLog10.t.sol index 5a1f6bccd..b1669215c 100644 --- a/test/src/lib/op/math/LibOpLog10.t.sol +++ b/test/src/lib/op/math/LibOpLog10.t.sol @@ -8,14 +8,14 @@ // contract LibOpLog10Test is OpTest { // /// Directly test the integrity logic of LibOpLog10. // /// Inputs are always 1, outputs are always 1. -// function testOpLog10Integrity(IntegrityCheckStateNP memory state, Operand operand) external { +// function testOpLog10Integrity(IntegrityCheckStateNP memory state, Operand operand) external pure { // (uint256 calcInputs, uint256 calcOutputs) = LibOpLog10.integrity(state, operand); // assertEq(calcInputs, 1); // assertEq(calcOutputs, 1); // } // /// Directly test the runtime logic of LibOpLog10. -// function testOpLog10Run(uint256 a, uint16 operandData) public { +// function testOpLog10Run(uint256 a, uint16 operandData) public view { // // e lifted from prb math. // a = bound(a, 2_718281828459045235, type(uint64).max - 1e18); // InterpreterStateNP memory state = opTestDefaultInterpreterState(); @@ -27,15 +27,15 @@ // opReferenceCheck(state, operand, LibOpLog10.referenceFn, LibOpLog10.integrity, LibOpLog10.run, inputs); // } -// /// Test the eval of `log10`. -// function testOpLog10Eval() external { -// checkHappy("_: log10(1);", 0, "log10 1"); -// checkHappy("_: log10(2);", 301029995663981195, "log10 2"); -// checkHappy("_: log10(2.718281828459045235);", 434294481903251823, "log2 e"); -// checkHappy("_: log10(3);", 477121254719662432, "log2 3"); -// checkHappy("_: log10(4);", 602059991327962390, "log2 4"); -// checkHappy("_: log10(5);", 698970004336018800, "log2 5"); -// } +// /// Test the eval of `log10`. +// function testOpLog10Eval() external view { +// checkHappy("_: log10(1);", 0, "log10 1"); +// checkHappy("_: log10(2);", 301029995663981195, "log10 2"); +// checkHappy("_: log10(2.718281828459045235);", 434294481903251823, "log2 e"); +// checkHappy("_: log10(3);", 477121254719662432, "log2 3"); +// checkHappy("_: log10(4);", 602059991327962390, "log2 4"); +// checkHappy("_: log10(5);", 698970004336018800, "log2 5"); +// } // /// Test the eval of `log10` for bad inputs. // function testOpLog10ZeroInputs() external { diff --git a/test/src/lib/op/math/LibOpLog2.t.sol b/test/src/lib/op/math/LibOpLog2.t.sol index a62e5131e..30f49644c 100644 --- a/test/src/lib/op/math/LibOpLog2.t.sol +++ b/test/src/lib/op/math/LibOpLog2.t.sol @@ -8,14 +8,14 @@ // contract LibOpLog2Test is OpTest { // /// Directly test the integrity logic of LibOpLog2. // /// Inputs are always 1, outputs are always 1. -// function testOpLog2Integrity(IntegrityCheckStateNP memory state, Operand operand) external { +// function testOpLog2Integrity(IntegrityCheckStateNP memory state, Operand operand) external pure { // (uint256 calcInputs, uint256 calcOutputs) = LibOpLog2.integrity(state, operand); // assertEq(calcInputs, 1); // assertEq(calcOutputs, 1); // } // /// Directly test the runtime logic of LibOpLog2. -// function testOpLog2Run(uint256 a) public { +// function testOpLog2Run(uint256 a) public view { // // e lifted from prb math. // a = bound(a, 2_718281828459045235, type(uint64).max - 1e18); // InterpreterStateNP memory state = opTestDefaultInterpreterState(); @@ -27,17 +27,17 @@ // opReferenceCheck(state, operand, LibOpLog2.referenceFn, LibOpLog2.integrity, LibOpLog2.run, inputs); // } -// /// Test the eval of `log2`. -// function testOpLog2Eval() external { -// // Any number less than 2 other than 1 is negative which doesn't exist -// // in unsigned integers. -// checkHappy("_: log2(1);", 0, "log2 1"); -// checkHappy("_: log2(2);", 1e18, "log2 2"); -// checkHappy("_: log2(2.718281828459045235);", 1442695040888963394, "log2 e"); -// checkHappy("_: log2(3);", 1584962500721156166, "log2 3"); -// checkHappy("_: log2(4);", 2000000000000000000, "log2 4"); -// checkHappy("_: log2(5);", 2321928094887362334, "log2 5"); -// } +// /// Test the eval of `log2`. +// function testOpLog2Eval() external view { +// // Any number less than 2 other than 1 is negative which doesn't exist +// // in unsigned integers. +// checkHappy("_: log2(1);", 0, "log2 1"); +// checkHappy("_: log2(2);", 1e18, "log2 2"); +// checkHappy("_: log2(2.718281828459045235);", 1442695040888963394, "log2 e"); +// checkHappy("_: log2(3);", 1584962500721156166, "log2 3"); +// checkHappy("_: log2(4);", 2000000000000000000, "log2 4"); +// checkHappy("_: log2(5);", 2321928094887362334, "log2 5"); +// } // /// Test the eval of `log2` for bad inputs. // function testOpLog2ZeroInputs() external { diff --git a/test/src/lib/op/math/LibOpMax.t.sol b/test/src/lib/op/math/LibOpMax.t.sol index e248b76ae..5318990ca 100644 --- a/test/src/lib/op/math/LibOpMax.t.sol +++ b/test/src/lib/op/math/LibOpMax.t.sol @@ -15,42 +15,45 @@ // contract LibOpMaxTest is OpTest { // using LibUint256Array for uint256[]; -// /// Directly test the integrity logic of LibOpMax. This tests the happy -// /// path where the inputs input and calc match. -// function testOpMaxIntegrityHappy(IntegrityCheckStateNP memory state, uint8 inputs, uint16 operandData) external { -// inputs = uint8(bound(inputs, 2, 0x0F)); -// (uint256 calcInputs, uint256 calcOutputs) = LibOpMax.integrity(state, LibOperand.build(inputs, 1, operandData)); +// /// Directly test the integrity logic of LibOpMax. This tests the happy +// /// path where the inputs input and calc match. +// function testOpMaxIntegrityHappy(IntegrityCheckStateNP memory state, uint8 inputs, uint16 operandData) +// external +// pure +// { +// inputs = uint8(bound(inputs, 2, 0x0F)); +// (uint256 calcInputs, uint256 calcOutputs) = LibOpMax.integrity(state, LibOperand.build(inputs, 1, operandData)); // assertEq(calcInputs, inputs); // assertEq(calcOutputs, 1); // } -// /// Directly test the integrity logic of LibOpMax. This tests the unhappy -// /// path where the operand is invalid due to 0 inputs. -// function testOpMaxIntegrityUnhappyZeroInputs(IntegrityCheckStateNP memory state) external { -// (uint256 calcInputs, uint256 calcOutputs) = LibOpMax.integrity(state, Operand.wrap(0)); -// // Calc inputs will be minimum 2. -// assertEq(calcInputs, 2); -// assertEq(calcOutputs, 1); -// } +// /// Directly test the integrity logic of LibOpMax. This tests the unhappy +// /// path where the operand is invalid due to 0 inputs. +// function testOpMaxIntegrityUnhappyZeroInputs(IntegrityCheckStateNP memory state) external pure { +// (uint256 calcInputs, uint256 calcOutputs) = LibOpMax.integrity(state, Operand.wrap(0)); +// // Calc inputs will be minimum 2. +// assertEq(calcInputs, 2); +// assertEq(calcOutputs, 1); +// } -// /// Directly test the integrity logic of LibOpMax. This tests the unhappy -// /// path where the operand is invalid due to 1 inputs. -// function testOpMaxIntegrityUnhappyOneInput(IntegrityCheckStateNP memory state) external { -// (uint256 calcInputs, uint256 calcOutputs) = LibOpMax.integrity(state, Operand.wrap(0x010000)); -// // Calc inputs will be minimum 2. -// assertEq(calcInputs, 2); -// assertEq(calcOutputs, 1); -// } +// /// Directly test the integrity logic of LibOpMax. This tests the unhappy +// /// path where the operand is invalid due to 1 inputs. +// function testOpMaxIntegrityUnhappyOneInput(IntegrityCheckStateNP memory state) external pure { +// (uint256 calcInputs, uint256 calcOutputs) = LibOpMax.integrity(state, Operand.wrap(0x010000)); +// // Calc inputs will be minimum 2. +// assertEq(calcInputs, 2); +// assertEq(calcOutputs, 1); +// } -// /// Directly test the runtime logic of LibOpMax. -// function testOpMaxRun(uint256[] memory inputs) external { -// InterpreterStateNP memory state = opTestDefaultInterpreterState(); -// vm.assume(inputs.length >= 2); -// vm.assume(inputs.length <= 0x0F); -// Operand operand = LibOperand.build(uint8(inputs.length), 1, 0); -// opReferenceCheck(state, operand, LibOpMax.referenceFn, LibOpMax.integrity, LibOpMax.run, inputs); -// } +// /// Directly test the runtime logic of LibOpMax. +// function testOpMaxRun(uint256[] memory inputs) external view { +// InterpreterStateNP memory state = opTestDefaultInterpreterState(); +// vm.assume(inputs.length >= 2); +// vm.assume(inputs.length <= 0x0F); +// Operand operand = LibOperand.build(uint8(inputs.length), 1, 0); +// opReferenceCheck(state, operand, LibOpMax.referenceFn, LibOpMax.integrity, LibOpMax.run, inputs); +// } // /// Test the eval of `max` opcode parsed from a string. Tests zero inputs. // function testOpMaxEvalZeroInputs() external { @@ -69,65 +72,65 @@ // checkBadOutputs("_ _: max(0 0);", 2, 1, 2); // } -// /// Test the eval of `max` opcode parsed from a string. Tests two inputs. -// function testOpMaxEval2InputsHappy() external { -// checkHappy("_: max(0 0);", 0, "0 > 0 ? 0 : 1"); -// checkHappy("_: max(1e-18 0);", 1, "1 > 0 ? 1 : 0"); -// checkHappy("_: max(max-value() 0);", type(uint256).max, "max-value() > 0 ? max-value() : 0"); -// checkHappy("_: max(0 1e-18);", 1, "0 > 1 ? 0 : 1"); -// checkHappy("_: max(1e-18 1e-18);", 1, "1 > 1 ? 1 : 1"); -// checkHappy("_: max(0 max-value());", type(uint256).max, "0 > max-value() ? 0 : max-value()"); -// checkHappy("_: max(1e-18 max-value());", type(uint256).max, "1 > max-value() ? 1 : max-value()"); -// checkHappy("_: max(max-value() 1e-18);", type(uint256).max, "1 > max-value() ? 1 : max-value()"); -// checkHappy( -// "_: max(max-value() max-value());", -// type(uint256).max, -// "max-value() > max-value() ? max-value() : max-value()" -// ); -// checkHappy("_: max(0 2e-18);", 2, "0 > 2 ? 0 : 2"); -// checkHappy("_: max(1e-18 2e-18);", 2, "1 > 2 ? 1 : 2"); -// checkHappy("_: max(2e-18 2e-18);", 2, "2 > 2 ? 2 : 2"); -// } +// /// Test the eval of `max` opcode parsed from a string. Tests two inputs. +// function testOpMaxEval2InputsHappy() external view { +// checkHappy("_: max(0 0);", 0, "0 > 0 ? 0 : 1"); +// checkHappy("_: max(1e-18 0);", 1, "1 > 0 ? 1 : 0"); +// checkHappy("_: max(max-value() 0);", type(uint256).max, "max-value() > 0 ? max-value() : 0"); +// checkHappy("_: max(0 1e-18);", 1, "0 > 1 ? 0 : 1"); +// checkHappy("_: max(1e-18 1e-18);", 1, "1 > 1 ? 1 : 1"); +// checkHappy("_: max(0 max-value());", type(uint256).max, "0 > max-value() ? 0 : max-value()"); +// checkHappy("_: max(1e-18 max-value());", type(uint256).max, "1 > max-value() ? 1 : max-value()"); +// checkHappy("_: max(max-value() 1e-18);", type(uint256).max, "1 > max-value() ? 1 : max-value()"); +// checkHappy( +// "_: max(max-value() max-value());", +// type(uint256).max, +// "max-value() > max-value() ? max-value() : max-value()" +// ); +// checkHappy("_: max(0 2e-18);", 2, "0 > 2 ? 0 : 2"); +// checkHappy("_: max(1e-18 2e-18);", 2, "1 > 2 ? 1 : 2"); +// checkHappy("_: max(2e-18 2e-18);", 2, "2 > 2 ? 2 : 2"); +// } -// /// Test the eval of `max` opcode parsed from a string. Tests three inputs. -// function testOpMaxEval3InputsHappy() external { -// checkHappy("_: max(0 0 0);", 0, "0 0 0"); -// checkHappy("_: max(1e-18 0 0);", 1, "1 0 0"); -// checkHappy("_: max(2e-18 0 0);", 2, "2 0 0"); -// checkHappy("_: max(0 1e-18 0);", 1, "0 1 0"); -// checkHappy("_: max(1e-18 1e-18 0);", 1, "1 1 0"); -// checkHappy("_: max(2e-18 1e-18 0);", 2, "2 1 0"); -// checkHappy("_: max(0 2e-18 0);", 2, "0 2 0"); -// checkHappy("_: max(1e-18 2e-18 0);", 2, "1 2 0"); -// checkHappy("_: max(2e-18 2e-18 0);", 2, "2 2 0"); -// checkHappy("_: max(0 0 1e-18);", 1, "0 0 1"); -// checkHappy("_: max(1e-18 0 1e-18);", 1, "1 0 1"); -// checkHappy("_: max(2e-18 0 1e-18);", 2, "2 0 1"); -// checkHappy("_: max(0 1e-18 1e-18);", 1, "0 1 1"); -// checkHappy("_: max(1e-18 1e-18 1e-18);", 1, "1 1 1"); -// checkHappy("_: max(2e-18 1e-18 1e-18);", 2, "2 1 1"); -// checkHappy("_: max(0 2e-18 1e-18);", 2, "0 2 1"); -// checkHappy("_: max(1e-18 2e-18 1e-18);", 2, "1 2 1"); -// checkHappy("_: max(2e-18 2e-18 1e-18);", 2, "2 2 1"); -// checkHappy("_: max(0 0 2e-18);", 2, "0 0 2"); -// checkHappy("_: max(1e-18 0 2e-18);", 2, "1 0 2"); -// checkHappy("_: max(2e-18 0 2e-18);", 2, "2 0 2"); -// checkHappy("_: max(0 1e-18 2e-18);", 2, "0 1 2"); -// checkHappy("_: max(1e-18 1e-18 2e-18);", 2, "1 1 2"); -// checkHappy("_: max(2e-18 1e-18 2e-18);", 2, "2 1 2"); -// checkHappy("_: max(0 2e-18 2e-18);", 2, "0 2 2"); -// checkHappy("_: max(1e-18 2e-18 2e-18);", 2, "1 2 2"); -// checkHappy("_: max(2e-18 2e-18 2e-18);", 2, "2 2 2"); -// checkHappy("_: max(0 0 max-value());", type(uint256).max, "0 0 max-value()"); -// checkHappy("_: max(1e-18 0 max-value());", type(uint256).max, "1 0 max-value()"); -// checkHappy("_: max(2e-18 0 max-value());", type(uint256).max, "2 0 max-value()"); -// checkHappy("_: max(0 1e-18 max-value());", type(uint256).max, "0 1 max-value()"); -// checkHappy("_: max(1e-18 1e-18 max-value());", type(uint256).max, "1 1 max-value()"); -// checkHappy("_: max(2e-18 1e-18 max-value());", type(uint256).max, "2 1 max-value()"); -// checkHappy("_: max(0 2e-18 max-value());", type(uint256).max, "0 2 max-value()"); -// checkHappy("_: max(1e-18 2e-18 max-value());", type(uint256).max, "1 2 max-value()"); -// checkHappy("_: max(2e-18 2e-18 max-value());", type(uint256).max, "2 2 max-value()"); -// } +// /// Test the eval of `max` opcode parsed from a string. Tests three inputs. +// function testOpMaxEval3InputsHappy() external view { +// checkHappy("_: max(0 0 0);", 0, "0 0 0"); +// checkHappy("_: max(1e-18 0 0);", 1, "1 0 0"); +// checkHappy("_: max(2e-18 0 0);", 2, "2 0 0"); +// checkHappy("_: max(0 1e-18 0);", 1, "0 1 0"); +// checkHappy("_: max(1e-18 1e-18 0);", 1, "1 1 0"); +// checkHappy("_: max(2e-18 1e-18 0);", 2, "2 1 0"); +// checkHappy("_: max(0 2e-18 0);", 2, "0 2 0"); +// checkHappy("_: max(1e-18 2e-18 0);", 2, "1 2 0"); +// checkHappy("_: max(2e-18 2e-18 0);", 2, "2 2 0"); +// checkHappy("_: max(0 0 1e-18);", 1, "0 0 1"); +// checkHappy("_: max(1e-18 0 1e-18);", 1, "1 0 1"); +// checkHappy("_: max(2e-18 0 1e-18);", 2, "2 0 1"); +// checkHappy("_: max(0 1e-18 1e-18);", 1, "0 1 1"); +// checkHappy("_: max(1e-18 1e-18 1e-18);", 1, "1 1 1"); +// checkHappy("_: max(2e-18 1e-18 1e-18);", 2, "2 1 1"); +// checkHappy("_: max(0 2e-18 1e-18);", 2, "0 2 1"); +// checkHappy("_: max(1e-18 2e-18 1e-18);", 2, "1 2 1"); +// checkHappy("_: max(2e-18 2e-18 1e-18);", 2, "2 2 1"); +// checkHappy("_: max(0 0 2e-18);", 2, "0 0 2"); +// checkHappy("_: max(1e-18 0 2e-18);", 2, "1 0 2"); +// checkHappy("_: max(2e-18 0 2e-18);", 2, "2 0 2"); +// checkHappy("_: max(0 1e-18 2e-18);", 2, "0 1 2"); +// checkHappy("_: max(1e-18 1e-18 2e-18);", 2, "1 1 2"); +// checkHappy("_: max(2e-18 1e-18 2e-18);", 2, "2 1 2"); +// checkHappy("_: max(0 2e-18 2e-18);", 2, "0 2 2"); +// checkHappy("_: max(1e-18 2e-18 2e-18);", 2, "1 2 2"); +// checkHappy("_: max(2e-18 2e-18 2e-18);", 2, "2 2 2"); +// checkHappy("_: max(0 0 max-value());", type(uint256).max, "0 0 max-value()"); +// checkHappy("_: max(1e-18 0 max-value());", type(uint256).max, "1 0 max-value()"); +// checkHappy("_: max(2e-18 0 max-value());", type(uint256).max, "2 0 max-value()"); +// checkHappy("_: max(0 1e-18 max-value());", type(uint256).max, "0 1 max-value()"); +// checkHappy("_: max(1e-18 1e-18 max-value());", type(uint256).max, "1 1 max-value()"); +// checkHappy("_: max(2e-18 1e-18 max-value());", type(uint256).max, "2 1 max-value()"); +// checkHappy("_: max(0 2e-18 max-value());", type(uint256).max, "0 2 max-value()"); +// checkHappy("_: max(1e-18 2e-18 max-value());", type(uint256).max, "1 2 max-value()"); +// checkHappy("_: max(2e-18 2e-18 max-value());", type(uint256).max, "2 2 max-value()"); +// } // /// Test the eval of `max` opcode parsed from a string. // /// Tests that operands are disallowed. diff --git a/test/src/lib/op/math/LibOpMin.t.sol b/test/src/lib/op/math/LibOpMin.t.sol index 21bb6c7f6..444856a66 100644 --- a/test/src/lib/op/math/LibOpMin.t.sol +++ b/test/src/lib/op/math/LibOpMin.t.sol @@ -12,42 +12,45 @@ // contract LibOpMinTest is OpTest { // using LibUint256Array for uint256[]; -// /// Directly test the integrity logic of LibOpMin. This tests the happy -// /// path where the inputs input and calc match. -// function testOpMinIntegrityHappy(IntegrityCheckStateNP memory state, uint8 inputs, uint16 operandData) external { -// inputs = uint8(bound(inputs, 2, 0x0F)); -// (uint256 calcInputs, uint256 calcOutputs) = LibOpMin.integrity(state, LibOperand.build(inputs, 1, operandData)); +// /// Directly test the integrity logic of LibOpMin. This tests the happy +// /// path where the inputs input and calc match. +// function testOpMinIntegrityHappy(IntegrityCheckStateNP memory state, uint8 inputs, uint16 operandData) +// external +// pure +// { +// inputs = uint8(bound(inputs, 2, 0x0F)); +// (uint256 calcInputs, uint256 calcOutputs) = LibOpMin.integrity(state, LibOperand.build(inputs, 1, operandData)); // assertEq(calcInputs, inputs); // assertEq(calcOutputs, 1); // } -// /// Directly test the integrity logic of LibOpMin. This tests the unhappy -// /// path where the operand is invalid due to 0 inputs. -// function testOpMinIntegrityUnhappyZeroInputs(IntegrityCheckStateNP memory state) external { -// (uint256 calcInputs, uint256 calcOutputs) = LibOpMin.integrity(state, Operand.wrap(0)); -// // Calc inputs will be minimum 2. -// assertEq(calcInputs, 2); -// assertEq(calcOutputs, 1); -// } +// /// Directly test the integrity logic of LibOpMin. This tests the unhappy +// /// path where the operand is invalid due to 0 inputs. +// function testOpMinIntegrityUnhappyZeroInputs(IntegrityCheckStateNP memory state) external pure { +// (uint256 calcInputs, uint256 calcOutputs) = LibOpMin.integrity(state, Operand.wrap(0)); +// // Calc inputs will be minimum 2. +// assertEq(calcInputs, 2); +// assertEq(calcOutputs, 1); +// } -// /// Directly test the integrity logic of LibOpMin. This tests the unhappy -// /// path where the operand is invalid due to 1 inputs. -// function testOpMinIntegrityUnhappyOneInput(IntegrityCheckStateNP memory state) external { -// (uint256 calcInputs, uint256 calcOutputs) = LibOpMin.integrity(state, Operand.wrap(0x010000)); -// // Calc inputs will be minimum 2. -// assertEq(calcInputs, 2); -// assertEq(calcOutputs, 1); -// } +// /// Directly test the integrity logic of LibOpMin. This tests the unhappy +// /// path where the operand is invalid due to 1 inputs. +// function testOpMinIntegrityUnhappyOneInput(IntegrityCheckStateNP memory state) external pure { +// (uint256 calcInputs, uint256 calcOutputs) = LibOpMin.integrity(state, Operand.wrap(0x010000)); +// // Calc inputs will be minimum 2. +// assertEq(calcInputs, 2); +// assertEq(calcOutputs, 1); +// } -// /// Directly test the runtime logic of LibOpMin. -// function testOpMinRun(uint256[] memory inputs, uint16 operandData) external { -// InterpreterStateNP memory state = opTestDefaultInterpreterState(); -// vm.assume(inputs.length >= 2); -// vm.assume(inputs.length <= 0x0F); -// Operand operand = LibOperand.build(uint8(inputs.length), 1, operandData); -// opReferenceCheck(state, operand, LibOpMin.referenceFn, LibOpMin.integrity, LibOpMin.run, inputs); -// } +// /// Directly test the runtime logic of LibOpMin. +// function testOpMinRun(uint256[] memory inputs, uint16 operandData) external view { +// InterpreterStateNP memory state = opTestDefaultInterpreterState(); +// vm.assume(inputs.length >= 2); +// vm.assume(inputs.length <= 0x0F); +// Operand operand = LibOperand.build(uint8(inputs.length), 1, operandData); +// opReferenceCheck(state, operand, LibOpMin.referenceFn, LibOpMin.integrity, LibOpMin.run, inputs); +// } // /// Test the eval of `min` opcode parsed from a string. Tests zero inputs. // function testOpMinEvalZeroInputs() external { @@ -62,95 +65,95 @@ // checkBadInputs("_: min(max-value());", 1, 2, 1); // } -// /// Test the eval of `min` opcode parsed from a string. Tests two inputs. -// function testOpMinEval2InputsHappy() external { -// checkHappy("_: min(0 0);", 0, "0 > 0 ? 0 : 1"); -// checkHappy("_: min(1e-18 0);", 0, "1 > 0 ? 1 : 0"); -// checkHappy("_: min(max-value() 0);", 0, "max-value() > 0 ? max-value() : 0"); -// checkHappy("_: min(0 1e-18);", 0, "0 > 1 ? 0 : 1"); -// checkHappy("_: min(1e-18 1e-18);", 1, "1 > 1 ? 1 : 1"); -// checkHappy("_: min(0 max-value());", 0, "0 > max-value() ? 0 : max-value()"); -// checkHappy("_: min(1e-18 max-value());", 1, "1 > max-value() ? 1 : max-value()"); -// checkHappy("_: min(max-value() 1e-18);", 1, "1 > max-value() ? 1 : max-value()"); -// checkHappy( -// "_: min(max-value() max-value());", -// type(uint256).max, -// "max-value() > max-value() ? max-value() : max-value()" -// ); -// checkHappy("_: min(0 2e-18);", 0, "0 > 2 ? 0 : 2"); -// checkHappy("_: min(1e-18 2e-18);", 1, "1 > 2 ? 1 : 2"); -// checkHappy("_: min(2e-18 2e-18);", 2, "2 > 2 ? 2 : 2"); -// } +// /// Test the eval of `min` opcode parsed from a string. Tests two inputs. +// function testOpMinEval2InputsHappy() external view { +// checkHappy("_: min(0 0);", 0, "0 > 0 ? 0 : 1"); +// checkHappy("_: min(1e-18 0);", 0, "1 > 0 ? 1 : 0"); +// checkHappy("_: min(max-value() 0);", 0, "max-value() > 0 ? max-value() : 0"); +// checkHappy("_: min(0 1e-18);", 0, "0 > 1 ? 0 : 1"); +// checkHappy("_: min(1e-18 1e-18);", 1, "1 > 1 ? 1 : 1"); +// checkHappy("_: min(0 max-value());", 0, "0 > max-value() ? 0 : max-value()"); +// checkHappy("_: min(1e-18 max-value());", 1, "1 > max-value() ? 1 : max-value()"); +// checkHappy("_: min(max-value() 1e-18);", 1, "1 > max-value() ? 1 : max-value()"); +// checkHappy( +// "_: min(max-value() max-value());", +// type(uint256).max, +// "max-value() > max-value() ? max-value() : max-value()" +// ); +// checkHappy("_: min(0 2e-18);", 0, "0 > 2 ? 0 : 2"); +// checkHappy("_: min(1e-18 2e-18);", 1, "1 > 2 ? 1 : 2"); +// checkHappy("_: min(2e-18 2e-18);", 2, "2 > 2 ? 2 : 2"); +// } -// /// Test the eval of `min` opcode parsed from a string. Tests three inputs. -// function testOpMinEval3InputsHappy() external { -// checkHappy("_: min(0 0 0);", 0, "0 0 0"); -// checkHappy("_: min(1e-18 0 0);", 0, "1 0 0"); -// checkHappy("_: min(2e-18 0 0);", 0, "2 0 0"); -// checkHappy("_: min(0 1e-18 0);", 0, "0 1 0"); -// checkHappy("_: min(1e-18 1e-18 0);", 0, "1 1 0"); -// checkHappy("_: min(2e-18 1e-18 0);", 0, "2 1 0"); -// checkHappy("_: min(0 2e-18 0);", 0, "0 2 0"); -// checkHappy("_: min(1e-18 2e-18 0);", 0, "1 2 0"); -// checkHappy("_: min(2e-18 2e-18 0);", 0, "2 2 0"); -// checkHappy("_: min(0 0 1e-18);", 0, "0 0 1"); -// checkHappy("_: min(1e-18 0 1e-18);", 0, "1 0 1"); -// checkHappy("_: min(2e-18 0 1e-18);", 0, "2 0 1"); -// checkHappy("_: min(0 1e-18 1e-18);", 0, "0 1 1"); -// checkHappy("_: min(1e-18 1e-18 1e-18);", 1, "1 1 1"); -// checkHappy("_: min(2e-18 1e-18 1e-18);", 1, "2 1 1"); -// checkHappy("_: min(0 2e-18 1e-18);", 0, "0 2 1"); -// checkHappy("_: min(1e-18 2e-18 1e-18);", 1, "1 2 1"); -// checkHappy("_: min(2e-18 2e-18 1e-18);", 1, "2 2 1"); -// checkHappy("_: min(0 0 2e-18);", 0, "0 0 2"); -// checkHappy("_: min(1e-18 0 2e-18);", 0, "1 0 2"); -// checkHappy("_: min(2e-18 0 2e-18);", 0, "2 0 2"); -// checkHappy("_: min(0 1e-18 2e-18);", 0, "0 1 2"); -// checkHappy("_: min(1e-18 1e-18 2e-18);", 1, "1 1 2"); -// checkHappy("_: min(2e-18 1e-18 2e-18);", 1, "2 1 2"); -// checkHappy("_: min(0 2e-18 2e-18);", 0, "0 2 2"); -// checkHappy("_: min(1e-18 2e-18 2e-18);", 1, "1 2 2"); -// checkHappy("_: min(2e-18 2e-18 2e-18);", 2, "2 2 2"); -// checkHappy("_: min(0 0 max-value());", 0, "0 0 max-value()"); -// checkHappy("_: min(1e-18 0 max-value());", 0, "1 0 max-value()"); -// checkHappy("_: min(2e-18 0 max-value());", 0, "2 0 max-value()"); -// checkHappy("_: min(0 1e-18 max-value());", 0, "0 1 max-value()"); -// checkHappy("_: min(1e-18 1e-18 max-value());", 1, "1 1 max-value()"); -// checkHappy("_: min(2e-18 1e-18 max-value());", 1, "2 1 max-value()"); -// checkHappy("_: min(0 2e-18 max-value());", 0, "0 2 max-value()"); -// checkHappy("_: min(1e-18 2e-18 max-value());", 1, "1 2 max-value()"); -// checkHappy("_: min(2e-18 2e-18 max-value());", 2, "2 2 max-value()"); -// checkHappy("_: min(0 max-value() 0);", 0, "0 max-value() 0"); -// checkHappy("_: min(1e-18 max-value() 0);", 0, "1 max-value() 0"); -// checkHappy("_: min(2e-18 max-value() 0);", 0, "2 max-value() 0"); -// checkHappy("_: min(0 max-value() 1e-18);", 0, "0 max-value() 1"); -// checkHappy("_: min(1e-18 max-value() 1e-18);", 1, "1 max-value() 1"); -// checkHappy("_: min(2e-18 max-value() 1e-18);", 1, "2 max-value() 1"); -// checkHappy("_: min(0 max-value() 2e-18);", 0, "0 max-value() 2"); -// checkHappy("_: min(1e-18 max-value() 2e-18);", 1, "1 max-value() 2"); -// checkHappy("_: min(2e-18 max-value() 2e-18);", 2, "2 max-value() 2"); -// checkHappy("_: min(0 max-value() max-value());", 0, "0 max-value() max-value()"); -// checkHappy("_: min(1e-18 max-value() max-value());", 1, "1 max-value() max-value()"); -// checkHappy("_: min(2e-18 max-value() max-value());", 2, "2 max-value() max-value()"); -// checkHappy("_: min(max-value() 0 0);", 0, "max-value() 0 0"); -// checkHappy("_: min(max-value() 1e-18 0);", 0, "max-value() 1 0"); -// checkHappy("_: min(max-value() 2e-18 0);", 0, "max-value() 2 0"); -// checkHappy("_: min(max-value() 0 1e-18);", 0, "max-value() 0 1"); -// checkHappy("_: min(max-value() 1e-18 1e-18);", 1, "max-value() 1 1"); -// checkHappy("_: min(max-value() 2e-18 1e-18);", 1, "max-value() 2 1"); -// checkHappy("_: min(max-value() 0 2e-18);", 0, "max-value() 0 2"); -// checkHappy("_: min(max-value() 1e-18 2e-18);", 1, "max-value() 1 2"); -// checkHappy("_: min(max-value() 2e-18 2e-18);", 2, "max-value() 2 2"); -// checkHappy("_: min(max-value() 0 max-value());", 0, "max-value() 0 max-value()"); -// checkHappy("_: min(max-value() 1e-18 max-value());", 1, "max-value() 1 max-value()"); -// checkHappy("_: min(max-value() 2e-18 max-value());", 2, "max-value() 2 max-value()"); -// checkHappy("_: min(max-value() max-value() 0);", 0, "max-value() max-value() 0"); -// checkHappy("_: min(max-value() max-value() 1e-18);", 1, "max-value() max-value() 1"); -// checkHappy("_: min(max-value() max-value() 2e-18);", 2, "max-value() max-value() 2"); -// checkHappy( -// "_: min(max-value() max-value() max-value());", type(uint256).max, "max-value() max-value() max-value()" -// ); -// } +// /// Test the eval of `min` opcode parsed from a string. Tests three inputs. +// function testOpMinEval3InputsHappy() external view { +// checkHappy("_: min(0 0 0);", 0, "0 0 0"); +// checkHappy("_: min(1e-18 0 0);", 0, "1 0 0"); +// checkHappy("_: min(2e-18 0 0);", 0, "2 0 0"); +// checkHappy("_: min(0 1e-18 0);", 0, "0 1 0"); +// checkHappy("_: min(1e-18 1e-18 0);", 0, "1 1 0"); +// checkHappy("_: min(2e-18 1e-18 0);", 0, "2 1 0"); +// checkHappy("_: min(0 2e-18 0);", 0, "0 2 0"); +// checkHappy("_: min(1e-18 2e-18 0);", 0, "1 2 0"); +// checkHappy("_: min(2e-18 2e-18 0);", 0, "2 2 0"); +// checkHappy("_: min(0 0 1e-18);", 0, "0 0 1"); +// checkHappy("_: min(1e-18 0 1e-18);", 0, "1 0 1"); +// checkHappy("_: min(2e-18 0 1e-18);", 0, "2 0 1"); +// checkHappy("_: min(0 1e-18 1e-18);", 0, "0 1 1"); +// checkHappy("_: min(1e-18 1e-18 1e-18);", 1, "1 1 1"); +// checkHappy("_: min(2e-18 1e-18 1e-18);", 1, "2 1 1"); +// checkHappy("_: min(0 2e-18 1e-18);", 0, "0 2 1"); +// checkHappy("_: min(1e-18 2e-18 1e-18);", 1, "1 2 1"); +// checkHappy("_: min(2e-18 2e-18 1e-18);", 1, "2 2 1"); +// checkHappy("_: min(0 0 2e-18);", 0, "0 0 2"); +// checkHappy("_: min(1e-18 0 2e-18);", 0, "1 0 2"); +// checkHappy("_: min(2e-18 0 2e-18);", 0, "2 0 2"); +// checkHappy("_: min(0 1e-18 2e-18);", 0, "0 1 2"); +// checkHappy("_: min(1e-18 1e-18 2e-18);", 1, "1 1 2"); +// checkHappy("_: min(2e-18 1e-18 2e-18);", 1, "2 1 2"); +// checkHappy("_: min(0 2e-18 2e-18);", 0, "0 2 2"); +// checkHappy("_: min(1e-18 2e-18 2e-18);", 1, "1 2 2"); +// checkHappy("_: min(2e-18 2e-18 2e-18);", 2, "2 2 2"); +// checkHappy("_: min(0 0 max-value());", 0, "0 0 max-value()"); +// checkHappy("_: min(1e-18 0 max-value());", 0, "1 0 max-value()"); +// checkHappy("_: min(2e-18 0 max-value());", 0, "2 0 max-value()"); +// checkHappy("_: min(0 1e-18 max-value());", 0, "0 1 max-value()"); +// checkHappy("_: min(1e-18 1e-18 max-value());", 1, "1 1 max-value()"); +// checkHappy("_: min(2e-18 1e-18 max-value());", 1, "2 1 max-value()"); +// checkHappy("_: min(0 2e-18 max-value());", 0, "0 2 max-value()"); +// checkHappy("_: min(1e-18 2e-18 max-value());", 1, "1 2 max-value()"); +// checkHappy("_: min(2e-18 2e-18 max-value());", 2, "2 2 max-value()"); +// checkHappy("_: min(0 max-value() 0);", 0, "0 max-value() 0"); +// checkHappy("_: min(1e-18 max-value() 0);", 0, "1 max-value() 0"); +// checkHappy("_: min(2e-18 max-value() 0);", 0, "2 max-value() 0"); +// checkHappy("_: min(0 max-value() 1e-18);", 0, "0 max-value() 1"); +// checkHappy("_: min(1e-18 max-value() 1e-18);", 1, "1 max-value() 1"); +// checkHappy("_: min(2e-18 max-value() 1e-18);", 1, "2 max-value() 1"); +// checkHappy("_: min(0 max-value() 2e-18);", 0, "0 max-value() 2"); +// checkHappy("_: min(1e-18 max-value() 2e-18);", 1, "1 max-value() 2"); +// checkHappy("_: min(2e-18 max-value() 2e-18);", 2, "2 max-value() 2"); +// checkHappy("_: min(0 max-value() max-value());", 0, "0 max-value() max-value()"); +// checkHappy("_: min(1e-18 max-value() max-value());", 1, "1 max-value() max-value()"); +// checkHappy("_: min(2e-18 max-value() max-value());", 2, "2 max-value() max-value()"); +// checkHappy("_: min(max-value() 0 0);", 0, "max-value() 0 0"); +// checkHappy("_: min(max-value() 1e-18 0);", 0, "max-value() 1 0"); +// checkHappy("_: min(max-value() 2e-18 0);", 0, "max-value() 2 0"); +// checkHappy("_: min(max-value() 0 1e-18);", 0, "max-value() 0 1"); +// checkHappy("_: min(max-value() 1e-18 1e-18);", 1, "max-value() 1 1"); +// checkHappy("_: min(max-value() 2e-18 1e-18);", 1, "max-value() 2 1"); +// checkHappy("_: min(max-value() 0 2e-18);", 0, "max-value() 0 2"); +// checkHappy("_: min(max-value() 1e-18 2e-18);", 1, "max-value() 1 2"); +// checkHappy("_: min(max-value() 2e-18 2e-18);", 2, "max-value() 2 2"); +// checkHappy("_: min(max-value() 0 max-value());", 0, "max-value() 0 max-value()"); +// checkHappy("_: min(max-value() 1e-18 max-value());", 1, "max-value() 1 max-value()"); +// checkHappy("_: min(max-value() 2e-18 max-value());", 2, "max-value() 2 max-value()"); +// checkHappy("_: min(max-value() max-value() 0);", 0, "max-value() max-value() 0"); +// checkHappy("_: min(max-value() max-value() 1e-18);", 1, "max-value() max-value() 1"); +// checkHappy("_: min(max-value() max-value() 2e-18);", 2, "max-value() max-value() 2"); +// checkHappy( +// "_: min(max-value() max-value() max-value());", type(uint256).max, "max-value() max-value() max-value()" +// ); +// } // /// Test the eval of `min` opcode parsed from a string. // /// Tests that operands are disallowed. diff --git a/test/src/lib/op/math/LibOpMod.t.sol b/test/src/lib/op/math/LibOpMod.t.sol index bcb9d6773..3163ba255 100644 --- a/test/src/lib/op/math/LibOpMod.t.sol +++ b/test/src/lib/op/math/LibOpMod.t.sol @@ -12,33 +12,36 @@ // contract LibOpModTest is OpTest { // using LibUint256Array for uint256[]; -// /// Directly test the integrity logic of LibOpMod. This tests the happy -// /// path where the inputs input and calc match. -// function testOpModIntegrityHappy(IntegrityCheckStateNP memory state, uint8 inputs, uint16 operandData) external { -// inputs = uint8(bound(inputs, 2, 0x0F)); -// (uint256 calcInputs, uint256 calcOutputs) = LibOpMod.integrity(state, LibOperand.build(inputs, 1, operandData)); +// /// Directly test the integrity logic of LibOpMod. This tests the happy +// /// path where the inputs input and calc match. +// function testOpModIntegrityHappy(IntegrityCheckStateNP memory state, uint8 inputs, uint16 operandData) +// external +// pure +// { +// inputs = uint8(bound(inputs, 2, 0x0F)); +// (uint256 calcInputs, uint256 calcOutputs) = LibOpMod.integrity(state, LibOperand.build(inputs, 1, operandData)); // assertEq(calcInputs, inputs); // assertEq(calcOutputs, 1); // } -// /// Directly test the integrity logic of LibOpMod. This tests the unhappy -// /// path where the operand is invalid due to 0 inputs. -// function testOpModIntegrityUnhappyZeroInputs(IntegrityCheckStateNP memory state) external { -// (uint256 calcInputs, uint256 calcOutputs) = LibOpMod.integrity(state, Operand.wrap(0)); -// // Calc inputs will be minimum 2. -// assertEq(calcInputs, 2); -// assertEq(calcOutputs, 1); -// } +// /// Directly test the integrity logic of LibOpMod. This tests the unhappy +// /// path where the operand is invalid due to 0 inputs. +// function testOpModIntegrityUnhappyZeroInputs(IntegrityCheckStateNP memory state) external pure { +// (uint256 calcInputs, uint256 calcOutputs) = LibOpMod.integrity(state, Operand.wrap(0)); +// // Calc inputs will be minimum 2. +// assertEq(calcInputs, 2); +// assertEq(calcOutputs, 1); +// } -// /// Directly test the integrity logic of LibOpMod. This tests the unhappy -// /// path where the operand is invalid due to 1 inputs. -// function testOpModIntegrityUnhappyOneInput(IntegrityCheckStateNP memory state) external { -// (uint256 calcInputs, uint256 calcOutputs) = LibOpMod.integrity(state, Operand.wrap(0x010000)); -// // Calc inputs will be minimum 2. -// assertEq(calcInputs, 2); -// assertEq(calcOutputs, 1); -// } +// /// Directly test the integrity logic of LibOpMod. This tests the unhappy +// /// path where the operand is invalid due to 1 inputs. +// function testOpModIntegrityUnhappyOneInput(IntegrityCheckStateNP memory state) external pure { +// (uint256 calcInputs, uint256 calcOutputs) = LibOpMod.integrity(state, Operand.wrap(0x010000)); +// // Calc inputs will be minimum 2. +// assertEq(calcInputs, 2); +// assertEq(calcOutputs, 1); +// } // /// Directly test the runtime logic of LibOpMod. // function testOpModRun(uint256[] memory inputs) external { @@ -79,18 +82,18 @@ // checkBadOutputs("_ _: mod(0 0);", 2, 1, 2); // } -// /// Test the eval of `mod` opcode parsed from a string. Tests two inputs. -// /// Tests the happy path where we do not mod by zero. -// function testOpModEval2InputsHappy() external { -// // Show that the modulo truncates (rounds down). -// checkHappy("_: mod(6e-18 1e-18);", 0, "6 1"); -// checkHappy("_: mod(6e-18 2e-18);", 0, "6 2"); -// checkHappy("_: mod(6e-18 3e-18);", 0, "6 3"); -// checkHappy("_: mod(6e-18 4e-18);", 2, "6 4"); -// checkHappy("_: mod(6e-18 5e-18);", 1, "6 5"); -// checkHappy("_: mod(6e-18 6e-18);", 0, "6 6"); -// checkHappy("_: mod(6e-18 7e-18);", 6, "6 7"); -// checkHappy("_: mod(6e-18 max-value());", 6, "6 max-value()"); +// /// Test the eval of `mod` opcode parsed from a string. Tests two inputs. +// /// Tests the happy path where we do not mod by zero. +// function testOpModEval2InputsHappy() external view { +// // Show that the modulo truncates (rounds down). +// checkHappy("_: mod(6e-18 1e-18);", 0, "6 1"); +// checkHappy("_: mod(6e-18 2e-18);", 0, "6 2"); +// checkHappy("_: mod(6e-18 3e-18);", 0, "6 3"); +// checkHappy("_: mod(6e-18 4e-18);", 2, "6 4"); +// checkHappy("_: mod(6e-18 5e-18);", 1, "6 5"); +// checkHappy("_: mod(6e-18 6e-18);", 0, "6 6"); +// checkHappy("_: mod(6e-18 7e-18);", 6, "6 7"); +// checkHappy("_: mod(6e-18 max-value());", 6, "6 max-value()"); // // Anything module by 1 is 0. // checkHappy("_: mod(0 1e-18);", 0, "0 1"); @@ -114,27 +117,27 @@ // checkUnhappy("_: mod(max-value() 0);", stdError.divisionError); // } -// /// Test the eval of `mod` opcode parsed from a string. Tests three inputs. -// /// Tests the happy path where we do not modulo by zero. -// function testOpModEval3InputsHappy() external { -// // Show that the modulo truncates (rounds down). -// checkHappy("_: mod(6e-18 1e-18 1e-18);", 0, "6 1 1"); -// checkHappy("_: mod(6e-18 2e-18 1e-18);", 0, "6 2 1"); -// checkHappy("_: mod(6e-18 3e-18 1e-18);", 0, "6 3 1"); -// checkHappy("_: mod(26e-18 20e-18 4e-18);", 2, "26 20 4"); -// checkHappy("_: mod(6e-18 4e-18 1e-18);", 0, "6 4 1"); -// checkHappy("_: mod(6e-18 5e-18 1e-18);", 0, "6 5 1"); -// checkHappy("_: mod(6e-18 6e-18 1e-18);", 0, "6 6 1"); -// checkHappy("_: mod(6e-18 7e-18 1e-18);", 0, "6 7 1"); -// checkHappy("_: mod(6e-18 max-value() 1e-18);", 0, "6 max-value() 1"); -// checkHappy("_: mod(6e-18 1e-18 2e-18);", 0, "6 1 2"); -// checkHappy("_: mod(6e-18 2e-18 2e-18);", 0, "6 2 2"); -// checkHappy("_: mod(6e-18 3e-18 2e-18);", 0, "6 3 2"); -// checkHappy("_: mod(6e-18 4e-18 2e-18);", 0, "6 4 2"); -// checkHappy("_: mod(6e-18 5e-18 2e-18);", 1, "6 5 2"); -// checkHappy("_: mod(6e-18 6e-18 2e-18);", 0, "6 6 2"); -// checkHappy("_: mod(6e-18 7e-18 2e-18);", 0, "6 7 2"); -// checkHappy("_: mod(6e-18 max-value() 2e-18);", 0, "6 max-value() 2"); +// /// Test the eval of `mod` opcode parsed from a string. Tests three inputs. +// /// Tests the happy path where we do not modulo by zero. +// function testOpModEval3InputsHappy() external view { +// // Show that the modulo truncates (rounds down). +// checkHappy("_: mod(6e-18 1e-18 1e-18);", 0, "6 1 1"); +// checkHappy("_: mod(6e-18 2e-18 1e-18);", 0, "6 2 1"); +// checkHappy("_: mod(6e-18 3e-18 1e-18);", 0, "6 3 1"); +// checkHappy("_: mod(26e-18 20e-18 4e-18);", 2, "26 20 4"); +// checkHappy("_: mod(6e-18 4e-18 1e-18);", 0, "6 4 1"); +// checkHappy("_: mod(6e-18 5e-18 1e-18);", 0, "6 5 1"); +// checkHappy("_: mod(6e-18 6e-18 1e-18);", 0, "6 6 1"); +// checkHappy("_: mod(6e-18 7e-18 1e-18);", 0, "6 7 1"); +// checkHappy("_: mod(6e-18 max-value() 1e-18);", 0, "6 max-value() 1"); +// checkHappy("_: mod(6e-18 1e-18 2e-18);", 0, "6 1 2"); +// checkHappy("_: mod(6e-18 2e-18 2e-18);", 0, "6 2 2"); +// checkHappy("_: mod(6e-18 3e-18 2e-18);", 0, "6 3 2"); +// checkHappy("_: mod(6e-18 4e-18 2e-18);", 0, "6 4 2"); +// checkHappy("_: mod(6e-18 5e-18 2e-18);", 1, "6 5 2"); +// checkHappy("_: mod(6e-18 6e-18 2e-18);", 0, "6 6 2"); +// checkHappy("_: mod(6e-18 7e-18 2e-18);", 0, "6 7 2"); +// checkHappy("_: mod(6e-18 max-value() 2e-18);", 0, "6 max-value() 2"); // // Anything modulo by 1 is 0. // checkHappy("_: mod(0 1e-18 1e-18);", 0, "0 1 1"); diff --git a/test/src/lib/op/math/LibOpMul.t.sol b/test/src/lib/op/math/LibOpMul.t.sol index 154695cf2..f0105377b 100644 --- a/test/src/lib/op/math/LibOpMul.t.sol +++ b/test/src/lib/op/math/LibOpMul.t.sol @@ -12,7 +12,10 @@ // contract LibOpMulTest is OpTest { // /// Directly test the integrity logic of LibOpMul. This tests the // /// happy path where the inputs input and calc match. -// function testOpMulIntegrityHappy(IntegrityCheckStateNP memory state, uint8 inputs, uint16 operandData) external { +// function testOpMulIntegrityHappy(IntegrityCheckStateNP memory state, uint8 inputs, uint16 operandData) +// external +// pure +// { // inputs = uint8(bound(inputs, 2, 0x0F)); // (uint256 calcInputs, uint256 calcOutputs) = LibOpMul.integrity(state, LibOperand.build(inputs, 1, operandData)); @@ -20,23 +23,23 @@ // assertEq(calcOutputs, 1); // } -// /// Directly test the integrity logic of LibOpMul. This tests the -// /// unhappy path where the operand is invalid due to 0 inputs. -// function testOpMulIntegrityUnhappyZeroInputs(IntegrityCheckStateNP memory state) external { -// (uint256 calcInputs, uint256 calcOutputs) = LibOpMul.integrity(state, Operand.wrap(0)); -// // Calc inputs will be minimum 2. -// assertEq(calcInputs, 2); -// assertEq(calcOutputs, 1); -// } +// /// Directly test the integrity logic of LibOpMul. This tests the +// /// unhappy path where the operand is invalid due to 0 inputs. +// function testOpMulIntegrityUnhappyZeroInputs(IntegrityCheckStateNP memory state) external pure { +// (uint256 calcInputs, uint256 calcOutputs) = LibOpMul.integrity(state, Operand.wrap(0)); +// // Calc inputs will be minimum 2. +// assertEq(calcInputs, 2); +// assertEq(calcOutputs, 1); +// } -// /// Directly test the integrity logic of LibOpMul. This tests the -// /// unhappy path where the operand is invalid due to 1 inputs. -// function testOpDecimal18MulNPIntegrityUnhappyOneInput(IntegrityCheckStateNP memory state) external { -// (uint256 calcInputs, uint256 calcOutputs) = LibOpMul.integrity(state, Operand.wrap(0x010000)); -// // Calc inputs will be minimum 2. -// assertEq(calcInputs, 2); -// assertEq(calcOutputs, 1); -// } +// /// Directly test the integrity logic of LibOpMul. This tests the +// /// unhappy path where the operand is invalid due to 1 inputs. +// function testOpDecimal18MulNPIntegrityUnhappyOneInput(IntegrityCheckStateNP memory state) external pure { +// (uint256 calcInputs, uint256 calcOutputs) = LibOpMul.integrity(state, Operand.wrap(0x010000)); +// // Calc inputs will be minimum 2. +// assertEq(calcInputs, 2); +// assertEq(calcOutputs, 1); +// } // /// Directly test the runtime logic of LibOpMul. // function testOpMulRun(uint256[] memory inputs) public { @@ -82,23 +85,23 @@ // checkBadOutputs("_ _: mul(0 0);", 2, 1, 2); // } -// /// Test the eval of `mul` opcode parsed from a string. -// /// Tests two inputs. -// /// Tests the happy path where we do not overflow. -// function testOpMulEvalTwoInputsHappy() external { -// checkHappy("_: mul(0 1);", 0, "0 1"); -// checkHappy("_: mul(1 1);", 1e18, "1 1"); -// checkHappy("_: mul(1 2);", 2e18, "1 2"); -// checkHappy("_: mul(2 1);", 2e18, "2 1"); -// checkHappy("_: mul(2 2);", 4e18, "2 2"); -// checkHappy("_: mul(2 0.1);", 2e17, "2 0.1"); -// checkHappy("_: mul(1 0.1);", 1e17, "1 0.1"); -// checkHappy("_: mul(1 0.01);", 1e16, "1 0.01"); -// checkHappy("_: mul(0.001 0.001);", 1e12, "0.001 0.001"); -// checkHappy("_: mul(10 10);", 1e20, "10 10"); -// // Test an intermediate overflow. -// checkHappy("_: mul(1 max-value());", type(uint256).max, "1 max-value()"); -// } +// /// Test the eval of `mul` opcode parsed from a string. +// /// Tests two inputs. +// /// Tests the happy path where we do not overflow. +// function testOpMulEvalTwoInputsHappy() external view { +// checkHappy("_: mul(0 1);", 0, "0 1"); +// checkHappy("_: mul(1 1);", 1e18, "1 1"); +// checkHappy("_: mul(1 2);", 2e18, "1 2"); +// checkHappy("_: mul(2 1);", 2e18, "2 1"); +// checkHappy("_: mul(2 2);", 4e18, "2 2"); +// checkHappy("_: mul(2 0.1);", 2e17, "2 0.1"); +// checkHappy("_: mul(1 0.1);", 1e17, "1 0.1"); +// checkHappy("_: mul(1 0.01);", 1e16, "1 0.01"); +// checkHappy("_: mul(0.001 0.001);", 1e12, "0.001 0.001"); +// checkHappy("_: mul(10 10);", 1e20, "10 10"); +// // Test an intermediate overflow. +// checkHappy("_: mul(1 max-value());", type(uint256).max, "1 max-value()"); +// } // /// Test the eval of `mul` opcode parsed from a string. // /// Tests two inputs. @@ -111,26 +114,26 @@ // checkUnhappy("_: mul(1e52 1e12);", abi.encodeWithSelector(PRBMath_MulDiv18_Overflow.selector, 1e70, 1e30)); // } -// /// Test the eval of `mul` opcode parsed from a string. -// /// Tests three inputs. -// /// Tests the happy path where we do not divide by zero or overflow. -// function testOpMulEvalThreeInputsHappy() external { -// checkHappy("_: mul(0 0 0);", 0, "0 0 0"); -// checkHappy("_: mul(1 0 0);", 0, "1 0 0"); -// checkHappy("_: mul(1 1 0);", 0, "1 1 0"); -// checkHappy("_: mul(1 1 1);", 1e18, "1 1 1"); -// checkHappy("_: mul(1 1 2);", 2e18, "1 1 2"); -// checkHappy("_: mul(1 2 1);", 2e18, "1 2 1"); -// checkHappy("_: mul(2 1 1);", 2e18, "2 1 1"); -// checkHappy("_: mul(2 2 2);", 8e18, "2 2 2"); -// checkHappy("_: mul(2 0.1 1);", 2e17, "2 0.1 1"); -// checkHappy("_: mul(1 0.1 1);", 1e17, "1 0.1 1"); -// checkHappy("_: mul(1 0.01 1);", 1e16, "1 0.01 1"); -// checkHappy("_: mul(0.001 0.001 0.001);", 1e9, "0.001 0.001 0.001"); -// checkHappy("_: mul(10 10 10);", 1e21, "10 10 10"); -// // Test an intermediate overflow. -// checkHappy("_: mul(1 max-value() 1);", type(uint256).max, "1 max-value() 1"); -// } +// /// Test the eval of `mul` opcode parsed from a string. +// /// Tests three inputs. +// /// Tests the happy path where we do not divide by zero or overflow. +// function testOpMulEvalThreeInputsHappy() external view { +// checkHappy("_: mul(0 0 0);", 0, "0 0 0"); +// checkHappy("_: mul(1 0 0);", 0, "1 0 0"); +// checkHappy("_: mul(1 1 0);", 0, "1 1 0"); +// checkHappy("_: mul(1 1 1);", 1e18, "1 1 1"); +// checkHappy("_: mul(1 1 2);", 2e18, "1 1 2"); +// checkHappy("_: mul(1 2 1);", 2e18, "1 2 1"); +// checkHappy("_: mul(2 1 1);", 2e18, "2 1 1"); +// checkHappy("_: mul(2 2 2);", 8e18, "2 2 2"); +// checkHappy("_: mul(2 0.1 1);", 2e17, "2 0.1 1"); +// checkHappy("_: mul(1 0.1 1);", 1e17, "1 0.1 1"); +// checkHappy("_: mul(1 0.01 1);", 1e16, "1 0.01 1"); +// checkHappy("_: mul(0.001 0.001 0.001);", 1e9, "0.001 0.001 0.001"); +// checkHappy("_: mul(10 10 10);", 1e21, "10 10 10"); +// // Test an intermediate overflow. +// checkHappy("_: mul(1 max-value() 1);", type(uint256).max, "1 max-value() 1"); +// } // /// Test the eval of `mul` opcode parsed from a string. // /// Tests three inputs. diff --git a/test/src/lib/op/math/LibOpPow.t.sol b/test/src/lib/op/math/LibOpPow.t.sol index 01e5e0049..fe3d28874 100644 --- a/test/src/lib/op/math/LibOpPow.t.sol +++ b/test/src/lib/op/math/LibOpPow.t.sol @@ -1,5 +1,5 @@ -// // SPDX-License-Identifier: CAL -// pragma solidity =0.8.25; +// SPDX-License-Identifier: CAL +pragma solidity =0.8.25; // import {OpTest, IntegrityCheckStateNP, Operand, InterpreterStateNP, UnexpectedOperand} from "test/abstract/OpTest.sol"; // import {LibOpPow} from "src/lib/op/math/LibOpPow.sol"; @@ -8,14 +8,14 @@ // contract LibOpPowTest is OpTest { // /// Directly test the integrity logic of LibOpPow. // /// Inputs are always 2, outputs are always 1. -// function testOpPowIntegrity(IntegrityCheckStateNP memory state, Operand operand) external { +// function testOpPowIntegrity(IntegrityCheckStateNP memory state, Operand operand) external pure { // (uint256 calcInputs, uint256 calcOutputs) = LibOpPow.integrity(state, operand); // assertEq(calcInputs, 2); // assertEq(calcOutputs, 1); // } // /// Directly test the runtime logic of LibOpPow. -// function testOpPowRun(uint256 a, uint256 b) public { +// function testOpPowRun(uint256 a, uint256 b) public view { // // @TODO This is a hack to get around the fact that we are very likely // // to overflow uint256 if we just fuzz it, and that it's clunky to // // determine whether it will overflow or not. Basically the overflow @@ -34,27 +34,27 @@ // opReferenceCheck(state, operand, LibOpPow.referenceFn, LibOpPow.integrity, LibOpPow.run, inputs); // } -// /// Test the eval of `power`. -// function testOpPowEval() external { -// // 0 ^ 0 -// checkHappy("_: power(0 0);", 1e18, "0 0"); -// // 0 ^ 1 -// checkHappy("_: power(0 1);", 0, "0 1"); -// // 1e18 ^ 0 -// checkHappy("_: power(1 0);", 1e18, "1e18 0"); -// // 1 ^ 1 -// checkHappy("_: power(1 1);", 1e18, "1e18 1"); -// // 1 ^ 2 -// checkHappy("_: power(1 2);", 1e18, "1e18 2"); -// // 2 ^ 2 -// checkHappy("_: power(2 2);", 4e18, "2e18 2"); -// // 2 ^ 3 -// checkHappy("_: power(2 3);", 8e18, "2e18 3"); -// // 2 ^ 4 -// checkHappy("_: power(2 4);", 16e18, "2e18 4"); -// // sqrt 4 = 2 -// checkHappy("_: power(4 0.5);", 2e18, "4e18 5"); -// } +// /// Test the eval of `power`. +// function testOpPowEval() external view { +// // 0 ^ 0 +// checkHappy("_: power(0 0);", 1e18, "0 0"); +// // 0 ^ 1 +// checkHappy("_: power(0 1);", 0, "0 1"); +// // 1e18 ^ 0 +// checkHappy("_: power(1 0);", 1e18, "1e18 0"); +// // 1 ^ 1 +// checkHappy("_: power(1 1);", 1e18, "1e18 1"); +// // 1 ^ 2 +// checkHappy("_: power(1 2);", 1e18, "1e18 2"); +// // 2 ^ 2 +// checkHappy("_: power(2 2);", 4e18, "2e18 2"); +// // 2 ^ 3 +// checkHappy("_: power(2 3);", 8e18, "2e18 3"); +// // 2 ^ 4 +// checkHappy("_: power(2 4);", 16e18, "2e18 4"); +// // sqrt 4 = 2 +// checkHappy("_: power(4 0.5);", 2e18, "4e18 5"); +// } // /// Test the eval of `power` for bad inputs. // function testOpPowEvalOneInput() external { diff --git a/test/src/lib/op/math/LibOpScale18.t.sol b/test/src/lib/op/math/LibOpScale18.t.sol index 62ef45970..605c61b3e 100644 --- a/test/src/lib/op/math/LibOpScale18.t.sol +++ b/test/src/lib/op/math/LibOpScale18.t.sol @@ -9,7 +9,7 @@ // contract LibOpScale18Test is OpTest { // /// Directly test the integrity logic of LibOpScale18. // /// Inputs are always 1, outputs are always 1. -// function testOpScale18Integrity(IntegrityCheckStateNP memory state, uint8 inputs, uint16 op) external { +// function testOpScale18Integrity(IntegrityCheckStateNP memory state, uint8 inputs, uint16 op) external pure { // inputs = uint8(bound(inputs, 1, 0x0F)); // (uint256 calcInputs, uint256 calcOutputs) = LibOpScale18.integrity(state, LibOperand.build(inputs, 1, op)); // assertEq(calcInputs, 1); @@ -104,13 +104,13 @@ // checkUnhappy("_: scale-18<0>(1e52);", stdError.arithmeticError); // } -// /// Test the eval of `uint256-to-decimal18` which is an alias of `scale-18<0>`. -// function testOpUint256ToDecimal18Eval() external { -// checkHappy("_: uint256-to-decimal18(0);", 0, "0"); -// checkHappy("_: uint256-to-decimal18(1e-18);", 1e18, "1"); -// checkHappy("_: uint256-to-decimal18(2e-18);", 2e18, "2"); -// checkHappy("_: uint256-to-decimal18(1);", 1e36, "1e18"); -// } +// /// Test the eval of `uint256-to-decimal18` which is an alias of `scale-18<0>`. +// function testOpUint256ToDecimal18Eval() external view { +// checkHappy("_: uint256-to-decimal18(0);", 0, "0"); +// checkHappy("_: uint256-to-decimal18(1e-18);", 1e18, "1"); +// checkHappy("_: uint256-to-decimal18(2e-18);", 2e18, "2"); +// checkHappy("_: uint256-to-decimal18(1);", 1e36, "1e18"); +// } // /// Test the eval of `scale-18` opcode parsed from a string. // /// Tests zero inputs. diff --git a/test/src/lib/op/math/LibOpScale18Dynamic.t.sol b/test/src/lib/op/math/LibOpScale18Dynamic.t.sol index 9f73e497c..6b162733c 100644 --- a/test/src/lib/op/math/LibOpScale18Dynamic.t.sol +++ b/test/src/lib/op/math/LibOpScale18Dynamic.t.sol @@ -11,7 +11,7 @@ // contract LibOpScale18DynamicTest is OpTest { // /// Directly test the integrity logic of LibOpScale18Dynamic. // /// Inputs are always 2, outputs are always 1. -// function testOpScale18DynamicIntegrity(IntegrityCheckStateNP memory state, uint8 inputs, uint16 op) external { +// function testOpScale18DynamicIntegrity(IntegrityCheckStateNP memory state, uint8 inputs, uint16 op) external pure { // inputs = uint8(bound(inputs, 2, 0x0F)); // (uint256 calcInputs, uint256 calcOutputs) = // LibOpScale18Dynamic.integrity(state, LibOperand.build(inputs, 1, op)); diff --git a/test/src/lib/op/math/LibOpScaleN.t.sol b/test/src/lib/op/math/LibOpScaleN.t.sol index 973f84e2f..b68fa0e84 100644 --- a/test/src/lib/op/math/LibOpScaleN.t.sol +++ b/test/src/lib/op/math/LibOpScaleN.t.sol @@ -9,7 +9,7 @@ // contract LibOpScaleNTest is OpTest { // /// Directly test the integrity logic of LibOpScaleN. // /// Inputs are always 1, outputs are always 1. -// function testOpScaleNIntegrity(IntegrityCheckStateNP memory state, uint8 inputs, uint16 op) external { +// function testOpScaleNIntegrity(IntegrityCheckStateNP memory state, uint8 inputs, uint16 op) external pure { // inputs = uint8(bound(inputs, 1, 0x0F)); // (uint256 calcInputs, uint256 calcOutputs) = LibOpScaleN.integrity(state, LibOperand.build(inputs, 1, op)); // assertEq(calcInputs, 1); @@ -105,16 +105,16 @@ // checkUnhappy("_: scale-n<36>(1e52);", stdError.arithmeticError); // } -// /// Test the eval of `decimal18-to-uint256` which is an alias of `scale-n<0>`. -// function testOpDecimal18ToIntNPEval() external { -// checkHappy("_: decimal18-to-uint256(0);", 0, "0 0 0 0"); -// checkHappy("_: decimal18-to-uint256(1e-18);", 0, "0 1 0 0"); -// checkHappy("_: decimal18-to-uint256(0.5);", 0, "0 5e17 0 0"); -// checkHappy("_: decimal18-to-uint256(1);", 1, "0 1e18 0 0"); -// checkHappy("_: decimal18-to-uint256(1.5);", 1, "0 15e17 0 0"); -// checkHappy("_: decimal18-to-uint256(1.9);", 1, "0 19e17 0 0"); -// checkHappy("_: decimal18-to-uint256(2);", 2, "0 2e18 0 0"); -// } +// /// Test the eval of `decimal18-to-uint256` which is an alias of `scale-n<0>`. +// function testOpDecimal18ToIntNPEval() external view { +// checkHappy("_: decimal18-to-uint256(0);", 0, "0 0 0 0"); +// checkHappy("_: decimal18-to-uint256(1e-18);", 0, "0 1 0 0"); +// checkHappy("_: decimal18-to-uint256(0.5);", 0, "0 5e17 0 0"); +// checkHappy("_: decimal18-to-uint256(1);", 1, "0 1e18 0 0"); +// checkHappy("_: decimal18-to-uint256(1.5);", 1, "0 15e17 0 0"); +// checkHappy("_: decimal18-to-uint256(1.9);", 1, "0 19e17 0 0"); +// checkHappy("_: decimal18-to-uint256(2);", 2, "0 2e18 0 0"); +// } // /// Test the eval of `scale-n` opcode parsed from a string. // /// Tests zero inputs. diff --git a/test/src/lib/op/math/LibOpScaleNDynamic.t.sol b/test/src/lib/op/math/LibOpScaleNDynamic.t.sol index 6ae1d12fd..27a91f659 100644 --- a/test/src/lib/op/math/LibOpScaleNDynamic.t.sol +++ b/test/src/lib/op/math/LibOpScaleNDynamic.t.sol @@ -11,7 +11,7 @@ // contract LibOpScaleNDynamicTest is OpTest { // /// Directly test the integrity logic of LibOpScaleNDynamic. // /// Inputs are always 2, outputs are always 1. -// function testOpScaleNDynamicIntegrity(IntegrityCheckStateNP memory state, uint8 inputs, uint16 op) external { +// function testOpScaleNDynamicIntegrity(IntegrityCheckStateNP memory state, uint8 inputs, uint16 op) external pure { // inputs = uint8(bound(inputs, 2, 0x0F)); // (uint256 calcInputs, uint256 calcOutputs) = LibOpScaleNDynamic.integrity(state, LibOperand.build(inputs, 1, op)); // assertEq(calcInputs, 2); diff --git a/test/src/lib/op/math/LibOpSnapToUnit.t.sol b/test/src/lib/op/math/LibOpSnapToUnit.t.sol index 59e8d0d31..58b26e16b 100644 --- a/test/src/lib/op/math/LibOpSnapToUnit.t.sol +++ b/test/src/lib/op/math/LibOpSnapToUnit.t.sol @@ -8,14 +8,14 @@ // contract LibOpSnapToUnitTest is OpTest { // /// Directly test the integrity logic of LibOpSnapToUnit. // /// Inputs are always 2, outputs are always 1. -// function testOpSnapToUnitIntegrity(IntegrityCheckStateNP memory state, Operand operand) external { +// function testOpSnapToUnitIntegrity(IntegrityCheckStateNP memory state, Operand operand) external pure { // (uint256 calcInputs, uint256 calcOutputs) = LibOpSnapToUnit.integrity(state, operand); // assertEq(calcInputs, 2); // assertEq(calcOutputs, 1); // } // /// Directly test the runtime logic of LibOpSnapToUnit. -// function testOpSnapToUnitRun(uint256 threshold, uint256 value) public { +// function testOpSnapToUnitRun(uint256 threshold, uint256 value) public view { // InterpreterStateNP memory state = opTestDefaultInterpreterState(); // value = bound(value, 0, type(uint64).max - 1e18); @@ -29,13 +29,13 @@ // ); // } -// /// Test the eval of `snap-to-unit`. -// function testOpSnapToUnitEval() external { -// // If the threshold is 1 then we always floor. -// checkHappy("_: snap-to-unit(1 1);", 1e18, "1 1"); -// checkHappy("_: snap-to-unit(1 0.5);", 0, "1 0.5"); -// checkHappy("_: snap-to-unit(1 2);", 2e18, "1 2"); -// checkHappy("_: snap-to-unit(1 2.5);", 2e18, "1 2.5"); +// /// Test the eval of `snap-to-unit`. +// function testOpSnapToUnitEval() external view { +// // If the threshold is 1 then we always floor. +// checkHappy("_: snap-to-unit(1 1);", 1e18, "1 1"); +// checkHappy("_: snap-to-unit(1 0.5);", 0, "1 0.5"); +// checkHappy("_: snap-to-unit(1 2);", 2e18, "1 2"); +// checkHappy("_: snap-to-unit(1 2.5);", 2e18, "1 2.5"); // // If the threshold is 0.2 then we floor or ceil anything within the // // threshold. diff --git a/test/src/lib/op/math/LibOpSqrt.t.sol b/test/src/lib/op/math/LibOpSqrt.t.sol index 99f11ef98..5a0c50f8d 100644 --- a/test/src/lib/op/math/LibOpSqrt.t.sol +++ b/test/src/lib/op/math/LibOpSqrt.t.sol @@ -8,14 +8,14 @@ // contract LibOpSqrtTest is OpTest { // /// Directly test the integrity logic of LibOpSqrt. // /// Inputs are always 1, outputs are always 1. -// function testOpSqrtIntegrity(IntegrityCheckStateNP memory state, Operand operand) external { +// function testOpSqrtIntegrity(IntegrityCheckStateNP memory state, Operand operand) external pure { // (uint256 calcInputs, uint256 calcOutputs) = LibOpSqrt.integrity(state, operand); // assertEq(calcInputs, 1); // assertEq(calcOutputs, 1); // } // /// Directly test the runtime logic of LibOpSqrt. -// function testOpSqrtRun(uint256 a) public { +// function testOpSqrtRun(uint256 a) public view { // a = bound(a, 0, type(uint64).max - 1e18); // InterpreterStateNP memory state = opTestDefaultInterpreterState(); @@ -26,14 +26,14 @@ // opReferenceCheck(state, operand, LibOpSqrt.referenceFn, LibOpSqrt.integrity, LibOpSqrt.run, inputs); // } -// /// Test the eval of `sqrt`. -// function testOpSqrtEval() external { -// checkHappy("_: sqrt(0);", 0, "0"); -// checkHappy("_: sqrt(1);", 1e18, "1"); -// checkHappy("_: sqrt(0.5);", 707106781186547524, "0.5"); -// checkHappy("_: sqrt(2);", 1414213562373095048, "2"); -// checkHappy("_: sqrt(2.5);", 1581138830084189665, "2.5"); -// } +// /// Test the eval of `sqrt`. +// function testOpSqrtEval() external view { +// checkHappy("_: sqrt(0);", 0, "0"); +// checkHappy("_: sqrt(1);", 1e18, "1"); +// checkHappy("_: sqrt(0.5);", 707106781186547524, "0.5"); +// checkHappy("_: sqrt(2);", 1414213562373095048, "2"); +// checkHappy("_: sqrt(2.5);", 1581138830084189665, "2.5"); +// } // /// Test the eval of `sqrt` for bad inputs. // function testOpSqrtEvalBad() external { diff --git a/test/src/lib/op/math/LibOpSub.t.sol b/test/src/lib/op/math/LibOpSub.t.sol index 9819b6eca..4c4ef644f 100644 --- a/test/src/lib/op/math/LibOpSub.t.sol +++ b/test/src/lib/op/math/LibOpSub.t.sol @@ -8,7 +8,10 @@ // contract LibOpSubTest is OpTest { // /// Directly test the integrity logic of LibOpSub. This tests the happy // /// path where the inputs input and calc match. -// function testOpSubIntegrityHappy(IntegrityCheckStateNP memory state, uint8 inputs, uint16 operandData) external { +// function testOpSubIntegrityHappy(IntegrityCheckStateNP memory state, uint8 inputs, uint16 operandData) +// external +// pure +// { // inputs = uint8(bound(inputs, 2, 0x0F)); // (uint256 calcInputs, uint256 calcOutputs) = LibOpSub.integrity(state, LibOperand.build(inputs, 1, operandData)); @@ -16,23 +19,23 @@ // assertEq(calcOutputs, 1); // } -// /// Directly test the integrity logic of LibOpSub. This tests the unhappy -// /// path where the operand is invalid due to 0 inputs. -// function testOpSubIntegrityUnhappyZeroInputs(IntegrityCheckStateNP memory state) external { -// (uint256 calcInputs, uint256 calcOutputs) = LibOpSub.integrity(state, Operand.wrap(0)); -// // Calc inputs will be minimum 2. -// assertEq(calcInputs, 2); -// assertEq(calcOutputs, 1); -// } +// /// Directly test the integrity logic of LibOpSub. This tests the unhappy +// /// path where the operand is invalid due to 0 inputs. +// function testOpSubIntegrityUnhappyZeroInputs(IntegrityCheckStateNP memory state) external pure { +// (uint256 calcInputs, uint256 calcOutputs) = LibOpSub.integrity(state, Operand.wrap(0)); +// // Calc inputs will be minimum 2. +// assertEq(calcInputs, 2); +// assertEq(calcOutputs, 1); +// } -// /// Directly test the integrity logic of LibOpSub. This tests the unhappy -// /// path where the operand is invalid due to 1 inputs. -// function testOpSubIntegrityUnhappyOneInput(IntegrityCheckStateNP memory state) external { -// (uint256 calcInputs, uint256 calcOutputs) = LibOpSub.integrity(state, Operand.wrap(0x010000)); -// // Calc inputs will be minimum 2. -// assertEq(calcInputs, 2); -// assertEq(calcOutputs, 1); -// } +// /// Directly test the integrity logic of LibOpSub. This tests the unhappy +// /// path where the operand is invalid due to 1 inputs. +// function testOpSubIntegrityUnhappyOneInput(IntegrityCheckStateNP memory state) external pure { +// (uint256 calcInputs, uint256 calcOutputs) = LibOpSub.integrity(state, Operand.wrap(0x010000)); +// // Calc inputs will be minimum 2. +// assertEq(calcInputs, 2); +// assertEq(calcOutputs, 1); +// } // /// Directly test the runtime logic of LibOpSub. // function testOpSubRun(uint256[] memory inputs) external { @@ -92,27 +95,27 @@ // checkBadInputs("_: saturating-sub(max-value());", 1, 2, 1); // } -// /// Test the eval of `sub` opcode parsed from a string. Tests two inputs. -// function testOpSubEvalTwoInputs() external { -// checkHappy("_: sub(1e-18 0);", 1, "1 0"); -// checkHappy("_: sub(1e-18 1e-18);", 0, "1 1"); -// checkHappy("_: sub(2e-18 1e-18);", 1, "2 1"); -// checkHappy("_: sub(2e-18 2e-18);", 0, "2 2"); -// checkHappy("_: sub(max-value() 0);", type(uint256).max, "max-value() 0"); -// checkHappy("_: sub(max-value() 1e-18);", type(uint256).max - 1, "max-value() 1"); -// checkHappy("_: sub(max-value() max-value());", 0, "max-value() max-value()"); -// } +// /// Test the eval of `sub` opcode parsed from a string. Tests two inputs. +// function testOpSubEvalTwoInputs() external view { +// checkHappy("_: sub(1e-18 0);", 1, "1 0"); +// checkHappy("_: sub(1e-18 1e-18);", 0, "1 1"); +// checkHappy("_: sub(2e-18 1e-18);", 1, "2 1"); +// checkHappy("_: sub(2e-18 2e-18);", 0, "2 2"); +// checkHappy("_: sub(max-value() 0);", type(uint256).max, "max-value() 0"); +// checkHappy("_: sub(max-value() 1e-18);", type(uint256).max - 1, "max-value() 1"); +// checkHappy("_: sub(max-value() max-value());", 0, "max-value() max-value()"); +// } -// /// Test the eval of `sub` opcode parsed from a string. Tests two inputs. -// /// Test that saturating does not change the result. -// function testOpSubEvalTwoInputsSaturating() external { -// checkHappy("_: sub<1>(1e-18 0);", 1, "1 0"); -// checkHappy("_: sub<1>(1e-18 1e-18);", 0, "1 1"); -// checkHappy("_: sub<1>(2e-18 1e-18);", 1, "2 1"); -// checkHappy("_: sub<1>(2e-18 2e-18);", 0, "2 2"); -// checkHappy("_: sub<1>(max-value() 0);", type(uint256).max, "max-value() 0"); -// checkHappy("_: sub<1>(max-value() 1e-18);", type(uint256).max - 1, "max-value() 1"); -// checkHappy("_: sub<1>(max-value() max-value());", 0, "max-value() max-value()"); +// /// Test the eval of `sub` opcode parsed from a string. Tests two inputs. +// /// Test that saturating does not change the result. +// function testOpSubEvalTwoInputsSaturating() external view { +// checkHappy("_: sub<1>(1e-18 0);", 1, "1 0"); +// checkHappy("_: sub<1>(1e-18 1e-18);", 0, "1 1"); +// checkHappy("_: sub<1>(2e-18 1e-18);", 1, "2 1"); +// checkHappy("_: sub<1>(2e-18 2e-18);", 0, "2 2"); +// checkHappy("_: sub<1>(max-value() 0);", type(uint256).max, "max-value() 0"); +// checkHappy("_: sub<1>(max-value() 1e-18);", type(uint256).max - 1, "max-value() 1"); +// checkHappy("_: sub<1>(max-value() max-value());", 0, "max-value() max-value()"); // checkHappy("_: saturating-sub(1e-18 0);", 1, "1 0"); // checkHappy("_: saturating-sub(1e-18 1e-18);", 0, "1 1"); @@ -131,33 +134,33 @@ // checkUnhappyOverflow("_: sub(2e-18 3e-18);"); // } -// /// Test the eval of `sub` opcode parsed from a string. Tests two inputs. -// /// Tests saturating on an underflow. -// function testOpSubEval2InputsSaturatingUnderflow() external { -// checkHappy("_: sub<1>(0 1e-18);", 0, "0 1"); -// checkHappy("_: sub<1>(1e-18 2e-18);", 0, "1 2"); -// checkHappy("_: sub<1>(2e-18 3e-18);", 0, "2 3"); +// /// Test the eval of `sub` opcode parsed from a string. Tests two inputs. +// /// Tests saturating on an underflow. +// function testOpSubEval2InputsSaturatingUnderflow() external view { +// checkHappy("_: sub<1>(0 1e-18);", 0, "0 1"); +// checkHappy("_: sub<1>(1e-18 2e-18);", 0, "1 2"); +// checkHappy("_: sub<1>(2e-18 3e-18);", 0, "2 3"); // checkHappy("_: saturating-sub(0 1e-18);", 0, "0 1"); // checkHappy("_: saturating-sub(1e-18 2e-18);", 0, "1 2"); // checkHappy("_: saturating-sub(2e-18 3e-18);", 0, "2 3"); // } -// /// Test the eval of `sub` opcode parsed from a string. Tests three inputs. -// function testOpSubEvalThreeInputs() external { -// checkHappy("_: sub(1e-18 0 0);", 1, "1 0 0"); -// checkHappy("_: sub(1e-18 1e-18 0);", 0, "1 1 0"); -// checkHappy("_: sub(2e-18 1e-18 1e-18);", 0, "2 1 1"); -// checkHappy("_: sub(2e-18 2e-18 0);", 0, "2 2 0"); -// } +// /// Test the eval of `sub` opcode parsed from a string. Tests three inputs. +// function testOpSubEvalThreeInputs() external view { +// checkHappy("_: sub(1e-18 0 0);", 1, "1 0 0"); +// checkHappy("_: sub(1e-18 1e-18 0);", 0, "1 1 0"); +// checkHappy("_: sub(2e-18 1e-18 1e-18);", 0, "2 1 1"); +// checkHappy("_: sub(2e-18 2e-18 0);", 0, "2 2 0"); +// } -// /// Test the eval of `sub` opcode parsed from a string. Tests three inputs. -// /// Test that saturating does not change the result. -// function testOpSubEvalThreeInputsSaturating() external { -// checkHappy("_: sub<1>(1e-18 0 0);", 1, "1 0 0"); -// checkHappy("_: sub<1>(1e-18 1e-18 0);", 0, "1 1 0"); -// checkHappy("_: sub<1>(2e-18 1e-18 1e-18);", 0, "2 1 1"); -// checkHappy("_: sub<1>(2e-18 2e-18 0);", 0, "2 2 0"); +// /// Test the eval of `sub` opcode parsed from a string. Tests three inputs. +// /// Test that saturating does not change the result. +// function testOpSubEvalThreeInputsSaturating() external view { +// checkHappy("_: sub<1>(1e-18 0 0);", 1, "1 0 0"); +// checkHappy("_: sub<1>(1e-18 1e-18 0);", 0, "1 1 0"); +// checkHappy("_: sub<1>(2e-18 1e-18 1e-18);", 0, "2 1 1"); +// checkHappy("_: sub<1>(2e-18 2e-18 0);", 0, "2 2 0"); // checkHappy("_: saturating-sub(1e-18 0 0);", 1, "1 0 0"); // checkHappy("_: saturating-sub(1e-18 1e-18 0);", 0, "1 1 0"); @@ -177,16 +180,16 @@ // checkUnhappyOverflow("_: sub(2e-18 2e-18 1e-18);"); // } -// /// Test the eval of `sub` opcocde parsed from a string. Tests three inputs. -// /// Tests saturating on an underflow. -// function testOpSubEval3InputsSaturatingUnderflow() external { -// checkHappy("_: sub<1>(0 0 1e-18);", 0, "0 0 1"); -// checkHappy("_: sub<1>(0 1e-18 2e-18);", 0, "0 1 2"); -// checkHappy("_: sub<1>(1e-18 1e-18 1e-18);", 0, "1 1 1"); -// checkHappy("_: sub<1>(1e-18 2e-18 3e-18);", 0, "1 2 3"); -// checkHappy("_: sub<1>(2e-18 3e-18 4e-18);", 0, "2 3 4"); -// checkHappy("_: sub<1>(3e-18 4e-18 5e-18);", 0, "3 4 5"); -// checkHappy("_: sub<1>(2e-18 2e-18 1e-18);", 0, "2 2 1"); +// /// Test the eval of `sub` opcocde parsed from a string. Tests three inputs. +// /// Tests saturating on an underflow. +// function testOpSubEval3InputsSaturatingUnderflow() external view { +// checkHappy("_: sub<1>(0 0 1e-18);", 0, "0 0 1"); +// checkHappy("_: sub<1>(0 1e-18 2e-18);", 0, "0 1 2"); +// checkHappy("_: sub<1>(1e-18 1e-18 1e-18);", 0, "1 1 1"); +// checkHappy("_: sub<1>(1e-18 2e-18 3e-18);", 0, "1 2 3"); +// checkHappy("_: sub<1>(2e-18 3e-18 4e-18);", 0, "2 3 4"); +// checkHappy("_: sub<1>(3e-18 4e-18 5e-18);", 0, "3 4 5"); +// checkHappy("_: sub<1>(2e-18 2e-18 1e-18);", 0, "2 2 1"); // checkHappy("_: saturating-sub(0 0 1e-18);", 0, "0 0 1"); // checkHappy("_: saturating-sub(0 1e-18 2e-18);", 0, "0 1 2"); diff --git a/test/src/lib/op/math/growth/LibOpExponentialGrowth.t.sol b/test/src/lib/op/math/growth/LibOpExponentialGrowth.t.sol index 1b8cad7f9..5ccc4456f 100644 --- a/test/src/lib/op/math/growth/LibOpExponentialGrowth.t.sol +++ b/test/src/lib/op/math/growth/LibOpExponentialGrowth.t.sol @@ -8,14 +8,14 @@ // contract LibOpExponentialGrowthTest is OpTest { // /// Directly test the integrity logic of LibOpExponentialGrowth. // /// Inputs are always 3, outputs are always 1. -// function testOpExponentialGrowthIntegrity(IntegrityCheckStateNP memory state, Operand operand) external { +// function testOpExponentialGrowthIntegrity(IntegrityCheckStateNP memory state, Operand operand) external pure { // (uint256 calcInputs, uint256 calcOutputs) = LibOpExponentialGrowth.integrity(state, operand); // assertEq(calcInputs, 3); // assertEq(calcOutputs, 1); // } // /// Directly test the runtime logic of LibOpExponentialGrowth. -// function testOpExponentialGrowthRun(uint256 a, uint256 r, uint256 t, uint16 operandData) public { +// function testOpExponentialGrowthRun(uint256 a, uint256 r, uint256 t, uint16 operandData) public view { // // @TODO This is a hack to cover some range that we can definitely // // handle but it doesn't cover the full range of the function. // a = bound(a, 0, type(uint64).max); @@ -41,24 +41,24 @@ // ); // } -// /// Test the eval of `exponential-growth`. -// function testOpExponentialGrowthEval() external { -// checkHappy("_: exponential-growth(0 0 0);", 0, "0 0 0"); -// checkHappy("_: exponential-growth(0 0.1 0);", 0, "0 0.1 0"); -// checkHappy("_: exponential-growth(0 0.1 1);", 0, "0 0.1 1"); -// checkHappy("_: exponential-growth(1 0.1 0);", 1e18, "1 0.1 0"); -// checkHappy("_: exponential-growth(1 0.1 1);", 1.1e18, "1 0.1 1"); -// // Not exactly 1.21 -// checkHappy("_: exponential-growth(1 0.1 2);", 1209999999999999974, "1 0.1 2"); -// // Not exactly 1.26905870629 -// checkHappy("_: exponential-growth(1 0.1 2.5);", 1269058706285883337, "1 0.1 2.5"); -// checkHappy("_: exponential-growth(1 0 2);", 1e18, "1 0 2"); -// checkHappy("_: exponential-growth(1 0.1 0.5);", 1048808848170151541, "1 0.1 0.5"); -// checkHappy("_: exponential-growth(2 0.1 0);", 2e18, "2 0.1 0"); -// checkHappy("_: exponential-growth(2 0.1 1);", 2.2e18, "2 0.1 1"); -// // Not exactly 2.42 -// checkHappy("_: exponential-growth(2 0.1 2);", 2419999999999999948, "2 0.1 2"); -// } +// /// Test the eval of `exponential-growth`. +// function testOpExponentialGrowthEval() external view { +// checkHappy("_: exponential-growth(0 0 0);", 0, "0 0 0"); +// checkHappy("_: exponential-growth(0 0.1 0);", 0, "0 0.1 0"); +// checkHappy("_: exponential-growth(0 0.1 1);", 0, "0 0.1 1"); +// checkHappy("_: exponential-growth(1 0.1 0);", 1e18, "1 0.1 0"); +// checkHappy("_: exponential-growth(1 0.1 1);", 1.1e18, "1 0.1 1"); +// // Not exactly 1.21 +// checkHappy("_: exponential-growth(1 0.1 2);", 1209999999999999974, "1 0.1 2"); +// // Not exactly 1.26905870629 +// checkHappy("_: exponential-growth(1 0.1 2.5);", 1269058706285883337, "1 0.1 2.5"); +// checkHappy("_: exponential-growth(1 0 2);", 1e18, "1 0 2"); +// checkHappy("_: exponential-growth(1 0.1 0.5);", 1048808848170151541, "1 0.1 0.5"); +// checkHappy("_: exponential-growth(2 0.1 0);", 2e18, "2 0.1 0"); +// checkHappy("_: exponential-growth(2 0.1 1);", 2.2e18, "2 0.1 1"); +// // Not exactly 2.42 +// checkHappy("_: exponential-growth(2 0.1 2);", 2419999999999999948, "2 0.1 2"); +// } // function testOpExponentialGrowthEvalZeroInputs() external { // checkBadInputs(": exponential-growth();", 0, 3, 0); diff --git a/test/src/lib/op/math/growth/LibOpLinearGrowth.t.sol b/test/src/lib/op/math/growth/LibOpLinearGrowth.t.sol index cfd38bcae..12e1fdcb1 100644 --- a/test/src/lib/op/math/growth/LibOpLinearGrowth.t.sol +++ b/test/src/lib/op/math/growth/LibOpLinearGrowth.t.sol @@ -8,14 +8,14 @@ // contract LibOpLinearGrowthTest is OpTest { // /// Directly test the integrity logic of LibOpLinearGrowth. // /// Inputs are always 3, outputs are always 1. -// function testOpLinearGrowthIntegrity(IntegrityCheckStateNP memory state, Operand operand) external { +// function testOpLinearGrowthIntegrity(IntegrityCheckStateNP memory state, Operand operand) external pure { // (uint256 calcInputs, uint256 calcOutputs) = LibOpLinearGrowth.integrity(state, operand); // assertEq(calcInputs, 3); // assertEq(calcOutputs, 1); // } // /// Directly test the runtime logic of LibOpLinearGrowth. -// function testOpLinearGrowthRun(uint256 a, uint256 r, uint256 t, uint16 operandData) public { +// function testOpLinearGrowthRun(uint256 a, uint256 r, uint256 t, uint16 operandData) public view { // // @TODO This is a hack to cover some range that we can definitely // // handle but it doesn't cover the full range of the function. // a = bound(a, 0, type(uint128).max); @@ -36,21 +36,21 @@ // ); // } -// /// Test the eval of `linear-growth`. -// function testOpLinearGrowthEval() external { -// checkHappy("_: linear-growth(0 0 0);", 0, "0 0 0"); -// checkHappy("_: linear-growth(0 0.1 0);", 0, "0 0.1 0"); -// checkHappy("_: linear-growth(0 0.1 1);", 1e17, "0 0.1 1"); -// checkHappy("_: linear-growth(1 0.1 0);", 1e18, "1 0.1 0"); -// checkHappy("_: linear-growth(1 0.1 1);", 1.1e18, "1 0.1 1"); -// checkHappy("_: linear-growth(1 0.1 2);", 1.2e18, "1 0.1 2"); -// checkHappy("_: linear-growth(1 0.1 2.5);", 1.25e18, "1 0.1 2.5"); -// checkHappy("_: linear-growth(1 0 2);", 1e18, "1 0 2"); -// checkHappy("_: linear-growth(1 0.1 0.5);", 1.05e18, "1 0.1 0.5"); -// checkHappy("_: linear-growth(2 0.1 0);", 2e18, "2 0.1 0"); -// checkHappy("_: linear-growth(2 0.1 1);", 2.1e18, "2 0.1 1"); -// checkHappy("_: linear-growth(2 0.1 2);", 2.2e18, "2 0.1 2"); -// } +// /// Test the eval of `linear-growth`. +// function testOpLinearGrowthEval() external view { +// checkHappy("_: linear-growth(0 0 0);", 0, "0 0 0"); +// checkHappy("_: linear-growth(0 0.1 0);", 0, "0 0.1 0"); +// checkHappy("_: linear-growth(0 0.1 1);", 1e17, "0 0.1 1"); +// checkHappy("_: linear-growth(1 0.1 0);", 1e18, "1 0.1 0"); +// checkHappy("_: linear-growth(1 0.1 1);", 1.1e18, "1 0.1 1"); +// checkHappy("_: linear-growth(1 0.1 2);", 1.2e18, "1 0.1 2"); +// checkHappy("_: linear-growth(1 0.1 2.5);", 1.25e18, "1 0.1 2.5"); +// checkHappy("_: linear-growth(1 0 2);", 1e18, "1 0 2"); +// checkHappy("_: linear-growth(1 0.1 0.5);", 1.05e18, "1 0.1 0.5"); +// checkHappy("_: linear-growth(2 0.1 0);", 2e18, "2 0.1 0"); +// checkHappy("_: linear-growth(2 0.1 1);", 2.1e18, "2 0.1 1"); +// checkHappy("_: linear-growth(2 0.1 2);", 2.2e18, "2 0.1 2"); +// } // function testOpLinearGrowthEvalZeroInputs() external { // checkBadInputs(": linear-growth();", 0, 3, 0); diff --git a/test/src/lib/op/math/int/LibOpUint256Div.t.sol b/test/src/lib/op/math/int/LibOpUint256Div.t.sol index ed17f7701..cf2b37212 100644 --- a/test/src/lib/op/math/int/LibOpUint256Div.t.sol +++ b/test/src/lib/op/math/int/LibOpUint256Div.t.sol @@ -12,6 +12,7 @@ // /// path where the inputs input and calc match. // function testOpUint256DivIntegrityHappy(IntegrityCheckStateNP memory state, uint8 inputs, uint16 operandData) // external +// pure // { // inputs = uint8(bound(inputs, 2, 0x0F)); // (uint256 calcInputs, uint256 calcOutputs) = @@ -21,23 +22,23 @@ // assertEq(calcOutputs, 1); // } -// /// Directly test the integrity logic of LibOpUint256Div. This tests the unhappy -// /// path where the operand is invalid due to 0 inputs. -// function testOpUint256DivIntegrityUnhappyZeroInputs(IntegrityCheckStateNP memory state) external { -// (uint256 calcInputs, uint256 calcOutputs) = LibOpUint256Div.integrity(state, Operand.wrap(0)); -// // Calc inputs will be minimum 2. -// assertEq(calcInputs, 2); -// assertEq(calcOutputs, 1); -// } +// /// Directly test the integrity logic of LibOpUint256Div. This tests the unhappy +// /// path where the operand is invalid due to 0 inputs. +// function testOpUint256DivIntegrityUnhappyZeroInputs(IntegrityCheckStateNP memory state) external pure { +// (uint256 calcInputs, uint256 calcOutputs) = LibOpUint256Div.integrity(state, Operand.wrap(0)); +// // Calc inputs will be minimum 2. +// assertEq(calcInputs, 2); +// assertEq(calcOutputs, 1); +// } -// /// Directly test the integrity logic of LibOpUint256Div. This tests the unhappy -// /// path where the operand is invalid due to 1 inputs. -// function testOpUint256DivIntegrityUnhappyOneInput(IntegrityCheckStateNP memory state) external { -// (uint256 calcInputs, uint256 calcOutputs) = LibOpUint256Div.integrity(state, Operand.wrap(0x010000)); -// // Calc inputs will be minimum 2. -// assertEq(calcInputs, 2); -// assertEq(calcOutputs, 1); -// } +// /// Directly test the integrity logic of LibOpUint256Div. This tests the unhappy +// /// path where the operand is invalid due to 1 inputs. +// function testOpUint256DivIntegrityUnhappyOneInput(IntegrityCheckStateNP memory state) external pure { +// (uint256 calcInputs, uint256 calcOutputs) = LibOpUint256Div.integrity(state, Operand.wrap(0x010000)); +// // Calc inputs will be minimum 2. +// assertEq(calcInputs, 2); +// assertEq(calcOutputs, 1); +// } // /// Directly test the runtime logic of LibOpUint256Div. // function testOpUint256DivRun(uint256[] memory inputs) external { @@ -81,19 +82,19 @@ // checkBadOutputs("_ _: uint256-div(0 0);", 2, 1, 2); // } -// /// Test the eval of `uint256-div` opcode parsed from a string. Tests two inputs. -// /// Tests the happy path where we do not divide by zero. -// /// Note that the division truncates (rounds down). -// function testOpUint256DivEval2InputsHappy() external { -// // Show that the division truncates (rounds down). -// checkHappy("_: uint256-div(6e-18 1e-18);", 6, "6 / 1"); -// checkHappy("_: uint256-div(6e-18 2e-18);", 3, "6 / 2"); -// checkHappy("_: uint256-div(6e-18 3e-18);", 2, "6 / 3"); -// checkHappy("_: uint256-div(6e-18 4e-18);", 1, "6 / 4"); -// checkHappy("_: uint256-div(6e-18 5e-18);", 1, "6 / 5"); -// checkHappy("_: uint256-div(6e-18 6e-18);", 1, "6 / 6"); -// checkHappy("_: uint256-div(6e-18 7e-18);", 0, "6 / 7"); -// checkHappy("_: uint256-div(6e-18 max-value());", 0, "6 / max-value()"); +// /// Test the eval of `uint256-div` opcode parsed from a string. Tests two inputs. +// /// Tests the happy path where we do not divide by zero. +// /// Note that the division truncates (rounds down). +// function testOpUint256DivEval2InputsHappy() external view { +// // Show that the division truncates (rounds down). +// checkHappy("_: uint256-div(6e-18 1e-18);", 6, "6 / 1"); +// checkHappy("_: uint256-div(6e-18 2e-18);", 3, "6 / 2"); +// checkHappy("_: uint256-div(6e-18 3e-18);", 2, "6 / 3"); +// checkHappy("_: uint256-div(6e-18 4e-18);", 1, "6 / 4"); +// checkHappy("_: uint256-div(6e-18 5e-18);", 1, "6 / 5"); +// checkHappy("_: uint256-div(6e-18 6e-18);", 1, "6 / 6"); +// checkHappy("_: uint256-div(6e-18 7e-18);", 0, "6 / 7"); +// checkHappy("_: uint256-div(6e-18 max-value());", 0, "6 / max-value()"); // // Anything divided by 1 is itself. // checkHappy("_: uint256-div(0 1e-18);", 0, "0 / 1"); @@ -117,26 +118,26 @@ // checkUnhappy("_: uint256-div(max-value() 0);", stdError.divisionError); // } -// /// Test the eval of `uint256-div` opcode parsed from a string. Tests three inputs. -// /// Tests the happy path where we do not divide by zero. -// function testOpUint256DivEval3InputsHappy() external { -// // Show that the division truncates (rounds down). -// checkHappy("_: uint256-div(6e-18 1e-18 1e-18);", 6, "6 / 1 / 1"); -// checkHappy("_: uint256-div(6e-18 2e-18 1e-18);", 3, "6 / 2 / 1"); -// checkHappy("_: uint256-div(6e-18 3e-18 1e-18);", 2, "6 / 3 / 1"); -// checkHappy("_: uint256-div(6e-18 4e-18 1e-18);", 1, "6 / 4 / 1"); -// checkHappy("_: uint256-div(6e-18 5e-18 1e-18);", 1, "6 / 5 / 1"); -// checkHappy("_: uint256-div(6e-18 6e-18 1e-18);", 1, "6 / 6 / 1"); -// checkHappy("_: uint256-div(6e-18 7e-18 1e-18);", 0, "6 / 7 / 1"); -// checkHappy("_: uint256-div(6e-18 max-value() 1e-18);", 0, "6 / max-value() / 1"); -// checkHappy("_: uint256-div(6e-18 1e-18 2e-18);", 3, "6 / 1 / 2"); -// checkHappy("_: uint256-div(6e-18 2e-18 2e-18);", 1, "6 / 2 / 2"); -// checkHappy("_: uint256-div(6e-18 3e-18 2e-18);", 1, "6 / 3 / 2"); -// checkHappy("_: uint256-div(6e-18 4e-18 2e-18);", 0, "6 / 4 / 2"); -// checkHappy("_: uint256-div(6e-18 5e-18 2e-18);", 0, "6 / 5 / 2"); -// checkHappy("_: uint256-div(6e-18 6e-18 2e-18);", 0, "6 / 6 / 2"); -// checkHappy("_: uint256-div(6e-18 7e-18 2e-18);", 0, "6 / 7 / 2"); -// checkHappy("_: uint256-div(6e-18 max-value() 2e-18);", 0, "6 / max-value() / 2"); +// /// Test the eval of `uint256-div` opcode parsed from a string. Tests three inputs. +// /// Tests the happy path where we do not divide by zero. +// function testOpUint256DivEval3InputsHappy() external view { +// // Show that the division truncates (rounds down). +// checkHappy("_: uint256-div(6e-18 1e-18 1e-18);", 6, "6 / 1 / 1"); +// checkHappy("_: uint256-div(6e-18 2e-18 1e-18);", 3, "6 / 2 / 1"); +// checkHappy("_: uint256-div(6e-18 3e-18 1e-18);", 2, "6 / 3 / 1"); +// checkHappy("_: uint256-div(6e-18 4e-18 1e-18);", 1, "6 / 4 / 1"); +// checkHappy("_: uint256-div(6e-18 5e-18 1e-18);", 1, "6 / 5 / 1"); +// checkHappy("_: uint256-div(6e-18 6e-18 1e-18);", 1, "6 / 6 / 1"); +// checkHappy("_: uint256-div(6e-18 7e-18 1e-18);", 0, "6 / 7 / 1"); +// checkHappy("_: uint256-div(6e-18 max-value() 1e-18);", 0, "6 / max-value() / 1"); +// checkHappy("_: uint256-div(6e-18 1e-18 2e-18);", 3, "6 / 1 / 2"); +// checkHappy("_: uint256-div(6e-18 2e-18 2e-18);", 1, "6 / 2 / 2"); +// checkHappy("_: uint256-div(6e-18 3e-18 2e-18);", 1, "6 / 3 / 2"); +// checkHappy("_: uint256-div(6e-18 4e-18 2e-18);", 0, "6 / 4 / 2"); +// checkHappy("_: uint256-div(6e-18 5e-18 2e-18);", 0, "6 / 5 / 2"); +// checkHappy("_: uint256-div(6e-18 6e-18 2e-18);", 0, "6 / 6 / 2"); +// checkHappy("_: uint256-div(6e-18 7e-18 2e-18);", 0, "6 / 7 / 2"); +// checkHappy("_: uint256-div(6e-18 max-value() 2e-18);", 0, "6 / max-value() / 2"); // // Anything divided by 1 is itself. // checkHappy("_: uint256-div(0 1e-18 1e-18);", 0, "0 / 1 / 1"); diff --git a/test/src/lib/op/math/int/LibOpUint256Mul.t.sol b/test/src/lib/op/math/int/LibOpUint256Mul.t.sol index e8e8c06f1..3d3d9bd49 100644 --- a/test/src/lib/op/math/int/LibOpUint256Mul.t.sol +++ b/test/src/lib/op/math/int/LibOpUint256Mul.t.sol @@ -10,6 +10,7 @@ // /// path where the inputs input and calc match. // function testOpUint256MulIntegrityHappy(IntegrityCheckStateNP memory state, uint8 inputs, uint16 operandData) // external +// pure // { // inputs = uint8(bound(inputs, 2, 0x0F)); // (uint256 calcInputs, uint256 calcOutputs) = @@ -19,23 +20,23 @@ // assertEq(calcOutputs, 1); // } -// /// Directly test the integrity logic of LibOpUint256Mul. This tests the unhappy -// /// path where the operand is invalid due to 0 inputs. -// function testOpUint256MulIntegrityUnhappyZeroInputs(IntegrityCheckStateNP memory state) external { -// (uint256 calcInputs, uint256 calcOutputs) = LibOpUint256Mul.integrity(state, Operand.wrap(0)); -// // Calc inputs will be minimum 2. -// assertEq(calcInputs, 2); -// assertEq(calcOutputs, 1); -// } +// /// Directly test the integrity logic of LibOpUint256Mul. This tests the unhappy +// /// path where the operand is invalid due to 0 inputs. +// function testOpUint256MulIntegrityUnhappyZeroInputs(IntegrityCheckStateNP memory state) external pure { +// (uint256 calcInputs, uint256 calcOutputs) = LibOpUint256Mul.integrity(state, Operand.wrap(0)); +// // Calc inputs will be minimum 2. +// assertEq(calcInputs, 2); +// assertEq(calcOutputs, 1); +// } -// /// Directly test the integrity logic of LibOpUint256Mul. This tests the unhappy -// /// path where the operand is invalid due to 1 inputs. -// function testOpUint256MulIntegrityUnhappyOneInput(IntegrityCheckStateNP memory state) external { -// (uint256 calcInputs, uint256 calcOutputs) = LibOpUint256Mul.integrity(state, Operand.wrap(0x010000)); -// // Calc inputs will be minimum 2. -// assertEq(calcInputs, 2); -// assertEq(calcOutputs, 1); -// } +// /// Directly test the integrity logic of LibOpUint256Mul. This tests the unhappy +// /// path where the operand is invalid due to 1 inputs. +// function testOpUint256MulIntegrityUnhappyOneInput(IntegrityCheckStateNP memory state) external pure { +// (uint256 calcInputs, uint256 calcOutputs) = LibOpUint256Mul.integrity(state, Operand.wrap(0x010000)); +// // Calc inputs will be minimum 2. +// assertEq(calcInputs, 2); +// assertEq(calcOutputs, 1); +// } // /// Directly test the runtime logic of LibOpUint256Mul. // function testOpUint256MulRun(uint256[] memory inputs) external { @@ -87,19 +88,19 @@ // checkBadOutputs("_ _: uint256-mul(0 0);", 2, 1, 2); // } -// /// Test the eval of `uint256-mul` opcode parsed from a string. Tests two inputs. -// /// Tests the happy path where multiplication does not overflow. -// function testOpUint256MulEvalTwoInputsHappy() external { -// checkHappy("_: uint256-mul(0 0);", 0, "0 0"); -// checkHappy("_: uint256-mul(0 1e-18);", 0, "0 1"); -// checkHappy("_: uint256-mul(1e-18 0);", 0, "1 0"); -// checkHappy("_: uint256-mul(1e-18 1e-18);", 1, "1 1"); -// checkHappy("_: uint256-mul(1e-18 2e-18);", 2, "1 2"); -// checkHappy("_: uint256-mul(2e-18 1e-18);", 2, "2 1"); -// checkHappy("_: uint256-mul(2e-18 2e-18);", 4, "2 2"); -// checkHappy("_: uint256-mul(max-value() 0);", 0, "max-value() 0"); -// checkHappy("_: uint256-mul(max-value() 1e-18);", type(uint256).max, "max-value() 1"); -// } +// /// Test the eval of `uint256-mul` opcode parsed from a string. Tests two inputs. +// /// Tests the happy path where multiplication does not overflow. +// function testOpUint256MulEvalTwoInputsHappy() external view { +// checkHappy("_: uint256-mul(0 0);", 0, "0 0"); +// checkHappy("_: uint256-mul(0 1e-18);", 0, "0 1"); +// checkHappy("_: uint256-mul(1e-18 0);", 0, "1 0"); +// checkHappy("_: uint256-mul(1e-18 1e-18);", 1, "1 1"); +// checkHappy("_: uint256-mul(1e-18 2e-18);", 2, "1 2"); +// checkHappy("_: uint256-mul(2e-18 1e-18);", 2, "2 1"); +// checkHappy("_: uint256-mul(2e-18 2e-18);", 4, "2 2"); +// checkHappy("_: uint256-mul(max-value() 0);", 0, "max-value() 0"); +// checkHappy("_: uint256-mul(max-value() 1e-18);", type(uint256).max, "max-value() 1"); +// } // /// Test the eval of `uint256-mul` opcode parsed from a string. Tests two inputs. // /// Tests the unhappy path where multiplication overflows. @@ -109,30 +110,30 @@ // checkUnhappyOverflow("_: uint256-mul(max-value() max-value());"); // } -// /// Test the eval of `uint256-mul` opcode parsed from a string. Tests three inputs. -// /// Tests the happy path where multiplication does not overflow. -// function testOpUint256MulEvalThreeInputsHappy() external { -// checkHappy("_: uint256-mul(0 0 0);", 0, "0 0 0"); -// checkHappy("_: uint256-mul(0 0 1e-18);", 0, "0 0 1"); -// checkHappy("_: uint256-mul(0 1e-18 0);", 0, "0 1 0"); -// checkHappy("_: uint256-mul(0 1e-18 1e-18);", 0, "0 1 1"); -// checkHappy("_: uint256-mul(1e-18 0 0);", 0, "1 0 0"); -// checkHappy("_: uint256-mul(1e-18 0 1e-18);", 0, "1 0 1"); -// checkHappy("_: uint256-mul(1e-18 1e-18 0);", 0, "1 1 0"); -// checkHappy("_: uint256-mul(1e-18 1e-18 1e-18);", 1, "1 1 1"); -// checkHappy("_: uint256-mul(1e-18 1e-18 2e-18);", 2, "1 1 2"); -// checkHappy("_: uint256-mul(1e-18 2e-18 1e-18);", 2, "1 2 1"); -// checkHappy("_: uint256-mul(1e-18 2e-18 2e-18);", 4, "1 2 2"); -// checkHappy("_: uint256-mul(2e-18 1e-18 1e-18);", 2, "2 1 1"); -// checkHappy("_: uint256-mul(2e-18 1e-18 2e-18);", 4, "2 1 2"); -// checkHappy("_: uint256-mul(2e-18 2e-18 1e-18);", 4, "2 2 1"); -// checkHappy("_: uint256-mul(2e-18 2e-18 2e-18);", 8, "2 2 2"); -// checkHappy("_: uint256-mul(max-value() 0 0);", 0, "max-value() 0 0"); -// checkHappy("_: uint256-mul(max-value() 0 1e-18);", 0, "max-value() 0 1"); -// checkHappy("_: uint256-mul(max-value() 0 2e-18);", 0, "max-value() 0 2"); -// checkHappy("_: uint256-mul(max-value() 1e-18 0);", 0, "max-value() 1 0"); -// checkHappy("_: uint256-mul(max-value() 1e-18 1e-18);", type(uint256).max, "max-value() 1 1"); -// } +// /// Test the eval of `uint256-mul` opcode parsed from a string. Tests three inputs. +// /// Tests the happy path where multiplication does not overflow. +// function testOpUint256MulEvalThreeInputsHappy() external view { +// checkHappy("_: uint256-mul(0 0 0);", 0, "0 0 0"); +// checkHappy("_: uint256-mul(0 0 1e-18);", 0, "0 0 1"); +// checkHappy("_: uint256-mul(0 1e-18 0);", 0, "0 1 0"); +// checkHappy("_: uint256-mul(0 1e-18 1e-18);", 0, "0 1 1"); +// checkHappy("_: uint256-mul(1e-18 0 0);", 0, "1 0 0"); +// checkHappy("_: uint256-mul(1e-18 0 1e-18);", 0, "1 0 1"); +// checkHappy("_: uint256-mul(1e-18 1e-18 0);", 0, "1 1 0"); +// checkHappy("_: uint256-mul(1e-18 1e-18 1e-18);", 1, "1 1 1"); +// checkHappy("_: uint256-mul(1e-18 1e-18 2e-18);", 2, "1 1 2"); +// checkHappy("_: uint256-mul(1e-18 2e-18 1e-18);", 2, "1 2 1"); +// checkHappy("_: uint256-mul(1e-18 2e-18 2e-18);", 4, "1 2 2"); +// checkHappy("_: uint256-mul(2e-18 1e-18 1e-18);", 2, "2 1 1"); +// checkHappy("_: uint256-mul(2e-18 1e-18 2e-18);", 4, "2 1 2"); +// checkHappy("_: uint256-mul(2e-18 2e-18 1e-18);", 4, "2 2 1"); +// checkHappy("_: uint256-mul(2e-18 2e-18 2e-18);", 8, "2 2 2"); +// checkHappy("_: uint256-mul(max-value() 0 0);", 0, "max-value() 0 0"); +// checkHappy("_: uint256-mul(max-value() 0 1e-18);", 0, "max-value() 0 1"); +// checkHappy("_: uint256-mul(max-value() 0 2e-18);", 0, "max-value() 0 2"); +// checkHappy("_: uint256-mul(max-value() 1e-18 0);", 0, "max-value() 1 0"); +// checkHappy("_: uint256-mul(max-value() 1e-18 1e-18);", type(uint256).max, "max-value() 1 1"); +// } // /// Test the eval of `uint256-mul` opcode parsed from a string. Tests three inputs. // /// Tests the unhappy path where multiplication overflows. diff --git a/test/src/lib/op/math/int/LibOpUint256Pow.t.sol b/test/src/lib/op/math/int/LibOpUint256Pow.t.sol index 86a6434fb..c1e25bf7a 100644 --- a/test/src/lib/op/math/int/LibOpUint256Pow.t.sol +++ b/test/src/lib/op/math/int/LibOpUint256Pow.t.sol @@ -17,36 +17,37 @@ // contract LibOpUint256PowTest is OpTest { // using LibUint256Array for uint256[]; -// /// Directly test the integrity logic of LibOpUint256Exp. This tests the happy -// /// path where the inputs input and calc match. -// function testOpUint256ExpIntegrityHappy(IntegrityCheckStateNP memory state, uint8 inputs, uint16 operandData) -// external -// { -// inputs = uint8(bound(inputs, 2, 0x0F)); -// (uint256 calcInputs, uint256 calcOutputs) = -// LibOpUint256Pow.integrity(state, LibOperand.build(inputs, 1, operandData)); +// /// Directly test the integrity logic of LibOpUint256Exp. This tests the happy +// /// path where the inputs input and calc match. +// function testOpUint256ExpIntegrityHappy(IntegrityCheckStateNP memory state, uint8 inputs, uint16 operandData) +// external +// pure +// { +// inputs = uint8(bound(inputs, 2, 0x0F)); +// (uint256 calcInputs, uint256 calcOutputs) = +// LibOpUint256Pow.integrity(state, LibOperand.build(inputs, 1, operandData)); // assertEq(calcInputs, inputs); // assertEq(calcOutputs, 1); // } -// /// Directly test the integrity logic of LibOpUint256Pow. This tests the unhappy -// /// path where the operand is invalid due to 0 inputs. -// function testOpUint256PowIntegrityUnhappyZeroInputs(IntegrityCheckStateNP memory state) external { -// (uint256 calcInputs, uint256 calcOutputs) = LibOpUint256Pow.integrity(state, Operand.wrap(0)); -// // Calc inputs will be minimum 2. -// assertEq(calcInputs, 2); -// assertEq(calcOutputs, 1); -// } +// /// Directly test the integrity logic of LibOpUint256Pow. This tests the unhappy +// /// path where the operand is invalid due to 0 inputs. +// function testOpUint256PowIntegrityUnhappyZeroInputs(IntegrityCheckStateNP memory state) external pure { +// (uint256 calcInputs, uint256 calcOutputs) = LibOpUint256Pow.integrity(state, Operand.wrap(0)); +// // Calc inputs will be minimum 2. +// assertEq(calcInputs, 2); +// assertEq(calcOutputs, 1); +// } -// /// Directly test the integrity logic of LibOpUint256Pow. This tests the unhappy -// /// path where the operand is invalid due to 1 inputs. -// function testOpUint256PowIntegrityUnhappyOneInput(IntegrityCheckStateNP memory state) external { -// (uint256 calcInputs, uint256 calcOutputs) = LibOpUint256Pow.integrity(state, Operand.wrap(0x010000)); -// // Calc inputs will be minimum 2. -// assertEq(calcInputs, 2); -// assertEq(calcOutputs, 1); -// } +// /// Directly test the integrity logic of LibOpUint256Pow. This tests the unhappy +// /// path where the operand is invalid due to 1 inputs. +// function testOpUint256PowIntegrityUnhappyOneInput(IntegrityCheckStateNP memory state) external pure { +// (uint256 calcInputs, uint256 calcOutputs) = LibOpUint256Pow.integrity(state, Operand.wrap(0x010000)); +// // Calc inputs will be minimum 2. +// assertEq(calcInputs, 2); +// assertEq(calcOutputs, 1); +// } // /// Directly test the runtime logic of LibOpUint256Pow. // function testOpUint256PowRun(uint256[] memory inputs) external { @@ -109,13 +110,13 @@ // checkBadOutputs("_ _: uint256-power(0 0);", 2, 1, 2); // } -// /// Test the eval of `uint256-power` opcode parsed from a string. Tests two inputs. -// /// Tests the happy path where we do not overflow. -// function testOpUint256PowEval2InputsHappy() external { -// // Anything exp 0 is 1. -// checkHappy("_: uint256-power(0 0);", 1, "0 ** 0"); -// checkHappy("_: uint256-power(1e-18 0);", 1, "1 ** 0"); -// checkHappy("_: uint256-power(max-value() 0);", 1, "max-value() ** 0"); +// /// Test the eval of `uint256-power` opcode parsed from a string. Tests two inputs. +// /// Tests the happy path where we do not overflow. +// function testOpUint256PowEval2InputsHappy() external view { +// // Anything exp 0 is 1. +// checkHappy("_: uint256-power(0 0);", 1, "0 ** 0"); +// checkHappy("_: uint256-power(1e-18 0);", 1, "1 ** 0"); +// checkHappy("_: uint256-power(max-value() 0);", 1, "max-value() ** 0"); // // 1 exp anything is 1. // checkHappy("_: uint256-power(1e-18 0);", 1, "1 ** 0"); @@ -150,18 +151,18 @@ // checkUnhappyOverflow("_: uint256-power(max-value() max-value());"); // } -// /// Test the eval of `uint256-power` opcode parsed from a string. Tests three inputs. -// /// Tests the happy path where we do not divide by zero. -// function testOpUint256PowEval3InputsHappy() external { -// // Anything exp 0 is 1. -// checkHappy("_: uint256-power(0 0 0);", 1, "0 ** 0 ** 0"); -// checkHappy("_: uint256-power(1e-18 0 0);", 1, "1 ** 0 ** 0"); -// checkHappy("_: uint256-power(max-value() 0 0);", 1, "max-value() ** 0 ** 0"); -// checkHappy("_: uint256-power(0 1e-18 0);", 1, "0 ** 1 ** 0"); -// checkHappy("_: uint256-power(1e-18 1e-18 0);", 1, "1 ** 1 ** 0"); -// checkHappy("_: uint256-power(0 0 1e-18);", 1, "0 ** 0 ** 1"); -// checkHappy("_: uint256-power(1e-18 0 1e-18);", 1, "1 ** 0 ** 1"); -// checkHappy("_: uint256-power(max-value() 0 1e-18);", 1, "max-value() ** 0 ** 1"); +// /// Test the eval of `uint256-power` opcode parsed from a string. Tests three inputs. +// /// Tests the happy path where we do not divide by zero. +// function testOpUint256PowEval3InputsHappy() external view { +// // Anything exp 0 is 1. +// checkHappy("_: uint256-power(0 0 0);", 1, "0 ** 0 ** 0"); +// checkHappy("_: uint256-power(1e-18 0 0);", 1, "1 ** 0 ** 0"); +// checkHappy("_: uint256-power(max-value() 0 0);", 1, "max-value() ** 0 ** 0"); +// checkHappy("_: uint256-power(0 1e-18 0);", 1, "0 ** 1 ** 0"); +// checkHappy("_: uint256-power(1e-18 1e-18 0);", 1, "1 ** 1 ** 0"); +// checkHappy("_: uint256-power(0 0 1e-18);", 1, "0 ** 0 ** 1"); +// checkHappy("_: uint256-power(1e-18 0 1e-18);", 1, "1 ** 0 ** 1"); +// checkHappy("_: uint256-power(max-value() 0 1e-18);", 1, "max-value() ** 0 ** 1"); // // 1 exp anything is 1. // checkHappy("_: uint256-power(1e-18 0 0);", 1, "1 ** 0 ** 0"); diff --git a/test/src/lib/op/store/LibOpGetNP.t.sol b/test/src/lib/op/store/LibOpGetNP.t.sol index 2155b12ab..520b84482 100644 --- a/test/src/lib/op/store/LibOpGetNP.t.sol +++ b/test/src/lib/op/store/LibOpGetNP.t.sol @@ -24,7 +24,7 @@ contract LibOpGetNPTest is OpTest { uint8 inputs, uint8 outputs, uint16 operandData - ) public { + ) public pure { inputs = uint8(bound(inputs, 1, 0x0F)); outputs = uint8(bound(outputs, 1, 0x0F)); (uint256 calcInputs, uint256 calcOutputs) = @@ -40,7 +40,7 @@ contract LibOpGetNPTest is OpTest { /// Directly test the runtime logic of LibOpGetNP. /// Test that if the key is not in the store or state the value is 0. - function testLibOpGetNPRunUnset(uint256 key, uint16 operandData) public { + function testLibOpGetNPRunUnset(uint256 key, uint16 operandData) public view { InterpreterStateNP memory state = opTestDefaultInterpreterState(); Operand operand = LibOperand.build(1, 1, operandData); uint256[] memory inputs = new uint256[](1); @@ -103,7 +103,7 @@ contract LibOpGetNPTest is OpTest { /// Directly test the runtime logic of LibOpGetNP. /// Test that if the key is in the state the value is fetched from the state. - function testLibOpGetNPRunState(uint256 key, uint256 value, uint16 operandData) public { + function testLibOpGetNPRunState(uint256 key, uint256 value, uint16 operandData) public view { InterpreterStateNP memory state = opTestDefaultInterpreterState(); Operand operand = LibOperand.build(1, 1, operandData); uint256[] memory inputs = new uint256[](1); @@ -206,7 +206,7 @@ contract LibOpGetNPTest is OpTest { /// Test the eval of `get` opcode parsed from a string. Tests that if /// the key is not set in the store, the value is 0. - function testLibOpGetNPEvalKeyNotSet() external { + function testLibOpGetNPEvalKeyNotSet() external view { uint256[] memory stack; uint256[] memory kvs; (stack, kvs) = parseAndEval("_:get(0x1234);"); @@ -258,7 +258,7 @@ contract LibOpGetNPTest is OpTest { /// Test the eval of `get` opcode parsed from a string. Tests that if /// `set` is called prior then `get` can see it. - function testLibOpGetNPEvalSetThenGet() external { + function testLibOpGetNPEvalSetThenGet() external view { uint256[] memory stack; uint256[] memory kvs; diff --git a/test/src/lib/op/store/LibOpSetNP.t.sol b/test/src/lib/op/store/LibOpSetNP.t.sol index a95c03d31..6deec0fbc 100644 --- a/test/src/lib/op/store/LibOpSetNP.t.sol +++ b/test/src/lib/op/store/LibOpSetNP.t.sol @@ -20,7 +20,7 @@ contract LibOpSetNPTest is OpTest { uint8 inputs, uint8 outputs, uint16 operandData - ) public { + ) public pure { inputs = uint8(bound(inputs, 0, 0x0F)); outputs = uint8(bound(outputs, 0, 0x0F)); (uint256 calcInputs, uint256 calcOutputs) = @@ -30,7 +30,7 @@ contract LibOpSetNPTest is OpTest { } /// Directly test the runtime logic of LibOpSetNP. - function testLibOpSetNP(uint256 key, uint256 value) public { + function testLibOpSetNP(uint256 key, uint256 value) public view { InterpreterStateNP memory state = opTestDefaultInterpreterState(); Operand operand = Operand.wrap(uint256(2) << 0x10); uint256[] memory inputs = new uint256[](2); @@ -62,7 +62,7 @@ contract LibOpSetNPTest is OpTest { } /// Test the eval of `set` opcode parsed from a string. Tests two inputs. - function testLibOpSetNPEvalTwoInputs() external { + function testLibOpSetNPEvalTwoInputs() external view { uint256[] memory expectedKVs = new uint256[](2); expectedKVs[0] = 0x1234; expectedKVs[1] = 0x5678; @@ -87,7 +87,7 @@ contract LibOpSetNPTest is OpTest { } /// Test the eval of `set` opcode parsed from a string. Tests setting twice. - function testLibOpSetNPEvalSetTwice() external { + function testLibOpSetNPEvalSetTwice() external view { uint256[] memory expectedKVs = new uint256[](4); // The ordering of the expectedKVs is based on internal hashing not the // order of setting. diff --git a/test/src/lib/parse/LibParse.comments.t.sol b/test/src/lib/parse/LibParse.comments.t.sol index 3f2f418c3..febd50ca5 100644 --- a/test/src/lib/parse/LibParse.comments.t.sol +++ b/test/src/lib/parse/LibParse.comments.t.sol @@ -16,7 +16,7 @@ contract LibParseCommentsTest is Test { using LibParse for ParseState; /// A single comment with no expected bytecode. - function testParseCommentNoWords() external { + function testParseCommentNoWords() external view { string memory s = "/* empty output */:;"; (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState(s).parse(); assertEq(LibBytecode.sourceCount(bytecode), 1); @@ -47,7 +47,7 @@ contract LibParseCommentsTest is Test { } /// A single comment with a single word in the bytecode. - function testParseCommentSingleWord() external { + function testParseCommentSingleWord() external view { string memory s = "/* one word */\n_:a();"; (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState(s).parse(); assertEq(LibBytecode.sourceCount(bytecode), 1); @@ -81,7 +81,7 @@ contract LibParseCommentsTest is Test { } /// Comments can be on the same line as source if there is some whitespace. - function testParseCommentSingleWordSameLine() external { + function testParseCommentSingleWordSameLine() external view { string memory s = "/* same line comment */ _:a();"; (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState(s).parse(); assertEq(LibBytecode.sourceCount(bytecode), 1); @@ -115,7 +115,7 @@ contract LibParseCommentsTest is Test { } /// Comments can appear between sources. - function testParseCommentBetweenSources() external { + function testParseCommentBetweenSources() external view { string memory s = "_:a(); /* interstitial comment */ _:b();"; (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState(s).parse(); assertEq(LibBytecode.sourceCount(bytecode), 2); @@ -171,7 +171,7 @@ contract LibParseCommentsTest is Test { } /// Comments can appear after sources. - function testParseCommentAfterSources() external { + function testParseCommentAfterSources() external view { string memory s = "_:a(); _:b(); /* trailing comment */"; (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState(s).parse(); assertEq(LibBytecode.sourceCount(bytecode), 2); @@ -227,7 +227,7 @@ contract LibParseCommentsTest is Test { } /// Multiple comments can appear in a row. - function testParseCommentMultiple() external { + function testParseCommentMultiple() external view { string memory s = "/* comment 1 */ /* comment 2 */ _:a(); /* comment 3 */ _:b(); /* comment 4 */"; (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState(s).parse(); assertEq(LibBytecode.sourceCount(bytecode), 2); @@ -284,7 +284,7 @@ contract LibParseCommentsTest is Test { /// Comments can have many astericks within them without breaking out of the /// comment. Tests extra leading astericks. - function testParseCommentManyAstericks() external { + function testParseCommentManyAstericks() external view { string memory s = "/** _ */ _:a();"; (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState(s).parse(); @@ -320,7 +320,7 @@ contract LibParseCommentsTest is Test { /// Comments can have many astericks within them without breaking out of the /// comment. Tests extra trailing astericks. - function testParseCommentManyAstericksTrailing() external { + function testParseCommentManyAstericksTrailing() external view { string memory s = "/* _ **/ _:a();"; (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState(s).parse(); @@ -355,7 +355,7 @@ contract LibParseCommentsTest is Test { } /// Comments can be very long and span multiple lines. - function testParseCommentLong() external { + function testParseCommentLong() external view { string memory s = "/* this is a very \nlong comment that \nspans multiple lines **** and has many \nwords */ _:a();"; (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState(s).parse(); diff --git a/test/src/lib/parse/LibParse.empty.t.sol b/test/src/lib/parse/LibParse.empty.t.sol index 8d7c7c1ac..dd40fd9f0 100644 --- a/test/src/lib/parse/LibParse.empty.t.sol +++ b/test/src/lib/parse/LibParse.empty.t.sol @@ -18,7 +18,7 @@ contract LibParseEmptyTest is Test { /// Check truly empty input bytes. Should not revert and return length 0 /// sources and constants. - function testParseEmpty00() external { + function testParseEmpty00() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("").parse(); assertEq(LibBytecode.sourceCount(bytecode), 0); @@ -33,7 +33,7 @@ contract LibParseEmptyTest is Test { /// Check a single empty expression. Should not revert and return length 1 /// sources and constants. - function testParseEmpty01() external { + function testParseEmpty01() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState(":;").parse(); assertEq(LibBytecode.sourceCount(bytecode), 1); assertEq( @@ -65,7 +65,7 @@ contract LibParseEmptyTest is Test { /// Check two empty expressions. Should not revert and return length 2 /// sources and constants. - function testParseEmpty02() external { + function testParseEmpty02() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState(":;:;").parse(); assertEq(LibBytecode.sourceCount(bytecode), 2); assertEq( @@ -108,7 +108,7 @@ contract LibParseEmptyTest is Test { /// Check three empty expressions. Should not revert and return length 3 /// sources and constants. - function testParseEmpty03() external { + function testParseEmpty03() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState(":;:;:;").parse(); assertEq(LibBytecode.sourceCount(bytecode), 3); assertEq( @@ -161,7 +161,7 @@ contract LibParseEmptyTest is Test { /// Check four empty expressions. Should not revert and return length 4 /// sources and constants. - function testParseEmpty04() external { + function testParseEmpty04() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState(":;:;:;:;").parse(); assertEq(LibBytecode.sourceCount(bytecode), 4); assertEq( @@ -224,7 +224,7 @@ contract LibParseEmptyTest is Test { /// Check eight empty expressions. Should not revert and return length 8 /// sources and constants. - function testParseEmpty08() external { + function testParseEmpty08() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState(":;:;:;:;:;:;:;:;").parse(); assertEq(LibBytecode.sourceCount(bytecode), 8); assertEq( @@ -327,7 +327,7 @@ contract LibParseEmptyTest is Test { /// Check fifteen empty expressions. Should not revert and return length 15 /// sources and constants. - function testParseEmpty15() external { + function testParseEmpty15() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState(":;:;:;:;:;:;:;:;:;:;:;:;:;:;:;").parse(); assertEq(LibBytecode.sourceCount(bytecode), 15); diff --git a/test/src/lib/parse/LibParse.ignoredLHS.t.sol b/test/src/lib/parse/LibParse.ignoredLHS.t.sol index ade097872..0c8469d52 100644 --- a/test/src/lib/parse/LibParse.ignoredLHS.t.sol +++ b/test/src/lib/parse/LibParse.ignoredLHS.t.sol @@ -16,7 +16,7 @@ contract LibParseIgnoredLHSTest is Test { using LibParse for ParseState; /// A lone underscore should parse to an empty source and constant. - function testParseIgnoredLHSLoneUnderscore() external { + function testParseIgnoredLHSLoneUnderscore() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_:;").parse(); uint256 sourceIndex = 0; assertEq(LibBytecode.sourceCount(bytecode), 1); @@ -45,7 +45,7 @@ contract LibParseIgnoredLHSTest is Test { } /// Two underscores should parse to an empty source and constant. - function testParseIgnoredLHSTwoUnderscores() external { + function testParseIgnoredLHSTwoUnderscores() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_ _:;").parse(); uint256 sourceIndex = 0; assertEq(LibBytecode.sourceCount(bytecode), 1); @@ -75,7 +75,7 @@ contract LibParseIgnoredLHSTest is Test { } /// Inputs can be on multiple lines if there are no RHS items. - function testParseIgnoredLHSMultipleLines() external { + function testParseIgnoredLHSMultipleLines() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_:,_ _:;").parse(); uint256 sourceIndex = 0; assertEq(LibBytecode.sourceCount(bytecode), 1); @@ -106,7 +106,7 @@ contract LibParseIgnoredLHSTest is Test { /// An underscore that is NOT an input should parse to a non-empty source /// with no constants. - function testParseIgnoredLHSUnderscoreNotInput() external { + function testParseIgnoredLHSUnderscoreNotInput() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState(":,_:a();").parse(); uint256 sourceIndex = 0; assertEq(LibBytecode.sourceCount(bytecode), 1); @@ -139,7 +139,7 @@ contract LibParseIgnoredLHSTest is Test { /// An underscore followed by some alpha chars should parse to an empty /// source and constant. - function testParseIgnoredLHSUnderscoreAlpha() external { + function testParseIgnoredLHSUnderscoreAlpha() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_a:;").parse(); uint256 sourceIndex = 0; assertEq(LibBytecode.sourceCount(bytecode), 1); @@ -168,7 +168,7 @@ contract LibParseIgnoredLHSTest is Test { } /// Two ignored alphas should parse to an empty source and constant. - function testParseIgnoredLHSTwoAlphas() external { + function testParseIgnoredLHSTwoAlphas() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_a _b:;").parse(); uint256 sourceIndex = 0; assertEq(LibBytecode.sourceCount(bytecode), 1); @@ -198,7 +198,7 @@ contract LibParseIgnoredLHSTest is Test { } // Ignored alphas can be multiple chars long each. - function testParseIgnoredLHSAlphaTooLong() external { + function testParseIgnoredLHSAlphaTooLong() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_foo _bar:;").parse(); uint256 sourceIndex = 0; assertEq(LibBytecode.sourceCount(bytecode), 1); @@ -228,7 +228,7 @@ contract LibParseIgnoredLHSTest is Test { /// Ignored words have no size limit. We can parse a 32 char ignored word. /// Normally words are limited to 31 chars. - function testParseIgnoredWordTooLong() external { + function testParseIgnoredWordTooLong() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:;").parse(); uint256 sourceIndex = 0; diff --git a/test/src/lib/parse/LibParse.inputsOnly.t.sol b/test/src/lib/parse/LibParse.inputsOnly.t.sol index d1f49524c..ee1e266ef 100644 --- a/test/src/lib/parse/LibParse.inputsOnly.t.sol +++ b/test/src/lib/parse/LibParse.inputsOnly.t.sol @@ -18,7 +18,7 @@ contract LibParseInputsOnlyTest is Test { /// Some inputs-only examples. Should produce an empty source. /// Test a single input. - function testParseInputsOnlySingle() external { + function testParseInputsOnlySingle() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_:;").parse(); uint256 sourceIndex = 0; assertEq(LibBytecode.sourceCount(bytecode), 1); @@ -49,7 +49,7 @@ contract LibParseInputsOnlyTest is Test { } /// Test multiple inputs. - function testParseInputsOnlyMultiple() external { + function testParseInputsOnlyMultiple() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_ _:;").parse(); uint256 sourceIndex = 0; assertEq(LibBytecode.sourceCount(bytecode), 1); diff --git a/test/src/lib/parse/LibParse.isMask.t.sol b/test/src/lib/parse/LibParse.isMask.t.sol index 43650343d..093de9836 100644 --- a/test/src/lib/parse/LibParse.isMask.t.sol +++ b/test/src/lib/parse/LibParse.isMask.t.sol @@ -14,7 +14,7 @@ contract LibParseIsMaskTest is Test { using LibBytes for bytes; /// Test that cursor at or past end is always false for isMask. - function testIsMaskPastEnd(uint256 cursor, uint256 end, uint256 mask) external { + function testIsMaskPastEnd(uint256 cursor, uint256 end, uint256 mask) external pure { // Limit to 16-bit values to avoid OOM reads. end = bound(end, 0, type(uint16).max); cursor = bound(cursor, end, type(uint16).max); @@ -22,7 +22,7 @@ contract LibParseIsMaskTest is Test { } /// Test that isMask matches a reference implementation. - function testIsMaskReference(string memory s, uint256 index, uint256 mask) external { + function testIsMaskReference(string memory s, uint256 index, uint256 mask) external pure { vm.assume(bytes(s).length > 0); index = bound(index, 0, bytes(s).length - 1); diff --git a/test/src/lib/parse/LibParse.literalIntegerDecimal.t.sol b/test/src/lib/parse/LibParse.literalIntegerDecimal.t.sol index f88e0245d..2e5b80e4e 100644 --- a/test/src/lib/parse/LibParse.literalIntegerDecimal.t.sol +++ b/test/src/lib/parse/LibParse.literalIntegerDecimal.t.sol @@ -16,7 +16,7 @@ contract LibParseLiteralIntegerDecimalTest is Test { /// Check a single decimal literal. Should not revert and return length 1 /// sources and constants. - function testParseIntegerLiteralDecimal00() external { + function testParseIntegerLiteralDecimal00() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_: 1;").parse(); uint256 sourceIndex = 0; assertEq(LibBytecode.sourceCount(bytecode), 1); @@ -51,7 +51,7 @@ contract LibParseLiteralIntegerDecimalTest is Test { /// Check 2 decimal literals. Should not revert and return one source and /// length 2 constants. - function testParseIntegerLiteralDecimal01() external { + function testParseIntegerLiteralDecimal01() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_ _: 10 25;").parse(); uint256 sourceIndex = 0; assertEq(LibBytecode.sourceCount(bytecode), 1); @@ -88,7 +88,7 @@ contract LibParseLiteralIntegerDecimalTest is Test { } /// Check 3 decimal literals with 2 dupes. Should dedupe and respect ordering. - function testParseIntegerLiteralDecimal02() external { + function testParseIntegerLiteralDecimal02() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_ _ _: 11 233 11;").parse(); uint256 sourceIndex = 0; assertEq(LibBytecode.sourceCount(bytecode), 1); @@ -128,7 +128,7 @@ contract LibParseLiteralIntegerDecimalTest is Test { } /// Check that we can parse uint256 max int in decimal form. - function testParseIntegerLiteralDecimalUint256Max() external { + function testParseIntegerLiteralDecimalUint256Max() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState( "_: 115792089237316195423570985008687907853269984665640564039457584007913129639935e-18;" ).parse(); @@ -165,7 +165,7 @@ contract LibParseLiteralIntegerDecimalTest is Test { /// Check that we can parse uint256 max int in decimal form with leading /// zeros. - function testParseIntegerLiteralDecimalUint256MaxLeadingZeros() external { + function testParseIntegerLiteralDecimalUint256MaxLeadingZeros() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState( "_: 000115792089237316195423570985008687907853269984665640564039457584007913129639935e-18;" ).parse(); @@ -243,7 +243,7 @@ contract LibParseLiteralIntegerDecimalTest is Test { } /// Check that e notation works. - function testParseIntegerLiteralDecimalENotation() external { + function testParseIntegerLiteralDecimalENotation() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_ _ _ _ _: 1e2 10e2 1e30 1e18 1001e15;").parse(); uint256 sourceIndex = 0; diff --git a/test/src/lib/parse/LibParse.literalIntegerHex.t.sol b/test/src/lib/parse/LibParse.literalIntegerHex.t.sol index 23b80887d..ef1347298 100644 --- a/test/src/lib/parse/LibParse.literalIntegerHex.t.sol +++ b/test/src/lib/parse/LibParse.literalIntegerHex.t.sol @@ -15,7 +15,7 @@ contract LibParseLiteralIntegerHexTest is Test { /// Check a single hex literal. Should not revert and return length 1 /// sources and constants. - function testParseIntegerLiteralHex00() external { + function testParseIntegerLiteralHex00() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_: 0xa2;").parse(); uint256 sourceIndex = 0; assertEq(LibBytecode.sourceCount(bytecode), 1); @@ -50,7 +50,7 @@ contract LibParseLiteralIntegerHexTest is Test { /// Check 2 hex literals. Should not revert and return one source and /// length 2 constants. - function testParseIntegerLiteralHex01() external { + function testParseIntegerLiteralHex01() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_ _: 0xa2 0x03;").parse(); uint256 sourceIndex = 0; assertEq(LibBytecode.sourceCount(bytecode), 1); @@ -87,7 +87,7 @@ contract LibParseLiteralIntegerHexTest is Test { } /// Check 3 hex literals with 2 dupes. Should dedupe and respect ordering. - function testParseIntegerLiteralHex02() external { + function testParseIntegerLiteralHex02() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_ _ _: 0xa2 0x03 0xa2;").parse(); uint256 sourceIndex = 0; assertEq(LibBytecode.sourceCount(bytecode), 1); @@ -127,7 +127,7 @@ contract LibParseLiteralIntegerHexTest is Test { } /// Check that we can parse uint256 max int in hex form. - function testParseIntegerLiteralHexUint256Max() external { + function testParseIntegerLiteralHexUint256Max() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_: 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;").parse(); uint256 sourceIndex = 0; diff --git a/test/src/lib/parse/LibParse.literalString.t.sol b/test/src/lib/parse/LibParse.literalString.t.sol index ac67d74c8..e25fde6ce 100644 --- a/test/src/lib/parse/LibParse.literalString.t.sol +++ b/test/src/lib/parse/LibParse.literalString.t.sol @@ -21,7 +21,7 @@ contract LibParseLiteralStringTest is Test { /// Check an empty string literal. Should not revert and return length 1 /// sources and constants. - function testParseStringLiteralEmpty() external { + function testParseStringLiteralEmpty() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_: \"\";").parse(); uint256 sourceIndex = 0; assertEq(LibBytecode.sourceCount(bytecode), 1); @@ -38,7 +38,7 @@ contract LibParseLiteralStringTest is Test { /// Check a simple string `"a"` literal. Should not revert and return /// length 1 sources and constants. - function testParseStringLiteralSimple() external { + function testParseStringLiteralSimple() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_: \"a\";").parse(); uint256 sourceIndex = 0; assertEq(LibBytecode.sourceCount(bytecode), 1); @@ -55,7 +55,7 @@ contract LibParseLiteralStringTest is Test { /// Any ASCII printable string shorter than 32 bytes should be parsed /// correctly. - function testParseStringLiteralShortASCII(string memory str) external { + function testParseStringLiteralShortASCII(string memory str) external view { vm.assume(bytes(str).length < 0x20); LibLiteralString.conformValidPrintableStringContent(str); @@ -75,7 +75,7 @@ contract LibParseLiteralStringTest is Test { } /// Can parse 2 valid strings. - function testParseStringLiteralTwo(string memory strA, string memory strB) external { + function testParseStringLiteralTwo(string memory strA, string memory strB) external view { vm.assume(bytes(strA).length < 0x20); LibLiteralString.conformValidPrintableStringContent(strA); vm.assume(bytes(strB).length < 0x20); diff --git a/test/src/lib/parse/LibParse.nOutput.t.sol b/test/src/lib/parse/LibParse.nOutput.t.sol index 075f27d3b..5341f7f5e 100644 --- a/test/src/lib/parse/LibParse.nOutput.t.sol +++ b/test/src/lib/parse/LibParse.nOutput.t.sol @@ -16,7 +16,7 @@ contract LibParseNOutputTest is Test { using LibParse for ParseState; /// A single RHS item MAY have 0 outputs. - function testParseNOutputExcessRHS0() external { + function testParseNOutputExcessRHS0() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState(":a();").parse(); assertEq( bytecode, @@ -54,7 +54,7 @@ contract LibParseNOutputTest is Test { /// A single RHS item can have multiple outputs. This RHS item has nesting. /// Nested words are always treated as a single output. - function testParseNOutputNestedRHS() external { + function testParseNOutputNestedRHS() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState(":,_ _:a(b());").parse(); assertEq( bytecode, @@ -87,7 +87,7 @@ contract LibParseNOutputTest is Test { /// Multiple output RHS items MAY be followed by single output RHS items, /// on a new line. - function testParseBalanceStackOffsetsInputs() external { + function testParseBalanceStackOffsetsInputs() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_ _:a(), _:b();").parse(); assertEq(LibBytecode.sourceCount(bytecode), 1); assertEq(constants.length, 0); diff --git a/test/src/lib/parse/LibParse.namedLHS.t.sol b/test/src/lib/parse/LibParse.namedLHS.t.sol index f2194f400..39ae8e3c4 100644 --- a/test/src/lib/parse/LibParse.namedLHS.t.sol +++ b/test/src/lib/parse/LibParse.namedLHS.t.sol @@ -21,7 +21,7 @@ contract LibParseNamedLHSTest is Test { using LibParse for ParseState; /// A few simple examples that should create some empty sources. - function testParseNamedLHSEmptySourceExamples() external { + function testParseNamedLHSEmptySourceExamples() external view { string[3] memory examples0 = ["a _:;", "a b:;", "foo bar:;"]; for (uint256 i = 0; i < examples0.length; i++) { (bytes memory bytecode0, uint256[] memory constants0) = LibMetaFixture.newState(examples0[i]).parse(); @@ -38,7 +38,7 @@ contract LibParseNamedLHSTest is Test { } /// Two sources with one named input each. - function testParseNamedLHSTwoInputs() external { + function testParseNamedLHSTwoInputs() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("a:;b:;").parse(); assertEq( bytecode, @@ -107,7 +107,7 @@ contract LibParseNamedLHSTest is Test { } /// Stack needs to index items by name correctly across lines. - function testParseNamedLHSStackIndex() external { + function testParseNamedLHSStackIndex() external view { AuthoringMetaV2[] memory meta = new AuthoringMetaV2[](3); meta[0] = AuthoringMetaV2("stack", "stack"); meta[1] = AuthoringMetaV2("constant", "constant"); @@ -171,7 +171,7 @@ contract LibParseNamedLHSTest is Test { } /// Duplicate names are allowed across different sources. - function testParseNamedDuplicateDifferentSource() external { + function testParseNamedDuplicateDifferentSource() external view { (bytes memory bytecode, uint256[] memory constants) = LibParseState.newState( "a b:1 2, e:a;c d:3 4,e:d;", "", "", LibAllStandardOpsNP.literalParserFunctionPointers() ).parse(); diff --git a/test/src/lib/parse/LibParse.operandDoublePerByteNoDefault.t.sol b/test/src/lib/parse/LibParse.operandDoublePerByteNoDefault.t.sol index 6061d78ea..49b3dc2d8 100644 --- a/test/src/lib/parse/LibParse.operandDoublePerByteNoDefault.t.sol +++ b/test/src/lib/parse/LibParse.operandDoublePerByteNoDefault.t.sol @@ -37,7 +37,7 @@ contract LibParseOperandDoublePerByteNoDefaultTest is Test { } /// 2 literals are expected for this operand parser. Tests 1 2. - function testOperandDoublePerByteNoDefaultSecond() external { + function testOperandDoublePerByteNoDefaultSecond() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_:c<1 2>();").parse(); assertEq( bytecode, @@ -60,7 +60,7 @@ contract LibParseOperandDoublePerByteNoDefaultTest is Test { } /// 2 literals are expected for this operand parser. Tests 0 0. - function testOperandDoublePerByteNoDefaultSecondZero() external { + function testOperandDoublePerByteNoDefaultSecondZero() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_:c<0 0>();").parse(); assertEq( bytecode, @@ -83,7 +83,7 @@ contract LibParseOperandDoublePerByteNoDefaultTest is Test { } /// 2 literals are expected for this operand parser. Tests 255 0. - function testOperandDoublePerByteNoDefaultSecondMaxZero() external { + function testOperandDoublePerByteNoDefaultSecondMaxZero() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_:c<255 0>();").parse(); assertEq( bytecode, @@ -106,7 +106,7 @@ contract LibParseOperandDoublePerByteNoDefaultTest is Test { } /// 2 literals are expected for this operand parser. Tests 0 255. - function testOperandDoublePerByteNoDefaultSecondZeroMax() external { + function testOperandDoublePerByteNoDefaultSecondZeroMax() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_:c<0 255>();").parse(); assertEq( bytecode, @@ -129,7 +129,7 @@ contract LibParseOperandDoublePerByteNoDefaultTest is Test { } /// 2 literals are expected for this operand parser. Tests 255 255. - function testOperandDoublePerByteNoDefaultSecondMax() external { + function testOperandDoublePerByteNoDefaultSecondMax() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_:c<255 255>();").parse(); assertEq( bytecode, @@ -192,7 +192,7 @@ contract LibParseOperandDoublePerByteNoDefaultTest is Test { } /// Prefix whitespace is allowed. - function testOperandDoublePerByteNoDefaultPrefixWhitespace() external { + function testOperandDoublePerByteNoDefaultPrefixWhitespace() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_:c< 1 2>();").parse(); assertEq( bytecode, @@ -215,7 +215,7 @@ contract LibParseOperandDoublePerByteNoDefaultTest is Test { } /// Postfix whitespace is allowed. - function testOperandDoublePerByteNoDefaultPostfixWhitespace() external { + function testOperandDoublePerByteNoDefaultPostfixWhitespace() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_:c<1 2 >();").parse(); assertEq( bytecode, @@ -238,7 +238,7 @@ contract LibParseOperandDoublePerByteNoDefaultTest is Test { } /// Multiple sequential whitespace is allowed. - function testOperandDoublePerByteNoDefaultMultipleWhitespace() external { + function testOperandDoublePerByteNoDefaultMultipleWhitespace() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_:c< 1 2 >();").parse(); assertEq( bytecode, diff --git a/test/src/lib/parse/LibParse.operandM1M1.t.sol b/test/src/lib/parse/LibParse.operandM1M1.t.sol index e6cab84c1..ad3150204 100644 --- a/test/src/lib/parse/LibParse.operandM1M1.t.sol +++ b/test/src/lib/parse/LibParse.operandM1M1.t.sol @@ -12,7 +12,7 @@ contract LibParseOperandM1M1Test is OperandTest { using LibParse for ParseState; /// Default is zero for this operand parser. Tests no operand. - function testOperandM1M1Elided() external { + function testOperandM1M1Elided() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_:d();").parse(); assertEq( bytecode, @@ -35,7 +35,7 @@ contract LibParseOperandM1M1Test is OperandTest { } /// Default is zero for this operand parser. Tests empty operand. - function testOperandM1M1Empty() external { + function testOperandM1M1Empty() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_:d<>();").parse(); assertEq( bytecode, @@ -58,7 +58,7 @@ contract LibParseOperandM1M1Test is OperandTest { } /// Default is zero for this operand parser. Tests first but not second operand. - function testOperandM1M1First() external { + function testOperandM1M1First() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_:d<1>();").parse(); assertEq( bytecode, @@ -89,7 +89,7 @@ contract LibParseOperandM1M1Test is OperandTest { } /// Default is zero for this operand parser. Tests 0 1. - function testOperandM1M1Second() external { + function testOperandM1M1Second() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_:d<0 1>();").parse(); assertEq( bytecode, @@ -112,7 +112,7 @@ contract LibParseOperandM1M1Test is OperandTest { } /// Default is zero for this operand parser. Tests 0 0. - function testOperandM1M1SecondZero() external { + function testOperandM1M1SecondZero() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_:d<0 0>();").parse(); assertEq( bytecode, @@ -143,7 +143,7 @@ contract LibParseOperandM1M1Test is OperandTest { } /// Default is zero for this operand parser. Tests 1 1. - function testOperandM1M1Both() external { + function testOperandM1M1Both() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_:d<1 1>();").parse(); assertEq( bytecode, diff --git a/test/src/lib/parse/LibParse.operandSingleFull.t.sol b/test/src/lib/parse/LibParse.operandSingleFull.t.sol index ad083189f..03a193d35 100644 --- a/test/src/lib/parse/LibParse.operandSingleFull.t.sol +++ b/test/src/lib/parse/LibParse.operandSingleFull.t.sol @@ -12,7 +12,7 @@ contract LibParseOperandSingleFullTest is Test { using LibParse for ParseState; /// Fallback is 0 for elided single full operand. - function testOperandSingleFullElided() external { + function testOperandSingleFullElided() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_:b();").parse(); assertEq( bytecode, @@ -35,7 +35,7 @@ contract LibParseOperandSingleFullTest is Test { } /// Empty operand is allowed. - function testOperandSingleFullEmpty() external { + function testOperandSingleFullEmpty() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_:b<>();").parse(); assertEq( bytecode, @@ -66,7 +66,7 @@ contract LibParseOperandSingleFullTest is Test { } /// Can provide decimal integer 0 as single full operand. - function testOperandSingleFullZero() external { + function testOperandSingleFullZero() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_:b<0>();").parse(); assertEq( bytecode, @@ -89,7 +89,7 @@ contract LibParseOperandSingleFullTest is Test { } /// Can provide hexadecimal 0x00 as a single full operand. - function testOperandSingleFullHexZero() external { + function testOperandSingleFullHexZero() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_:b<0x00>();").parse(); assertEq( bytecode, @@ -112,7 +112,7 @@ contract LibParseOperandSingleFullTest is Test { } /// Can provide decimal 1 as single full operand. - function testOperandSingleFullOne() external { + function testOperandSingleFullOne() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_:b<1>();").parse(); assertEq( bytecode, @@ -135,7 +135,7 @@ contract LibParseOperandSingleFullTest is Test { } /// Can provide hexadecimal 0x01 as a single full operand. - function testOperandSingleFullHexOne() external { + function testOperandSingleFullHexOne() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_:b<0x01>();").parse(); assertEq( bytecode, @@ -158,7 +158,7 @@ contract LibParseOperandSingleFullTest is Test { } /// Can provide decimal uint16 max as single full operand. - function testOperandSingleFullUint16Max() external { + function testOperandSingleFullUint16Max() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_:b<65535>();").parse(); assertEq( bytecode, @@ -181,7 +181,7 @@ contract LibParseOperandSingleFullTest is Test { } /// Can provide hexadecimal uint16 max as a single full operand. - function testOperandSingleFullHexUint16Max() external { + function testOperandSingleFullHexUint16Max() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_:b<0xffff>();").parse(); assertEq( bytecode, @@ -236,7 +236,7 @@ contract LibParseOperandSingleFullTest is Test { } /// Leading whitespace in the operand is supported. - function testOperandSingleFullLeadingWhitespace() external { + function testOperandSingleFullLeadingWhitespace() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_:b< 5>();").parse(); assertEq( bytecode, @@ -259,7 +259,7 @@ contract LibParseOperandSingleFullTest is Test { } /// Trailing whitespace in the operand is supported. - function testOperandSingleFullTrailingWhitespace() external { + function testOperandSingleFullTrailingWhitespace() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_:b<5 >();").parse(); assertEq( bytecode, @@ -282,7 +282,7 @@ contract LibParseOperandSingleFullTest is Test { } /// Leading and trailing whitespace in the operand is supported. - function testOperandSingleFullLeadingAndTrailingWhitespace() external { + function testOperandSingleFullLeadingAndTrailingWhitespace() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState("_:b< 0x05 >();").parse(); assertEq( bytecode, diff --git a/test/src/lib/parse/LibParse.parseWord.t.sol b/test/src/lib/parse/LibParse.parseWord.t.sol index 55ad8ac39..68bb38c1b 100644 --- a/test/src/lib/parse/LibParse.parseWord.t.sol +++ b/test/src/lib/parse/LibParse.parseWord.t.sol @@ -17,7 +17,7 @@ contract LibParseParseWordTest is Test { /// For all input bytes length [1,31] the two implementations will agree. /// Length 0 is undefined behaviour for word parsing so is not tested. /// Length 32+ will error on the real implementation so is not tested. - function testLibParseParseWordReferenceImplementation(bytes memory data, uint256 mask) external { + function testLibParseParseWordReferenceImplementation(bytes memory data, uint256 mask) external pure { vm.assume(data.length <= 31); vm.assume(data.length > 0); uint256 cursor = Pointer.unwrap(data.dataPointer()); @@ -37,7 +37,7 @@ contract LibParseParseWordTest is Test { assertEq(word, expectedWord); } - function checkParseWord(bytes memory data, uint256 mask, uint256 expectedI, bytes32 expectedWord) public { + function checkParseWord(bytes memory data, uint256 mask, uint256 expectedI, bytes32 expectedWord) public pure { uint256 cursor = Pointer.unwrap(data.dataPointer()); uint256 end = cursor + data.length; @@ -81,7 +81,7 @@ contract LibParseParseWordTest is Test { /// Ensure that parse word can't exceed the end even if there are valid /// looking bytes in memory. - function testLibParseParseWordEnd(uint256 length) external { + function testLibParseParseWordEnd(uint256 length) external pure { length = bound(length, 1, 0x1F); bytes memory data = "01234567890123456789012345678901"; assembly ("memory-safe") { diff --git a/test/src/lib/parse/LibParse.sourceInputs.t.sol b/test/src/lib/parse/LibParse.sourceInputs.t.sol index 42a8f814d..4a38708a6 100644 --- a/test/src/lib/parse/LibParse.sourceInputs.t.sol +++ b/test/src/lib/parse/LibParse.sourceInputs.t.sol @@ -14,7 +14,7 @@ contract LibParseSourceInputsTest is Test { using LibParse for ParseState; /// A single LHS item is parsed as a source input. - function testParseSourceInputsSingle() external { + function testParseSourceInputsSingle() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState(":,_:;").parse(); assertEq( bytecode, @@ -36,7 +36,7 @@ contract LibParseSourceInputsTest is Test { /// Inputs can appear on the second line, even after an empty line, provided /// no RHS items have appeared yet. - function testParseSourceInputsEmptyLinePrefix() external { + function testParseSourceInputsEmptyLinePrefix() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState(":,_:;").parse(); assertEq( bytecode, @@ -58,7 +58,7 @@ contract LibParseSourceInputsTest is Test { /// Inputs can be spread across multiple lines, provided no RHS items have /// appeared yet. Tests one item per line, two times. - function testParseSourceInputsMultipleLines() external { + function testParseSourceInputsMultipleLines() external view { (bytes memory bytecode, uint256[] memory constants) = LibMetaFixture.newState(":,_:,\n_:;").parse(); assertEq( bytecode, diff --git a/test/src/lib/parse/LibParse.wordsRHS.t.sol b/test/src/lib/parse/LibParse.wordsRHS.t.sol index 433617492..c951b3725 100644 --- a/test/src/lib/parse/LibParse.wordsRHS.t.sol +++ b/test/src/lib/parse/LibParse.wordsRHS.t.sol @@ -17,7 +17,7 @@ contract LibParseNamedRHSTest is Test { using LibParse for ParseState; /// The simplest RHS is a single word. - function testParseSingleWord() external { + function testParseSingleWord() external view { string memory s = "_:a();"; ParseState memory state = LibParseState.newState( @@ -43,7 +43,7 @@ contract LibParseNamedRHSTest is Test { } /// Two sequential words on the RHS. - function testParseTwoSequential() external { + function testParseTwoSequential() external view { string memory s = "_ _:a() b();"; ParseState memory state = LibParseState.newState( @@ -87,7 +87,7 @@ contract LibParseNamedRHSTest is Test { } /// Two sequential words on the RHS, each with a single input. - function testParseTwoSequentialWithInputs() external { + function testParseTwoSequentialWithInputs() external view { string memory s = "_ _:a(b()) b(c<0 0>());"; ParseState memory state = LibParseState.newState( @@ -135,7 +135,7 @@ contract LibParseNamedRHSTest is Test { } /// Two words on the RHS, one nested as an input to the other. - function testParseTwoNested() external { + function testParseTwoNested() external view { string memory s = "_:a(b());"; ParseState memory state = LibParseState.newState( @@ -179,7 +179,7 @@ contract LibParseNamedRHSTest is Test { } /// Three words on the RHS, two sequential nested as an input to the other. - function testParseTwoNestedAsThirdInput() external { + function testParseTwoNestedAsThirdInput() external view { string memory s = "_:a(b() c<0 0>());"; ParseState memory state = LibParseState.newState( @@ -226,7 +226,7 @@ contract LibParseNamedRHSTest is Test { /// Several words, mixing sequential and nested logic to some depth, with /// several LHS items. - function testParseSingleLHSNestingAndSequential00() external { + function testParseSingleLHSNestingAndSequential00() external view { string memory s = "_:a(b() c<0 0>(d() e<0>()));"; ParseState memory state = LibParseState.newState( @@ -278,7 +278,7 @@ contract LibParseNamedRHSTest is Test { /// Several words, mixing sequential and nested logic to some depth, with /// several LHS items. - function testParseSingleLHSNestingAndSequential01() external { + function testParseSingleLHSNestingAndSequential01() external view { string memory s = "_:a(b() c<0 0>(d() e<0>()) f() g(h() i()));"; ParseState memory state = LibParseState.newState( @@ -338,7 +338,7 @@ contract LibParseNamedRHSTest is Test { /// Several words, mixing sequential and nested logic to some depth, with /// several LHS items. - function testParseSingleLHSNestingAndSequential02() external { + function testParseSingleLHSNestingAndSequential02() external view { string memory s = "_ _ _:a(b() c<0 0>(d())) d() e<0>(b());"; ParseState memory state = LibParseState.newState( @@ -392,7 +392,7 @@ contract LibParseNamedRHSTest is Test { /// More than 14 words deep triggers a whole other internal loop due to there /// being 7 words max per active source. - function testParseSingleLHSNestingAndSequential03() external { + function testParseSingleLHSNestingAndSequential03() external view { string memory s = "_ _:a(b() c<0 0>(d() e<0>() f() g() h() i() j() k() l() m() n() o() p())) p(o() n(m() l() k() j() i() h() g() f() e<0>() d() c<0 0>() b() a()));"; @@ -500,7 +500,7 @@ contract LibParseNamedRHSTest is Test { } /// Two lines, each with LHS and RHS. - function testParseTwoFullLinesSingleRHSEach() external { + function testParseTwoFullLinesSingleRHSEach() external view { string memory s = "_:a(),_ _:b() c<0 0>(d());"; ParseState memory state = LibParseState.newState( @@ -549,7 +549,7 @@ contract LibParseNamedRHSTest is Test { } /// Two full sources, each with a single LHS and RHS. - function testParseTwoFullSourcesSingleRHSEach() external { + function testParseTwoFullSourcesSingleRHSEach() external view { string memory s = "_:a();_:b();"; ParseState memory state = LibParseState.newState( diff --git a/test/src/lib/parse/LibParseOperand.handleOperand8M1M1.t.sol b/test/src/lib/parse/LibParseOperand.handleOperand8M1M1.t.sol index 53eef40a3..42b22062c 100644 --- a/test/src/lib/parse/LibParseOperand.handleOperand8M1M1.t.sol +++ b/test/src/lib/parse/LibParseOperand.handleOperand8M1M1.t.sol @@ -16,7 +16,7 @@ contract LibParseOperandHandleOperand8M1M1Test is Test { } // If only the first value is provided, the others default to zero. - function testHandleOperand8M1M1FirstValueOnly(uint256 value) external { + function testHandleOperand8M1M1FirstValueOnly(uint256 value) external pure { value = bound(value, 0, type(uint8).max); uint256[] memory values = new uint256[](1); values[0] = value; @@ -45,7 +45,7 @@ contract LibParseOperandHandleOperand8M1M1Test is Test { // If the first and second values are provided, the third defaults to zero. // The first value is 1 byte and the second is 1 bit. - function testHandleOperand8M1M1FirstAndSecondValue(uint256 a, uint256 b) external { + function testHandleOperand8M1M1FirstAndSecondValue(uint256 a, uint256 b) external pure { a = bound(a, 0, type(uint8).max); b = bound(b, 0, 1); uint256[] memory values = new uint256[](2); @@ -79,7 +79,7 @@ contract LibParseOperandHandleOperand8M1M1Test is Test { // If all the values are provided they all appear in the operand. // The first value is 1 byte and the second is 1 bit, the third is 1 bit. - function testHandleOperand8M1M1AllValues(uint256 a, uint256 b, uint256 c) external { + function testHandleOperand8M1M1AllValues(uint256 a, uint256 b, uint256 c) external pure { a = bound(a, 0, type(uint8).max); b = bound(b, 0, 1); c = bound(c, 0, 1); diff --git a/test/src/lib/parse/LibParseOperand.handleOperandDisallowed.t.sol b/test/src/lib/parse/LibParseOperand.handleOperandDisallowed.t.sol index df0d7732e..8795fe885 100644 --- a/test/src/lib/parse/LibParseOperand.handleOperandDisallowed.t.sol +++ b/test/src/lib/parse/LibParseOperand.handleOperandDisallowed.t.sol @@ -6,7 +6,7 @@ import {LibParseOperand, Operand} from "src/lib/parse/LibParseOperand.sol"; import {UnexpectedOperand} from "src/error/ErrParse.sol"; contract LibParseOperandHandleOperandDisallowedTest is Test { - function testHandleOperandDisallowedNoValues() external { + function testHandleOperandDisallowedNoValues() external pure { assertEq(Operand.unwrap(LibParseOperand.handleOperandDisallowed(new uint256[](0))), 0); } diff --git a/test/src/lib/parse/LibParseOperand.handleOperandDoublePerByteNoDefault.t.sol b/test/src/lib/parse/LibParseOperand.handleOperandDoublePerByteNoDefault.t.sol index 00771ebe5..8c493f462 100644 --- a/test/src/lib/parse/LibParseOperand.handleOperandDoublePerByteNoDefault.t.sol +++ b/test/src/lib/parse/LibParseOperand.handleOperandDoublePerByteNoDefault.t.sol @@ -79,7 +79,7 @@ contract LibParseOperandHandleOperandDoublePerByteNoDefaultTest is Test { // If both values are within 1 byte, it is not an error, the result is the // second value shifted left by 8 bits plus the first value. The rightmost // bits of the operand are the first value. - function testHandleOperandDoublePerByteNoDefaultBothValuesWithinOneByte(uint256 a, uint256 b) external { + function testHandleOperandDoublePerByteNoDefaultBothValuesWithinOneByte(uint256 a, uint256 b) external pure { a = bound(a, 0, type(uint8).max); b = bound(b, 0, type(uint8).max); uint256[] memory values = new uint256[](2); diff --git a/test/src/lib/parse/LibParseOperand.handleOperandM1M1.t.sol b/test/src/lib/parse/LibParseOperand.handleOperandM1M1.t.sol index f34c5d5cd..d8643df29 100644 --- a/test/src/lib/parse/LibParseOperand.handleOperandM1M1.t.sol +++ b/test/src/lib/parse/LibParseOperand.handleOperandM1M1.t.sol @@ -11,12 +11,12 @@ import {LibFixedPointDecimalScale, DECIMAL_MAX_SAFE_INT} from "rain.math.fixedpo contract LibParseOperandHandleOperandM1M1Test is Test { // Both values are optional so if nothing is provided everything falls back // to zero. - function testHandleOperandM1M1NoValues() external { + function testHandleOperandM1M1NoValues() external pure { assertEq(Operand.unwrap(LibParseOperand.handleOperandM1M1(new uint256[](0))), 0); } // If one value is provided it must be 1 bit. - function testHandleOperandM1M1OneValue(uint256 value) external { + function testHandleOperandM1M1OneValue(uint256 value) external pure { value = bound(value, 0, 1); uint256[] memory values = new uint256[](1); values[0] = value; @@ -44,7 +44,7 @@ contract LibParseOperandHandleOperandM1M1Test is Test { } // If two values are provided, they must be 1 bit each. - function testHandleOperandM1M1TwoValues(uint256 a, uint256 b) external { + function testHandleOperandM1M1TwoValues(uint256 a, uint256 b) external pure { a = bound(a, 0, 1); b = bound(b, 0, 1); uint256[] memory values = new uint256[](2); diff --git a/test/src/lib/parse/LibParseOperand.handleOperandSingleFull.t.sol b/test/src/lib/parse/LibParseOperand.handleOperandSingleFull.t.sol index 2382b51ba..135d4f00d 100644 --- a/test/src/lib/parse/LibParseOperand.handleOperandSingleFull.t.sol +++ b/test/src/lib/parse/LibParseOperand.handleOperandSingleFull.t.sol @@ -10,12 +10,12 @@ import {LibFixedPointDecimalScale, DECIMAL_MAX_SAFE_INT} from "rain.math.fixedpo contract LibParseOperandHandleOperandSingleFullTest is Test { // No values falls back to zero. - function testHandleOperandSingleFullNoValues() external { + function testHandleOperandSingleFullNoValues() external pure { assertEq(Operand.unwrap(LibParseOperand.handleOperandSingleFull(new uint256[](0))), 0); } // A single value of up to 2 bytes is allowed. - function testHandleOperandSingleFullSingleValue(uint256 value) external { + function testHandleOperandSingleFullSingleValue(uint256 value) external pure { value = bound(value, 0, type(uint16).max); uint256 valueScaled = value * 1e18; uint256[] memory values = new uint256[](1); diff --git a/test/src/lib/parse/LibParseOperand.handleOperandSingleFullNoDefault.t.sol b/test/src/lib/parse/LibParseOperand.handleOperandSingleFullNoDefault.t.sol index 8ad4a8b66..4749b50f7 100644 --- a/test/src/lib/parse/LibParseOperand.handleOperandSingleFullNoDefault.t.sol +++ b/test/src/lib/parse/LibParseOperand.handleOperandSingleFullNoDefault.t.sol @@ -16,7 +16,7 @@ contract LibParseOperandHandleOperandSingleFullTest is Test { } // A single value of up to 2 bytes is allowed. - function testHandleOperandSingleFullNoDefaultSingleValue(uint256 value) external { + function testHandleOperandSingleFullNoDefaultSingleValue(uint256 value) external pure { value = bound(value, 0, type(uint16).max); uint256[] memory values = new uint256[](1); values[0] = value; diff --git a/test/src/lib/parse/LibParseOperand.parseOperand.t.sol b/test/src/lib/parse/LibParseOperand.parseOperand.t.sol index 73df38705..03296412f 100644 --- a/test/src/lib/parse/LibParseOperand.parseOperand.t.sol +++ b/test/src/lib/parse/LibParseOperand.parseOperand.t.sol @@ -21,6 +21,7 @@ contract LibParseOperandParseOperandTest is Test { function checkParsingOperandFromData(string memory s, uint256[] memory expectedValues, uint256 expectedEnd) internal + pure { ParseState memory state = LibMetaFixture.newState(s); // Before parsing any operand values the state gets initialized at the @@ -42,7 +43,7 @@ contract LibParseOperandParseOperandTest is Test { // Test that parsing a string that doesn't start with the operand opening // character always results in a zero length operand values array. - function testParseOperandNoOpeningCharacter(string memory s) external { + function testParseOperandNoOpeningCharacter(string memory s) external pure { vm.assume(bytes(s).length > 0); vm.assume(bytes(s)[0] != "<"); @@ -52,7 +53,7 @@ contract LibParseOperandParseOperandTest is Test { // Test that parsing an empty "<>" operand results in a zero length operand // values array. The cursor moves past both the opening and closing // characters. - function testParseOperandEmptyOperand(string memory s) external { + function testParseOperandEmptyOperand(string memory s) external pure { vm.assume(bytes(s).length > 2); bytes(s)[0] = "<"; bytes(s)[1] = ">"; @@ -67,7 +68,7 @@ contract LibParseOperandParseOperandTest is Test { string memory maybeWhitespaceA, string memory maybeWhitespaceB, string memory suffix - ) external { + ) external pure { LibLiteralString.conformStringToWhitespace(maybeWhitespaceA); LibLiteralString.conformStringToWhitespace(maybeWhitespaceB); @@ -97,7 +98,7 @@ contract LibParseOperandParseOperandTest is Test { string memory maybeWhitespaceB, string memory maybeWhitespaceC, string memory suffix - ) external { + ) external pure { vm.assume(bytes(maybeWhitespaceB).length > 0); valueA = bound(valueA, 0, SIGNED_NORMALIZED_MAX); @@ -142,7 +143,7 @@ contract LibParseOperandParseOperandTest is Test { string memory maybeWhitespaceC, string memory maybeWhitespaceD, string memory suffix - ) external { + ) external pure { vm.assume(bytes(maybeWhitespaceB).length > 0); vm.assume(bytes(maybeWhitespaceC).length > 0); @@ -162,14 +163,14 @@ contract LibParseOperandParseOperandTest is Test { string memory valueBString = asHexB ? uint256(valueB).toHexString() : valueB.toString(); string memory valueCString = asHexC ? uint256(valueC).toHexString() : valueC.toString(); - s = string.concat( + s = string.concat(string.concat( "<", maybeWhitespaceA, valueAString, maybeWhitespaceB, valueBString, maybeWhitespaceC, - valueCString, + valueCString), maybeWhitespaceD, ">", suffix @@ -199,7 +200,7 @@ contract LibParseOperandParseOperandTest is Test { int256[4] memory values, string[5] memory maybeWhitespace, string memory suffix - ) external { + ) external pure { { vm.assume(bytes(maybeWhitespace[1]).length > 0); vm.assume(bytes(maybeWhitespace[2]).length > 0); diff --git a/test/src/lib/parse/LibParsePragma.keyword.t.sol b/test/src/lib/parse/LibParsePragma.keyword.t.sol index 9d9cfd21a..12b090f96 100644 --- a/test/src/lib/parse/LibParsePragma.keyword.t.sol +++ b/test/src/lib/parse/LibParsePragma.keyword.t.sol @@ -29,7 +29,7 @@ contract LibParsePragmaKeywordTest is Test { uint256 expectedCursorDiff, address[] memory values, string memory err - ) internal { + ) internal pure { ParseState memory state = LibParseState.newState(bytes(str), "", "", LibAllStandardOpsNP.literalParserFunctionPointers()); uint256 cursor = Pointer.unwrap(bytes(str).dataPointer()); @@ -67,7 +67,7 @@ contract LibParsePragmaKeywordTest is Test { } /// Anything that DOES NOT start with the keyword should be a noop. - function testPragmaKeywordNoop(ParseState memory state, string calldata calldataStr) external { + function testPragmaKeywordNoop(ParseState memory state, string calldata calldataStr) external pure { if (bytes(calldataStr).length >= PRAGMA_KEYWORD_BYTES_LENGTH) { bytes memory prefix = bytes(calldataStr)[0:PRAGMA_KEYWORD_BYTES_LENGTH]; assert(keccak256(prefix) != keccak256(PRAGMA_KEYWORD_BYTES)); @@ -93,7 +93,7 @@ contract LibParsePragmaKeywordTest is Test { /// Anything that DOES start with the keyword and WITH whitespace BUT NOT /// hex values should more the cursor forward exactly the length of the /// keyword + the whitespace char. - function testPragmaKeywordWhitespaceNoHex(uint256 seed, string calldata calldataStr) external { + function testPragmaKeywordWhitespaceNoHex(uint256 seed, string calldata calldataStr) external pure { seed = bound(seed, 0, type(uint256).max - 1); bytes1 whitespace = LibLiteralString.charFromMask(seed, CMASK_WHITESPACE); bytes1 notInterstitialHead = LibLiteralString.charFromMask(seed + 1, ~CMASK_INTERSTITIAL_HEAD); @@ -122,7 +122,7 @@ contract LibParsePragmaKeywordTest is Test { address subParser, uint256 seed, string calldata suffix - ) external { + ) external pure { vm.assume(bytes(whitespace).length > 0); bytes1 notHexData = LibLiteralString.charFromMask(seed, ~CMASK_HEX); LibLiteralString.conformStringToMask(whitespace, CMASK_WHITESPACE, 0x80); @@ -160,7 +160,7 @@ contract LibParsePragmaKeywordTest is Test { address subParser1, uint256 seed, string calldata suffix - ) external { + ) external pure { vm.assume(bytes(whitespace0).length > 0); vm.assume(bytes(whitespace1).length > 0); @@ -170,12 +170,14 @@ contract LibParsePragmaKeywordTest is Test { LibLiteralString.conformStringToMask(whitespace1, CMASK_WHITESPACE, 0x80); string memory str = string.concat( - string(PRAGMA_KEYWORD_BYTES), - whitespace0, - subParser0.toHexString(), - whitespace1, - subParser1.toHexString(), - string(abi.encodePacked(notHexData)), + string.concat( + string(PRAGMA_KEYWORD_BYTES), + whitespace0, + subParser0.toHexString(), + whitespace1, + subParser1.toHexString(), + string(abi.encodePacked(notHexData)) + ), suffix ); @@ -208,7 +210,7 @@ contract LibParsePragmaKeywordTest is Test { } /// Test a specific string. - function testPragmaKeywordParseSubParserSpecificStrings() external { + function testPragmaKeywordParseSubParserSpecificStrings() external pure { string memory str = "using-words-from 0x1234567890123456789012345678901234567890 0x1234567890123456789012345678901234567891"; address[] memory values = new address[](2); diff --git a/test/src/lib/parse/LibParseStackName.t.sol b/test/src/lib/parse/LibParseStackName.t.sol index ecce1d0a9..2aa4ad184 100644 --- a/test/src/lib/parse/LibParseStackName.t.sol +++ b/test/src/lib/parse/LibParseStackName.t.sol @@ -10,7 +10,7 @@ import "src/lib/parse/LibParseStackName.sol"; /// Tests for handling named stack items. contract LibParseStackNameTest is Test { /// Test that we can push and retrieve a stack name. - function testPushAndRetrieveStackNameSingle(ParseState memory state, bytes32 word) external { + function testPushAndRetrieveStackNameSingle(ParseState memory state, bytes32 word) external pure { state.lineTracker = 0; state.topLevel1 = 0; state.stackNames = 0; @@ -28,7 +28,7 @@ contract LibParseStackNameTest is Test { } /// Test that we can push and retrieve two different stack names. - function testPushAndRetrieveStackNameDouble(ParseState memory state, bytes32 word1, bytes32 word2) external { + function testPushAndRetrieveStackNameDouble(ParseState memory state, bytes32 word1, bytes32 word2) external pure { vm.assume(word1 != word2); state.lineTracker = 0; state.topLevel1 = 0; @@ -58,7 +58,7 @@ contract LibParseStackNameTest is Test { } /// Test that two identical stack names are not pushed. - function testPushAndRetrieveStackNameDoubleIdentical(ParseState memory state, bytes32 word) external { + function testPushAndRetrieveStackNameDoubleIdentical(ParseState memory state, bytes32 word) external pure { state.lineTracker = 0; state.topLevel1 = 0; state.stackNames = 0; @@ -76,7 +76,7 @@ contract LibParseStackNameTest is Test { } /// Test that we can push and retrieve many stack names. - function testPushAndRetrieveStackNameMany(ParseState memory state, uint256 n) external { + function testPushAndRetrieveStackNameMany(ParseState memory state, uint256 n) external pure { n = bound(n, 1, 100); state.lineTracker = 0; state.topLevel1 = 0; diff --git a/test/src/lib/parse/LibParseState.constantValueBloom.t.sol b/test/src/lib/parse/LibParseState.constantValueBloom.t.sol index 974a2fc09..92905b73e 100644 --- a/test/src/lib/parse/LibParseState.constantValueBloom.t.sol +++ b/test/src/lib/parse/LibParseState.constantValueBloom.t.sol @@ -8,17 +8,17 @@ import {LibCtPop} from "rain.math.binary/lib/LibCtPop.sol"; /// @title LibParseStateConstantValueBloomTest contract LibParseStateConstantValueBloomTest is Test { /// This is a kinda pointless test, it just duplicates the internal logic... - function testConstantValueBloom(uint256 value) external { + function testConstantValueBloom(uint256 value) external pure { assertEq(LibParseState.constantValueBloom(value), uint256(1) << (value % 256)); } /// Exactly one bit should be set for any value. - function testConstantValueBloomSingleBit(uint256 value) external { + function testConstantValueBloomSingleBit(uint256 value) external pure { assertEq(LibCtPop.ctpop(LibParseState.constantValueBloom(value)), 1); } /// All bits should be set over 256 values. - function testConstantValueBloomAllBits() external { + function testConstantValueBloomAllBits() external pure { uint256 bloom = 0; for (uint256 i = 0; i < 256; i++) { bloom |= LibParseState.constantValueBloom(i); diff --git a/test/src/lib/parse/LibParseState.exportSubParsers.t.sol b/test/src/lib/parse/LibParseState.exportSubParsers.t.sol index 7ba1f03fe..fdafd51af 100644 --- a/test/src/lib/parse/LibParseState.exportSubParsers.t.sol +++ b/test/src/lib/parse/LibParseState.exportSubParsers.t.sol @@ -11,7 +11,7 @@ contract LibParseStateExportSubParsersTest is Test { using LibBytes for bytes; /// Can round trip any array through the sub parser LL. - function testExportSubParsers(ParseState memory state, address[] memory values) external { + function testExportSubParsers(ParseState memory state, address[] memory values) external pure { uint256 cursor = Pointer.unwrap(state.data.dataPointer()); state.subParsers = 0; for (uint256 i = 0; i < values.length; i++) { diff --git a/test/src/lib/parse/LibParseState.newActiveSourcePointer.t.sol b/test/src/lib/parse/LibParseState.newActiveSourcePointer.t.sol index 7d6e2de4e..9fb516947 100644 --- a/test/src/lib/parse/LibParseState.newActiveSourcePointer.t.sol +++ b/test/src/lib/parse/LibParseState.newActiveSourcePointer.t.sol @@ -5,7 +5,7 @@ import {Test} from "forge-std/Test.sol"; import {EMPTY_ACTIVE_SOURCE, LibParseState} from "src/lib/parse/LibParseState.sol"; contract LibParseStateNewActiveSourcePointerTest is Test { - function checkPointer(uint256 pointer, uint256 expectedSource) internal { + function checkPointer(uint256 pointer, uint256 expectedSource) internal pure { uint256 activeSource; assembly ("memory-safe") { activeSource := mload(pointer) @@ -17,7 +17,7 @@ contract LibParseStateNewActiveSourcePointerTest is Test { /// If the old pointer is zero, the new pointer should point to /// EMPTY_ACTIVE_SOURCE. /// The fuzzed bytes just ensure the memory pointer is always different. - function testZeroOldPointer(bytes memory) external { + function testZeroOldPointer(bytes memory) external pure { uint256 oldPointer = 0; uint256 newPointer = LibParseState.newActiveSourcePointer(oldPointer); checkPointer(newPointer, EMPTY_ACTIVE_SOURCE); @@ -25,7 +25,7 @@ contract LibParseStateNewActiveSourcePointerTest is Test { /// No matter the alignment of the free memory pointer, the new pointer /// should always be aligned. - function testAlignedOldPointer(uint256 offset0, uint256 offset1) external { + function testAlignedOldPointer(uint256 offset0, uint256 offset1) external pure { uint256 originalPointer0; offset0 = bound(offset0, 0, 0x100); assembly ("memory-safe") { @@ -50,7 +50,7 @@ contract LibParseStateNewActiveSourcePointerTest is Test { /// If the free memory pointer is aligned, the new pointer should be /// the same as the free memory pointer. - function testPreUnalignedNewPointer() external { + function testPreUnalignedNewPointer() external pure { uint256 originalPointer0; assembly ("memory-safe") { originalPointer0 := mload(0x40) @@ -76,7 +76,7 @@ contract LibParseStateNewActiveSourcePointerTest is Test { /// No matter the content of what the active source pointer points to, /// when a new one is created the old content should point to the new /// content. - function testPostUnalignedNewPointer(uint256 activeSource) external { + function testPostUnalignedNewPointer(uint256 activeSource) external pure { uint256 activeSourcePtr0 = LibParseState.newActiveSourcePointer(0); assembly ("memory-safe") { mstore(activeSourcePtr0, activeSource) diff --git a/test/src/lib/parse/LibParseState.pushConstantValue.t.sol b/test/src/lib/parse/LibParseState.pushConstantValue.t.sol index 09ec4a3b9..1cb6a242a 100644 --- a/test/src/lib/parse/LibParseState.pushConstantValue.t.sol +++ b/test/src/lib/parse/LibParseState.pushConstantValue.t.sol @@ -14,7 +14,7 @@ contract LibParseStatePushConstantValueTest is Test { bytes memory meta, bytes memory operandHandlers, bytes memory literalParsers - ) external { + ) external pure { // Start with a fresh state. ParseState memory state = LibParseState.newState(data, meta, operandHandlers, literalParsers); @@ -24,7 +24,7 @@ contract LibParseStatePushConstantValueTest is Test { /// Pushing any value onto an empty constants LL should result in that value /// in the state with a pointer to 0. - function testPushConstantValueSingle(uint256 value) external { + function testPushConstantValueSingle(uint256 value) external pure { // Start with a fresh state. ParseState memory state = LibParseState.newState("", "", "", ""); @@ -53,7 +53,7 @@ contract LibParseStatePushConstantValueTest is Test { } /// Can push many values to the constants LL. - function testPushConstantValueMany(uint256[] memory values) external { + function testPushConstantValueMany(uint256[] memory values) external pure { vm.assume(values.length > 0); // Start with a fresh state. ParseState memory state = LibParseState.newState("", "", "", ""); diff --git a/test/src/lib/parse/LibParseState.pushSubParser.t.sol b/test/src/lib/parse/LibParseState.pushSubParser.t.sol index 3b1267b5d..8aa8a530c 100644 --- a/test/src/lib/parse/LibParseState.pushSubParser.t.sol +++ b/test/src/lib/parse/LibParseState.pushSubParser.t.sol @@ -24,7 +24,7 @@ contract LibParseStatePushSubParserTest is Test { /// Pushing any value onto an empty sub parser LL should result in that value /// in the state with a pointer to 0. - function testPushSubParserZero(ParseState memory state, address value) external { + function testPushSubParserZero(ParseState memory state, address value) external pure { state.subParsers = 0; uint256 cursor = Pointer.unwrap(state.data.dataPointer()); state.pushSubParser(cursor, uint256(uint160(value))); @@ -41,6 +41,7 @@ contract LibParseStatePushSubParserTest is Test { /// Can push multiple values onto the sub parser LL. function testPushSubParserMultiple(ParseState memory state, address value0, address value1, address value2) external + pure { { uint256 cursor = Pointer.unwrap(state.data.dataPointer()); @@ -72,7 +73,7 @@ contract LibParseStatePushSubParserTest is Test { } /// Pushing a whole list of values onto the sub parser LL. - function testPushSubParserList(ParseState memory state, address[] memory values) external { + function testPushSubParserList(ParseState memory state, address[] memory values) external pure { vm.assume(values.length > 0); state.subParsers = 0; uint256 cursor = Pointer.unwrap(state.data.dataPointer()); diff --git a/test/src/lib/parse/LibSubParse.subParserExtern.t.sol b/test/src/lib/parse/LibSubParse.subParserExtern.t.sol index 336644eff..8cc29966d 100644 --- a/test/src/lib/parse/LibSubParse.subParserExtern.t.sol +++ b/test/src/lib/parse/LibSubParse.subParserExtern.t.sol @@ -22,7 +22,7 @@ contract LibSubParseSubParserExternTest is Test { uint8 outputs, uint16 operandValue, uint8 opcodeIndex - ) external { + ) external pure { inputs = uint8(bound(inputs, 0, 0xF)); outputs = uint8(bound(outputs, 0, 0xF)); (bool success, bytes memory bytecode, uint256[] memory constants) = LibSubParse.subParserExtern( diff --git a/test/src/lib/parse/literal/LibParseLiteralDecimal.parseDecimal.t.sol b/test/src/lib/parse/literal/LibParseLiteralDecimal.parseDecimal.t.sol index 3007f7621..1c510c1ba 100644 --- a/test/src/lib/parse/literal/LibParseLiteralDecimal.parseDecimal.t.sol +++ b/test/src/lib/parse/literal/LibParseLiteralDecimal.parseDecimal.t.sol @@ -23,7 +23,7 @@ contract LibParseLiteralDecimalTest is Test { using LibParseLiteral for ParseState; using LibParseLiteralDecimal for ParseState; - function checkParseDecimal(string memory data, uint256 expectedValue, uint256 expectedCursorAfter) internal { + function checkParseDecimal(string memory data, uint256 expectedValue, uint256 expectedCursorAfter) internal pure { ParseState memory state = LibParseState.newState(bytes(data), "", "", ""); uint256 cursor = Pointer.unwrap(state.data.dataPointer()); (uint256 cursorAfter, uint256 value) = state.parseDecimal(cursor, Pointer.unwrap(state.data.endDataPointer())); @@ -58,14 +58,14 @@ contract LibParseLiteralDecimalTest is Test { } /// Fuzz and round trip. - function testParseLiteralDecimalRoundTrip(uint256 value) external { + function testParseLiteralDecimalRoundTrip(uint256 value) external pure { value = bound(value, 0, type(uint256).max / 1e18); string memory valueStr = Strings.toString(value); checkParseDecimal(valueStr, value * 1e18, bytes(valueStr).length); } /// Check some specific examples. - function testParseLiteralDecimalSpecific() external { + function testParseLiteralDecimalSpecific() external pure { checkParseDecimal("0", 0e18, 1); checkParseDecimal("1", 1e18, 1); checkParseDecimal("2", 2e18, 1); @@ -80,7 +80,7 @@ contract LibParseLiteralDecimalTest is Test { } /// Check some examples of decimals. - function testParseLiteralDecimalDecimals() external { + function testParseLiteralDecimalDecimals() external pure { checkParseDecimal("0.0", 0e18, 3); checkParseDecimal("1.0", 1e18, 3); checkParseDecimal("2.0", 2e18, 3); @@ -120,7 +120,7 @@ contract LibParseLiteralDecimalTest is Test { /// Check some examples of exponents. /// Checks e in the 2nd position. - function testParseLiteralDecimalExponents() external { + function testParseLiteralDecimalExponents() external pure { checkParseDecimal("0e0", 0e18, 3); checkParseDecimal("1e0", 1e18, 3); checkParseDecimal("2e0", 2e18, 3); @@ -160,7 +160,7 @@ contract LibParseLiteralDecimalTest is Test { /// Check some examples of exponents. /// Checks e in the 3rd position. - function testParseLiteralDecimalExponents2() external { + function testParseLiteralDecimalExponents2() external pure { checkParseDecimal("0e00", 0e18, 4); checkParseDecimal("1e00", 1e18, 4); checkParseDecimal("2e00", 2e18, 4); @@ -211,7 +211,7 @@ contract LibParseLiteralDecimalTest is Test { } // Test integer with capital E - function testParseLiteralDecimalExponents2Capital() external { + function testParseLiteralDecimalExponents2Capital() external pure { checkParseDecimal("0E00", 0e18, 4); checkParseDecimal("1E00", 1e18, 4); checkParseDecimal("2E00", 2e18, 4); @@ -249,7 +249,7 @@ contract LibParseLiteralDecimalTest is Test { } // Test decimals with exponents. - function testParseLiteralDecimalExponents3() external { + function testParseLiteralDecimalExponents3() external pure { checkParseDecimal("0.0e0", 0, 5); checkParseDecimal("1.0e0", 1e18, 5); checkParseDecimal("2.0e0", 2e18, 5); @@ -304,7 +304,7 @@ contract LibParseLiteralDecimalTest is Test { } /// Test capital E - function testParseLiteralDecimalExponents4() external { + function testParseLiteralDecimalExponents4() external pure { checkParseDecimal("0.0E0", 0, 5); checkParseDecimal("1.0E0", 1e18, 5); checkParseDecimal("2.0E0", 2e18, 5); @@ -335,7 +335,7 @@ contract LibParseLiteralDecimalTest is Test { } /// Test some negative exponents. - function testParseLiteralDecimalNegativeExponents() external { + function testParseLiteralDecimalNegativeExponents() external pure { checkParseDecimal("0.0e-0", 0, 6); checkParseDecimal("1.0e-0", 1e18, 6); checkParseDecimal("2.0e-0", 2e18, 6); @@ -383,7 +383,7 @@ contract LibParseLiteralDecimalTest is Test { } /// Test trailing zeros. - function testParseLiteralDecimalTrailingZeros() external { + function testParseLiteralDecimalTrailingZeros() external pure { checkParseDecimal("0.000000000000000000", 0, 20); checkParseDecimal("1.000000000000000000", 1e18, 20); checkParseDecimal("2.000000000000000000", 2e18, 20); @@ -413,7 +413,7 @@ contract LibParseLiteralDecimalTest is Test { } // Test some unrelated data after the decimal. - function testParseLiteralDecimalUnrelated() external { + function testParseLiteralDecimalUnrelated() external pure { checkParseDecimal("0.0hello", 0, 3); checkParseDecimal("1.0hello", 1e18, 3); checkParseDecimal("2.0hello", 2e18, 3); diff --git a/test/src/lib/parse/literal/LibParseLiteralDecimal.parseDecimalFloat.t.sol b/test/src/lib/parse/literal/LibParseLiteralDecimal.parseDecimalFloat.t.sol index 2aa79d1c7..8ea7e1251 100644 --- a/test/src/lib/parse/literal/LibParseLiteralDecimal.parseDecimalFloat.t.sol +++ b/test/src/lib/parse/literal/LibParseLiteralDecimal.parseDecimalFloat.t.sol @@ -26,7 +26,7 @@ contract LibParseLiteralDecimalParseDecimalFloatTest is Test { int256 expectedSignedCoefficient, int256 expectedExponent, uint256 expectedCursorAfter - ) internal { + ) internal pure { ParseState memory state = LibParseState.newState(bytes(data), "", "", ""); uint256 cursor = Pointer.unwrap(state.data.dataPointer()); (uint256 cursorAfter, int256 signedCoefficient, int256 exponent) = @@ -53,7 +53,7 @@ contract LibParseLiteralDecimalParseDecimalFloatTest is Test { } /// Fuzz and round trip. - function testParseLiteralDecimalFloatFuzz(uint256 value, uint8 leadingZerosCount, bool isNeg) external { + function testParseLiteralDecimalFloatFuzz(uint256 value, uint8 leadingZerosCount, bool isNeg) external pure { value = bound(value, 0, uint256(type(int256).max) + (isNeg ? 1 : 0)); string memory str = value.toString(); @@ -73,7 +73,7 @@ contract LibParseLiteralDecimalParseDecimalFloatTest is Test { } /// Check some specific examples. - function testParseLiteralDecimalFloatSpecific() external { + function testParseLiteralDecimalFloatSpecific() external pure { checkParseDecimalFloat("0", 0, 0, 1); checkParseDecimalFloat("1", 1, 0, 1); checkParseDecimalFloat("10", 10, 0, 2); @@ -83,7 +83,7 @@ contract LibParseLiteralDecimalParseDecimalFloatTest is Test { } /// Check some specific examples with leading zeros. - function testParseLiteralDecimalFloatLeadingZeros() external { + function testParseLiteralDecimalFloatLeadingZeros() external pure { checkParseDecimalFloat("0000", 0, 0, 4); checkParseDecimalFloat("0001", 1, 0, 4); checkParseDecimalFloat("0010", 10, 0, 4); @@ -99,7 +99,7 @@ contract LibParseLiteralDecimalParseDecimalFloatTest is Test { } /// Check some examples of decimals. - function testParseLiteralDecimalFloatDecimals() external { + function testParseLiteralDecimalFloatDecimals() external pure { checkParseDecimalFloat("0.1", 1, -1, 3); checkParseDecimalFloat("0.01", 1, -2, 4); checkParseDecimalFloat("0.001", 1, -3, 5); @@ -159,7 +159,7 @@ contract LibParseLiteralDecimalParseDecimalFloatTest is Test { } /// Check some examples of exponents. - function testParseLiteralDecimalFloatExponents() external { + function testParseLiteralDecimalFloatExponents() external pure { checkParseDecimalFloat("0e0", 0, 0, 3); // A capital E. checkParseDecimalFloat("0E0", 0, 0, 3); @@ -244,7 +244,7 @@ contract LibParseLiteralDecimalParseDecimalFloatTest is Test { } /// Test some unrelated data after the decimal. - function testParseLiteralDecimalFloatUnrelated() external { + function testParseLiteralDecimalFloatUnrelated() external pure { checkParseDecimalFloat("0.0hello", 0, 0, 3); checkParseDecimalFloat("0.0e0hello", 0, 0, 5); checkParseDecimalFloat("0.0e1hello", 0, 1, 5); diff --git a/test/src/lib/parse/literal/LibParseLiteralDecimal.unsafeStrToSignedInt.t.sol b/test/src/lib/parse/literal/LibParseLiteralDecimal.unsafeStrToSignedInt.t.sol index 0482abcc1..a5139eea4 100644 --- a/test/src/lib/parse/literal/LibParseLiteralDecimal.unsafeStrToSignedInt.t.sol +++ b/test/src/lib/parse/literal/LibParseLiteralDecimal.unsafeStrToSignedInt.t.sol @@ -14,7 +14,7 @@ contract TestLibParseLiteralDecimalUnsafeStrToSignedInt is Test { using LibParseLiteralDecimal for ParseState; /// Test round tripping strings through the unsafeStrToSignedInt function. - function testUnsafeStrToSignedIntRoundTrip(uint256 value, uint8 leadingZerosCount, bool isNeg) external { + function testUnsafeStrToSignedIntRoundTrip(uint256 value, uint8 leadingZerosCount, bool isNeg) external pure { value = bound(value, 0, uint256(type(int256).max) + (isNeg ? 1 : 0)); string memory str = value.toString(); diff --git a/test/src/lib/parse/literal/LibParseLiteralHex.boundHex.t.sol b/test/src/lib/parse/literal/LibParseLiteralHex.boundHex.t.sol index ac62e76d0..42bbc15b9 100644 --- a/test/src/lib/parse/literal/LibParseLiteralHex.boundHex.t.sol +++ b/test/src/lib/parse/literal/LibParseLiteralHex.boundHex.t.sol @@ -16,14 +16,14 @@ contract LibParseLiteralBoundLiteralHexTest is ParseLiteralTest { uint256 expectedInnerStart, uint256 expectedInnerEnd, uint256 expectedOuterEnd - ) internal { + ) internal pure { checkLiteralBounds( LibParseLiteralHex.boundHex, data, expectedInnerStart, expectedInnerEnd, expectedOuterEnd, expectedOuterEnd ); } /// Check some bounds for some strings. - function testParseLiteralBoundLiteralHexBounds() external { + function testParseLiteralBoundLiteralHexBounds() external pure { checkHexBounds("0x", 2, 2, 2); checkHexBounds("0x00", 2, 4, 4); checkHexBounds("0x0000", 2, 6, 6); @@ -32,6 +32,7 @@ contract LibParseLiteralBoundLiteralHexTest is ParseLiteralTest { /// Fuzz the parser with hex data. function testParseLiteralBoundLiteralHexFuzz(string memory str, bytes1 delimByte, string memory anyOtherString) external + pure { LibLiteralString.conformStringToHexDigits(str); string memory delimString = string(abi.encodePacked(delimByte)); diff --git a/test/src/lib/parse/literal/LibParseLiteralHex.parseHex.t.sol b/test/src/lib/parse/literal/LibParseLiteralHex.parseHex.t.sol index 999a1a4fa..0d9de1f10 100644 --- a/test/src/lib/parse/literal/LibParseLiteralHex.parseHex.t.sol +++ b/test/src/lib/parse/literal/LibParseLiteralHex.parseHex.t.sol @@ -17,7 +17,7 @@ contract LibParseLiteralHexBoundHexTest is Test { using LibBytes for bytes; /// Fuzz and round trip. - function testParseLiteralHexRoundTrip(uint256 value) external { + function testParseLiteralHexRoundTrip(uint256 value) external pure { string memory hexString = Strings.toHexString(value); ParseState memory state = LibParseState.newState(bytes(hexString), "", "", ""); uint256 cursor = Pointer.unwrap(state.data.dataPointer()); diff --git a/test/src/lib/parse/literal/LibParseLiteralString.boundString.t.sol b/test/src/lib/parse/literal/LibParseLiteralString.boundString.t.sol index 7e8ebcc41..e17ab7237 100644 --- a/test/src/lib/parse/literal/LibParseLiteralString.boundString.t.sol +++ b/test/src/lib/parse/literal/LibParseLiteralString.boundString.t.sol @@ -47,7 +47,7 @@ contract LibParseLiteralStringBoundTest is Test { uint256 expectedInnerStart, uint256 expectedInnerEnd, uint256 expectedOuterEnd - ) internal { + ) internal view { (uint256 outerStart, uint256 innerStart, uint256 innerEnd, uint256 outerEnd) = this.externalBoundString(bytes(str)); assertEq(innerStart, outerStart + expectedInnerStart, "innerStart"); @@ -57,7 +57,7 @@ contract LibParseLiteralStringBoundTest is Test { /// All valid strings should parse with the outer start and end either side /// of their quotes and the inner start and end at their data bounds. - function testParseStringLiteralBounds(string memory str) external { + function testParseStringLiteralBounds(string memory str) external view { vm.assume(bytes(str).length < 0x20); LibLiteralString.conformValidPrintableStringContent(str); diff --git a/test/src/lib/parse/literal/LibParseLiteralString.parseString.t.sol b/test/src/lib/parse/literal/LibParseLiteralString.parseString.t.sol index 6dd865f81..0e824dea3 100644 --- a/test/src/lib/parse/literal/LibParseLiteralString.parseString.t.sol +++ b/test/src/lib/parse/literal/LibParseLiteralString.parseString.t.sol @@ -18,7 +18,7 @@ contract LibParseLiteralStringTest is Test { using LibParseLiteralString for ParseState; /// Check that an empty string literal is parsed correctly. - function testParseStringLiteralEmpty() external { + function testParseStringLiteralEmpty() external pure { ParseState memory state = LibParseState.newState("\"\"", "", "", ""); uint256 cursor = Pointer.unwrap(state.data.dataPointer()); (uint256 cursorAfter, uint256 value) = state.parseString(cursor, Pointer.unwrap(state.data.endDataPointer())); @@ -29,7 +29,7 @@ contract LibParseLiteralStringTest is Test { } /// The parser will only accept strings that are valid according to the mask. - function testParseStringLiteralAny(bytes memory data) external { + function testParseStringLiteralAny(bytes memory data) external pure { LibLiteralString.conformStringToMask(string(data), CMASK_STRING_LITERAL_TAIL, 0x80); vm.assume(data.length < 32); ParseState memory state = LibParseState.newState(bytes(string.concat("\"", string(data), "\"")), "", "", "");