diff --git a/.gitmodules b/.gitmodules index 9585af0d..1a199148 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,12 +7,6 @@ [submodule "lib/sol.lib.binmaskflag"] path = lib/sol.lib.binmaskflag url = https://github.com/rainprotocol/sol.lib.binmaskflag -[submodule "lib/rain.math.fixedpoint"] - path = lib/rain.math.fixedpoint - url = https://github.com/rainprotocol/rain.math.fixedpoint -[submodule "lib/rain.chainlink"] - path = lib/rain.chainlink - url = https://github.com/rainprotocol/rain.chainlink [submodule "lib/rain.intorastring"] path = lib/rain.intorastring url = https://github.com/rainlanguage/rain.intorastring diff --git a/foundry.toml b/foundry.toml index bc40f6ec..a3eae5b8 100644 --- a/foundry.toml +++ b/foundry.toml @@ -34,7 +34,6 @@ 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/", diff --git a/lib/rain.chainlink b/lib/rain.chainlink deleted file mode 160000 index c9844b3f..00000000 --- a/lib/rain.chainlink +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c9844b3f49432d809f506fb104fe9ea6c7be7031 diff --git a/lib/rain.math.fixedpoint b/lib/rain.math.fixedpoint deleted file mode 160000 index f0d74ed3..00000000 --- a/lib/rain.math.fixedpoint +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f0d74ed3ef41f2a71fc43c99e81c3918b64e874b diff --git a/src/concrete/extern/RainterpreterReferenceExternNPE2.sol b/src/concrete/extern/RainterpreterReferenceExternNPE2.sol index 097bc5fa..f326cd14 100644 --- a/src/concrete/extern/RainterpreterReferenceExternNPE2.sol +++ b/src/concrete/extern/RainterpreterReferenceExternNPE2.sol @@ -25,7 +25,6 @@ import {LibExternOpContextCallingContractNPE2} from import {LibExternOpContextRainlenNPE2} from "../../lib/extern/reference/op/LibExternOpContextRainlenNPE2.sol"; import {LibParseLiteralRepeat} from "../../lib/extern/reference/literal/LibParseLiteralRepeat.sol"; import {LibParseLiteralDecimal} from "../../lib/parse/literal/LibParseLiteralDecimal.sol"; -import {LibFixedPointDecimalScale} from "rain.math.fixedpoint/lib/LibFixedPointDecimalScale.sol"; import { DESCRIBED_BY_META_HASH, PARSE_META as SUB_PARSER_PARSE_META, diff --git a/src/lib/op/LibAllStandardOpsNP.sol b/src/lib/op/LibAllStandardOpsNP.sol index f84d7479..747057bd 100644 --- a/src/lib/op/LibAllStandardOpsNP.sol +++ b/src/lib/op/LibAllStandardOpsNP.sol @@ -91,7 +91,7 @@ import {LibOpScaleNDynamic} from "./math/LibOpScaleNDynamic.sol"; import {LibOpScaleN} from "./math/LibOpScaleN.sol"; // import {LibOpSnapToUnit} from "./math/LibOpSnapToUnit.sol"; // import {LibOpSqrt} from "./math/LibOpSqrt.sol"; -import {LibOpSub} from "./math/LibOpSub.sol"; +// import {LibOpSub} from "./math/LibOpSub.sol"; import {LibOpGetNP} from "./store/LibOpGetNP.sol"; import {LibOpSetNP} from "./store/LibOpSetNP.sol"; diff --git a/src/lib/op/bitwise/LibOpCtPopNP.sol b/src/lib/op/bitwise/LibOpCtPopNP.sol index 9797d360..e77605ca 100644 --- a/src/lib/op/bitwise/LibOpCtPopNP.sol +++ b/src/lib/op/bitwise/LibOpCtPopNP.sol @@ -6,7 +6,6 @@ import {Operand} from "rain.interpreter.interface/interface/unstable/IInterprete import {InterpreterStateNP} from "../../state/LibInterpreterStateNP.sol"; import {IntegrityCheckStateNP} from "../../integrity/LibIntegrityCheckNP.sol"; import {LibCtPop} from "rain.math.binary/lib/LibCtPop.sol"; -import {FIXED_POINT_ONE} from "rain.math.fixedpoint/lib/FixedPointDecimalConstants.sol"; /// @title LibOpCtPopNP /// @notice An opcode that counts the number of bits set in a word. This is diff --git a/src/lib/op/erc20/LibOpERC20Allowance.sol b/src/lib/op/erc20/LibOpERC20Allowance.sol index 5400af1c..ac6f76f8 100644 --- a/src/lib/op/erc20/LibOpERC20Allowance.sol +++ b/src/lib/op/erc20/LibOpERC20Allowance.sol @@ -6,7 +6,6 @@ import {Pointer} from "rain.solmem/lib/LibPointer.sol"; import {IntegrityCheckStateNP} from "../../integrity/LibIntegrityCheckNP.sol"; import {Operand} from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; import {InterpreterStateNP} from "../../state/LibInterpreterStateNP.sol"; -import {FLAG_SATURATE, LibFixedPointDecimalScale} from "rain.math.fixedpoint/lib/LibFixedPointDecimalScale.sol"; import {IERC20Metadata} from "openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol"; /// @title LibOpERC20Allowance diff --git a/src/lib/op/erc20/LibOpERC20BalanceOf.sol b/src/lib/op/erc20/LibOpERC20BalanceOf.sol index be1ab49c..9190afe4 100644 --- a/src/lib/op/erc20/LibOpERC20BalanceOf.sol +++ b/src/lib/op/erc20/LibOpERC20BalanceOf.sol @@ -6,7 +6,6 @@ import {Pointer} from "rain.solmem/lib/LibPointer.sol"; import {IntegrityCheckStateNP} from "../../integrity/LibIntegrityCheckNP.sol"; import {Operand} from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; import {InterpreterStateNP} from "../../state/LibInterpreterStateNP.sol"; -import {LibFixedPointDecimalScale} from "rain.math.fixedpoint/lib/LibFixedPointDecimalScale.sol"; import {IERC20Metadata} from "openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol"; /// @title LibOpERC20BalanceOf diff --git a/src/lib/op/erc20/LibOpERC20TotalSupply.sol b/src/lib/op/erc20/LibOpERC20TotalSupply.sol index 957e630e..56a0161b 100644 --- a/src/lib/op/erc20/LibOpERC20TotalSupply.sol +++ b/src/lib/op/erc20/LibOpERC20TotalSupply.sol @@ -6,7 +6,6 @@ import {Pointer} from "rain.solmem/lib/LibPointer.sol"; import {IntegrityCheckStateNP} from "../../integrity/LibIntegrityCheckNP.sol"; import {Operand} from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; import {InterpreterStateNP} from "../../state/LibInterpreterStateNP.sol"; -import {LibFixedPointDecimalScale} from "rain.math.fixedpoint/lib/LibFixedPointDecimalScale.sol"; import {IERC20Metadata} from "openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol"; /// @title LibOpERC20TotalSupply diff --git a/src/lib/op/evm/LibOpBlockNumberNP.sol b/src/lib/op/evm/LibOpBlockNumberNP.sol index a6b02616..b6905f58 100644 --- a/src/lib/op/evm/LibOpBlockNumberNP.sol +++ b/src/lib/op/evm/LibOpBlockNumberNP.sol @@ -5,7 +5,6 @@ import {Pointer} from "rain.solmem/lib/LibPointer.sol"; import {Operand} from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; import {InterpreterStateNP} from "../../state/LibInterpreterStateNP.sol"; import {IntegrityCheckStateNP} from "../../integrity/LibIntegrityCheckNP.sol"; -import {FIXED_POINT_ONE} from "rain.math.fixedpoint/lib/FixedPointDecimalConstants.sol"; /// @title LibOpBlockNumberNP /// Implementation of the EVM `BLOCKNUMBER` opcode as a standard Rainlang opcode. diff --git a/src/lib/op/evm/LibOpChainIdNP.sol b/src/lib/op/evm/LibOpChainIdNP.sol index cb97e5bf..ff3b502f 100644 --- a/src/lib/op/evm/LibOpChainIdNP.sol +++ b/src/lib/op/evm/LibOpChainIdNP.sol @@ -5,7 +5,6 @@ import {Pointer} from "rain.solmem/lib/LibPointer.sol"; import {Operand} from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; import {InterpreterStateNP} from "../../state/LibInterpreterStateNP.sol"; import {IntegrityCheckStateNP} from "../../integrity/LibIntegrityCheckNP.sol"; -import {FIXED_POINT_ONE} from "rain.math.fixedpoint/lib/FixedPointDecimalConstants.sol"; /// @title LibOpChainIdNP /// Implementation of the EVM `CHAINID` opcode as a standard Rainlang opcode. diff --git a/src/lib/op/evm/LibOpTimestampNP.sol b/src/lib/op/evm/LibOpTimestampNP.sol index f7d08feb..a1769b48 100644 --- a/src/lib/op/evm/LibOpTimestampNP.sol +++ b/src/lib/op/evm/LibOpTimestampNP.sol @@ -5,7 +5,6 @@ import {IntegrityCheckStateNP} from "../../integrity/LibIntegrityCheckNP.sol"; import {Operand} from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; import {InterpreterStateNP, LibInterpreterStateNP} from "../../state/LibInterpreterStateNP.sol"; import {Pointer} from "rain.solmem/lib/LibPointer.sol"; -import {FIXED_POINT_ONE} from "rain.math.fixedpoint/lib/FixedPointDecimalConstants.sol"; /// @title LibOpTimestampNP /// Implementation of the EVM `TIMESTAMP` opcode as a standard Rainlang opcode. diff --git a/src/lib/op/math/LibOpE.sol b/src/lib/op/math/LibOpE.sol index 5a24912d..f1c17ee3 100644 --- a/src/lib/op/math/LibOpE.sol +++ b/src/lib/op/math/LibOpE.sol @@ -5,7 +5,6 @@ import {Pointer} from "rain.solmem/lib/LibPointer.sol"; import {Operand} from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; import {InterpreterStateNP} from "../../state/LibInterpreterStateNP.sol"; import {IntegrityCheckStateNP} from "../../integrity/LibIntegrityCheckNP.sol"; -import {FIXED_POINT_ONE, FIXED_POINT_E} from "rain.math.fixedpoint/lib/FixedPointDecimalConstants.sol"; /// @title LibOpE /// Stacks the mathematical constant e. diff --git a/src/lib/op/math/LibOpScale18.sol b/src/lib/op/math/LibOpScale18.sol index 2904537b..9e889bc0 100644 --- a/src/lib/op/math/LibOpScale18.sol +++ b/src/lib/op/math/LibOpScale18.sol @@ -1,7 +1,6 @@ // SPDX-License-Identifier: CAL pragma solidity ^0.8.18; -import {LibFixedPointDecimalScale} from "rain.math.fixedpoint/lib/LibFixedPointDecimalScale.sol"; import {Operand} from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; import {InterpreterStateNP} from "../../state/LibInterpreterStateNP.sol"; import {IntegrityCheckStateNP} from "../../integrity/LibIntegrityCheckNP.sol"; diff --git a/src/lib/op/math/LibOpScale18Dynamic.sol b/src/lib/op/math/LibOpScale18Dynamic.sol index 071d6d24..ed0beeda 100644 --- a/src/lib/op/math/LibOpScale18Dynamic.sol +++ b/src/lib/op/math/LibOpScale18Dynamic.sol @@ -1,7 +1,6 @@ // SPDX-License-Identifier: CAL pragma solidity ^0.8.18; -import {LibFixedPointDecimalScale, DECIMAL_MAX_SAFE_INT} from "rain.math.fixedpoint/lib/LibFixedPointDecimalScale.sol"; import {MASK_2BIT} from "sol.lib.binmaskflag/Binary.sol"; import {Operand} from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; import {Pointer} from "rain.solmem/lib/LibPointer.sol"; diff --git a/src/lib/op/math/LibOpScaleN.sol b/src/lib/op/math/LibOpScaleN.sol index b6149139..11f4f2bd 100644 --- a/src/lib/op/math/LibOpScaleN.sol +++ b/src/lib/op/math/LibOpScaleN.sol @@ -1,7 +1,6 @@ // SPDX-License-Identifier: CAL pragma solidity ^0.8.18; -import {LibFixedPointDecimalScale} from "rain.math.fixedpoint/lib/LibFixedPointDecimalScale.sol"; import {Operand} from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; import {InterpreterStateNP} from "../../state/LibInterpreterStateNP.sol"; import {IntegrityCheckStateNP} from "../../integrity/LibIntegrityCheckNP.sol"; diff --git a/src/lib/op/math/LibOpScaleNDynamic.sol b/src/lib/op/math/LibOpScaleNDynamic.sol index b19c6789..f56d9225 100644 --- a/src/lib/op/math/LibOpScaleNDynamic.sol +++ b/src/lib/op/math/LibOpScaleNDynamic.sol @@ -5,7 +5,6 @@ import {Operand} from "rain.interpreter.interface/interface/unstable/IInterprete import {IntegrityCheckStateNP} from "../../integrity/LibIntegrityCheckNP.sol"; import {InterpreterStateNP} from "../../state/LibInterpreterStateNP.sol"; import {Pointer} from "rain.solmem/lib/LibPointer.sol"; -import {LibFixedPointDecimalScale, DECIMAL_MAX_SAFE_INT} from "rain.math.fixedpoint/lib/LibFixedPointDecimalScale.sol"; import {MASK_2BIT} from "sol.lib.binmaskflag/Binary.sol"; import {LibParseLiteral} from "../../parse/literal/LibParseLiteral.sol"; diff --git a/src/lib/op/math/LibOpSub.sol b/src/lib/op/math/LibOpSub.sol index 79e44671..229c7da5 100644 --- a/src/lib/op/math/LibOpSub.sol +++ b/src/lib/op/math/LibOpSub.sol @@ -1,79 +1,79 @@ -// SPDX-License-Identifier: CAL -pragma solidity ^0.8.18; +// // SPDX-License-Identifier: CAL +// pragma solidity ^0.8.18; -import {Operand} from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; -import {Pointer} from "rain.solmem/lib/LibPointer.sol"; -import {IntegrityCheckStateNP} from "../../integrity/LibIntegrityCheckNP.sol"; -import {InterpreterStateNP} from "../../state/LibInterpreterStateNP.sol"; -import {SaturatingMath} from "rain.math.saturating/SaturatingMath.sol"; +// import {Operand} from "rain.interpreter.interface/interface/unstable/IInterpreterV4.sol"; +// import {Pointer} from "rain.solmem/lib/LibPointer.sol"; +// import {IntegrityCheckStateNP} from "../../integrity/LibIntegrityCheckNP.sol"; +// import {InterpreterStateNP} from "../../state/LibInterpreterStateNP.sol"; +// import {SaturatingMath} from "rain.math.saturating/SaturatingMath.sol"; -/// @title LibOpSub -/// @notice Opcode to subtract N integers. -library LibOpSub { - function integrity(IntegrityCheckStateNP memory, Operand operand) internal pure returns (uint256, uint256) { - // There must be at least two inputs. - uint256 inputs = (Operand.unwrap(operand) >> 0x10) & 0x0F; - inputs = inputs > 1 ? inputs : 2; - return (inputs, 1); - } +// /// @title LibOpSub +// /// @notice Opcode to subtract N integers. +// library LibOpSub { +// function integrity(IntegrityCheckStateNP memory, Operand operand) internal pure returns (uint256, uint256) { +// // There must be at least two inputs. +// uint256 inputs = (Operand.unwrap(operand) >> 0x10) & 0x0F; +// inputs = inputs > 1 ? inputs : 2; +// return (inputs, 1); +// } - function sub(uint256 a, uint256 b) internal pure returns (uint256) { - return a - b; - } +// function sub(uint256 a, uint256 b) internal pure returns (uint256) { +// return a - b; +// } - /// sub - /// Subtraction with implied overflow checks from the Solidity 0.8.x compiler. - function run(InterpreterStateNP memory, Operand operand, Pointer stackTop) internal pure returns (Pointer) { - uint256 a; - uint256 b; - uint256 saturate; - assembly ("memory-safe") { - a := mload(stackTop) - b := mload(add(stackTop, 0x20)) - stackTop := add(stackTop, 0x40) - saturate := and(operand, 1) - } - function (uint256, uint256) internal pure returns (uint256) f = - saturate > 0 ? SaturatingMath.saturatingSub : sub; - a = f(a, b); +// /// sub +// /// Subtraction with implied overflow checks from the Solidity 0.8.x compiler. +// function run(InterpreterStateNP memory, Operand operand, Pointer stackTop) internal pure returns (Pointer) { +// uint256 a; +// uint256 b; +// uint256 saturate; +// assembly ("memory-safe") { +// a := mload(stackTop) +// b := mload(add(stackTop, 0x20)) +// stackTop := add(stackTop, 0x40) +// saturate := and(operand, 1) +// } +// function (uint256, uint256) internal pure returns (uint256) f = +// saturate > 0 ? SaturatingMath.saturatingSub : sub; +// a = f(a, b); - { - uint256 inputs = (Operand.unwrap(operand) >> 0x10) & 0x0F; - uint256 i = 2; - while (i < inputs) { - assembly ("memory-safe") { - b := mload(stackTop) - stackTop := add(stackTop, 0x20) - } - a = f(a, b); - unchecked { - i++; - } - } - } +// { +// uint256 inputs = (Operand.unwrap(operand) >> 0x10) & 0x0F; +// uint256 i = 2; +// while (i < inputs) { +// assembly ("memory-safe") { +// b := mload(stackTop) +// stackTop := add(stackTop, 0x20) +// } +// a = f(a, b); +// unchecked { +// i++; +// } +// } +// } - assembly ("memory-safe") { - stackTop := sub(stackTop, 0x20) - mstore(stackTop, a) - } - return stackTop; - } +// assembly ("memory-safe") { +// stackTop := sub(stackTop, 0x20) +// mstore(stackTop, a) +// } +// return stackTop; +// } - /// Gas intensive reference implementation of subtraction for testing. - function referenceFn(InterpreterStateNP memory, Operand, uint256[] memory inputs) - internal - pure - returns (uint256[] memory outputs) - { - // Unchecked so that when we assert that an overflow error is thrown, we - // see the revert from the real function and not the reference function. - unchecked { - uint256 acc = inputs[0]; - for (uint256 i = 1; i < inputs.length; i++) { - acc -= inputs[i]; - } - outputs = new uint256[](1); - outputs[0] = acc; - } - } -} +// /// Gas intensive reference implementation of subtraction for testing. +// function referenceFn(InterpreterStateNP memory, Operand, uint256[] memory inputs) +// internal +// pure +// returns (uint256[] memory outputs) +// { +// // Unchecked so that when we assert that an overflow error is thrown, we +// // see the revert from the real function and not the reference function. +// unchecked { +// uint256 acc = inputs[0]; +// for (uint256 i = 1; i < inputs.length; i++) { +// acc -= inputs[i]; +// } +// outputs = new uint256[](1); +// outputs[0] = acc; +// } +// } +// } diff --git a/src/lib/parse/LibParseOperand.sol b/src/lib/parse/LibParseOperand.sol index e5fc6723..2a39f623 100644 --- a/src/lib/parse/LibParseOperand.sol +++ b/src/lib/parse/LibParseOperand.sol @@ -15,7 +15,6 @@ import {CMASK_OPERAND_END, CMASK_WHITESPACE, CMASK_OPERAND_START} from "./LibPar import {ParseState, OPERAND_VALUES_LENGTH, FSM_YANG_MASK} from "./LibParseState.sol"; import {LibParseError} from "./LibParseError.sol"; import {LibParseInterstitial} from "./LibParseInterstitial.sol"; -import {LibFixedPointDecimalScale, DECIMAL_MAX_SAFE_INT} from "rain.math.fixedpoint/lib/LibFixedPointDecimalScale.sol"; library LibParseOperand { using LibParseError for ParseState; diff --git a/src/lib/parse/literal/LibParseLiteral.sol b/src/lib/parse/literal/LibParseLiteral.sol index bc96453d..a470d30a 100644 --- a/src/lib/parse/literal/LibParseLiteral.sol +++ b/src/lib/parse/literal/LibParseLiteral.sol @@ -31,7 +31,6 @@ import {ParseState} from "../LibParseState.sol"; import {LibParseError} from "../LibParseError.sol"; import {LibParseInterstitial} from "../LibParseInterstitial.sol"; import {LibSubParse} from "../LibSubParse.sol"; -import {LibFixedPointDecimalScale} from "rain.math.fixedpoint/lib/LibFixedPointDecimalScale.sol"; uint256 constant LITERAL_PARSERS_LENGTH = 4; diff --git a/test/src/lib/op/bitwise/LibOpShiftBitsLeftNP.t.sol b/test/src/lib/op/bitwise/LibOpShiftBitsLeftNP.t.sol index 74d5d74d..89edf03e 100644 --- a/test/src/lib/op/bitwise/LibOpShiftBitsLeftNP.t.sol +++ b/test/src/lib/op/bitwise/LibOpShiftBitsLeftNP.t.sol @@ -15,7 +15,6 @@ import {IInterpreterStoreV2} from "rain.interpreter.interface/interface/IInterpr import {SignedContextV1} from "rain.interpreter.interface/interface/IInterpreterCallerV3.sol"; import {LibContext} from "rain.interpreter.interface/lib/caller/LibContext.sol"; import {UnsupportedBitwiseShiftAmount} from "src/error/ErrBitwise.sol"; -import {IntegerOverflow} from "rain.math.fixedpoint/error/ErrScale.sol"; import {LibOperand} from "test/lib/operand/LibOperand.sol"; contract LibOpShiftBitsLeftNPTest is OpTest { diff --git a/test/src/lib/op/bitwise/LibOpShiftBitsRightNP.t.sol b/test/src/lib/op/bitwise/LibOpShiftBitsRightNP.t.sol index ba5e7dbb..609405c6 100644 --- a/test/src/lib/op/bitwise/LibOpShiftBitsRightNP.t.sol +++ b/test/src/lib/op/bitwise/LibOpShiftBitsRightNP.t.sol @@ -15,7 +15,6 @@ import {IInterpreterStoreV2} from "rain.interpreter.interface/interface/IInterpr import {SignedContextV1} from "rain.interpreter.interface/interface/IInterpreterCallerV3.sol"; import {LibContext} from "rain.interpreter.interface/lib/caller/LibContext.sol"; import {UnsupportedBitwiseShiftAmount} from "src/error/ErrBitwise.sol"; -import {IntegerOverflow} from "rain.math.fixedpoint/error/ErrScale.sol"; import {LibOperand} from "test/lib/operand/LibOperand.sol"; contract LibOpShiftBitsRightNPTest is OpTest { diff --git a/test/src/lib/parse/LibParse.operand8M1M1.t.sol b/test/src/lib/parse/LibParse.operand8M1M1.t.sol index 3d0a0865..1a92d930 100644 --- a/test/src/lib/parse/LibParse.operand8M1M1.t.sol +++ b/test/src/lib/parse/LibParse.operand8M1M1.t.sol @@ -4,7 +4,6 @@ pragma solidity =0.8.25; import {UnsupportedLiteralType} from "src/lib/parse/literal/LibParseLiteral.sol"; import {ParserOutOfBounds} from "src/lib/parse/LibParse.sol"; import {ExpectedOperand, UnclosedOperand} from "src/error/ErrParse.sol"; -import {IntegerOverflow} from "rain.math.fixedpoint/error/ErrScale.sol"; import {OperandTest} from "test/abstract/OperandTest.sol"; import {LibMetaFixture} from "test/lib/parse/LibMetaFixture.sol"; diff --git a/test/src/lib/parse/LibParse.operandDoublePerByteNoDefault.t.sol b/test/src/lib/parse/LibParse.operandDoublePerByteNoDefault.t.sol index 49b3dc2d..9629f2ca 100644 --- a/test/src/lib/parse/LibParse.operandDoublePerByteNoDefault.t.sol +++ b/test/src/lib/parse/LibParse.operandDoublePerByteNoDefault.t.sol @@ -6,7 +6,6 @@ import {ExpectedOperand, UnclosedOperand, UnexpectedOperandValue} from "src/erro import {LibParse} from "src/lib/parse/LibParse.sol"; import {LibMetaFixture} from "test/lib/parse/LibMetaFixture.sol"; import {ParseState} from "src/lib/parse/LibParseState.sol"; -import {IntegerOverflow} from "rain.math.fixedpoint/error/ErrScale.sol"; contract LibParseOperandDoublePerByteNoDefaultTest is Test { using LibParse for ParseState; diff --git a/test/src/lib/parse/LibParse.operandM1M1.t.sol b/test/src/lib/parse/LibParse.operandM1M1.t.sol index ad315020..a2b9bf9c 100644 --- a/test/src/lib/parse/LibParse.operandM1M1.t.sol +++ b/test/src/lib/parse/LibParse.operandM1M1.t.sol @@ -6,7 +6,6 @@ import {ParserOutOfBounds, LibParse, ExpectedLeftParen} from "src/lib/parse/LibP import {OperandTest} from "test/abstract/OperandTest.sol"; import {LibMetaFixture} from "test/lib/parse/LibMetaFixture.sol"; import {ParseState} from "src/lib/parse/LibParseState.sol"; -import {IntegerOverflow} from "rain.math.fixedpoint/error/ErrScale.sol"; contract LibParseOperandM1M1Test is OperandTest { using LibParse for ParseState; diff --git a/test/src/lib/parse/LibParse.operandSingleFull.t.sol b/test/src/lib/parse/LibParse.operandSingleFull.t.sol index 03a193d3..dd609928 100644 --- a/test/src/lib/parse/LibParse.operandSingleFull.t.sol +++ b/test/src/lib/parse/LibParse.operandSingleFull.t.sol @@ -6,7 +6,6 @@ import {ExpectedOperand, UnclosedOperand, UnexpectedOperandValue} from "src/erro import {LibParse, ExpectedLeftParen} from "src/lib/parse/LibParse.sol"; import {LibMetaFixture} from "test/lib/parse/LibMetaFixture.sol"; import {ParseState} from "src/lib/parse/LibParseState.sol"; -import {IntegerOverflow} from "rain.math.fixedpoint/error/ErrScale.sol"; contract LibParseOperandSingleFullTest is Test { using LibParse for ParseState; diff --git a/test/src/lib/parse/LibParseOperand.handleOperand8M1M1.t.sol b/test/src/lib/parse/LibParseOperand.handleOperand8M1M1.t.sol index 42b22062..4d49b7be 100644 --- a/test/src/lib/parse/LibParseOperand.handleOperand8M1M1.t.sol +++ b/test/src/lib/parse/LibParseOperand.handleOperand8M1M1.t.sol @@ -5,8 +5,6 @@ import {Test} from "forge-std/Test.sol"; import {LibParseOperand, Operand} from "src/lib/parse/LibParseOperand.sol"; import {ExpectedOperand, UnexpectedOperandValue} from "src/error/ErrParse.sol"; import {LibParseLiteral} from "src/lib/parse/literal/LibParseLiteral.sol"; -import {IntegerOverflow} from "rain.math.fixedpoint/error/ErrScale.sol"; -import {LibFixedPointDecimalScale, DECIMAL_MAX_SAFE_INT} from "rain.math.fixedpoint/lib/LibFixedPointDecimalScale.sol"; contract LibParseOperandHandleOperand8M1M1Test is Test { // The first value must be 1 byte and is mandatory. Zero values is an error. diff --git a/test/src/lib/parse/LibParseOperand.handleOperandDoublePerByteNoDefault.t.sol b/test/src/lib/parse/LibParseOperand.handleOperandDoublePerByteNoDefault.t.sol index 8c493f46..c2cb302d 100644 --- a/test/src/lib/parse/LibParseOperand.handleOperandDoublePerByteNoDefault.t.sol +++ b/test/src/lib/parse/LibParseOperand.handleOperandDoublePerByteNoDefault.t.sol @@ -5,8 +5,6 @@ import {Test} from "forge-std/Test.sol"; import {LibParseOperand, Operand} from "src/lib/parse/LibParseOperand.sol"; import {ExpectedOperand, UnexpectedOperandValue} from "src/error/ErrParse.sol"; import {LibParseLiteral} from "src/lib/parse/literal/LibParseLiteral.sol"; -import {IntegerOverflow} from "rain.math.fixedpoint/error/ErrScale.sol"; -import {LibFixedPointDecimalScale, DECIMAL_MAX_SAFE_INT} from "rain.math.fixedpoint/lib/LibFixedPointDecimalScale.sol"; contract LibParseOperandHandleOperandDoublePerByteNoDefaultTest is Test { // There must be exactly two values so zero values is an error. diff --git a/test/src/lib/parse/LibParseOperand.handleOperandM1M1.t.sol b/test/src/lib/parse/LibParseOperand.handleOperandM1M1.t.sol index d8643df2..b936e80c 100644 --- a/test/src/lib/parse/LibParseOperand.handleOperandM1M1.t.sol +++ b/test/src/lib/parse/LibParseOperand.handleOperandM1M1.t.sol @@ -5,8 +5,6 @@ import {Test} from "forge-std/Test.sol"; import {LibParseOperand, Operand} from "src/lib/parse/LibParseOperand.sol"; import {ExpectedOperand, UnexpectedOperandValue} from "src/error/ErrParse.sol"; import {LibParseLiteral} from "src/lib/parse/literal/LibParseLiteral.sol"; -import {IntegerOverflow} from "rain.math.fixedpoint/error/ErrScale.sol"; -import {LibFixedPointDecimalScale, DECIMAL_MAX_SAFE_INT} from "rain.math.fixedpoint/lib/LibFixedPointDecimalScale.sol"; contract LibParseOperandHandleOperandM1M1Test is Test { // Both values are optional so if nothing is provided everything falls back diff --git a/test/src/lib/parse/LibParseOperand.handleOperandSingleFull.t.sol b/test/src/lib/parse/LibParseOperand.handleOperandSingleFull.t.sol index 135d4f00..7ee1db60 100644 --- a/test/src/lib/parse/LibParseOperand.handleOperandSingleFull.t.sol +++ b/test/src/lib/parse/LibParseOperand.handleOperandSingleFull.t.sol @@ -5,8 +5,6 @@ import {Test} from "forge-std/Test.sol"; import {LibParseOperand, Operand} from "src/lib/parse/LibParseOperand.sol"; import {UnexpectedOperandValue} from "src/error/ErrParse.sol"; import {LibParseLiteral} from "src/lib/parse/literal/LibParseLiteral.sol"; -import {IntegerOverflow} from "rain.math.fixedpoint/error/ErrScale.sol"; -import {LibFixedPointDecimalScale, DECIMAL_MAX_SAFE_INT} from "rain.math.fixedpoint/lib/LibFixedPointDecimalScale.sol"; contract LibParseOperandHandleOperandSingleFullTest is Test { // No values falls back to zero. diff --git a/test/src/lib/parse/LibParseOperand.handleOperandSingleFullNoDefault.t.sol b/test/src/lib/parse/LibParseOperand.handleOperandSingleFullNoDefault.t.sol index 4749b50f..5a53d22e 100644 --- a/test/src/lib/parse/LibParseOperand.handleOperandSingleFullNoDefault.t.sol +++ b/test/src/lib/parse/LibParseOperand.handleOperandSingleFullNoDefault.t.sol @@ -5,8 +5,6 @@ import {Test} from "forge-std/Test.sol"; import {LibParseOperand, Operand} from "src/lib/parse/LibParseOperand.sol"; import {UnexpectedOperandValue, ExpectedOperand} from "src/error/ErrParse.sol"; import {LibParseLiteral} from "src/lib/parse/literal/LibParseLiteral.sol"; -import {IntegerOverflow} from "rain.math.fixedpoint/error/ErrScale.sol"; -import {LibFixedPointDecimalScale, DECIMAL_MAX_SAFE_INT} from "rain.math.fixedpoint/lib/LibFixedPointDecimalScale.sol"; contract LibParseOperandHandleOperandSingleFullTest is Test { // No values errors. diff --git a/test/src/lib/parse/LibParseOperand.parseOperand.t.sol b/test/src/lib/parse/LibParseOperand.parseOperand.t.sol index 03296412..3d832975 100644 --- a/test/src/lib/parse/LibParseOperand.parseOperand.t.sol +++ b/test/src/lib/parse/LibParseOperand.parseOperand.t.sol @@ -163,14 +163,10 @@ 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(string.concat( - "<", - maybeWhitespaceA, - valueAString, - maybeWhitespaceB, - valueBString, - maybeWhitespaceC, - valueCString), + s = string.concat( + string.concat( + "<", maybeWhitespaceA, valueAString, maybeWhitespaceB, valueBString, maybeWhitespaceC, valueCString + ), maybeWhitespaceD, ">", suffix