Skip to content

Commit

Permalink
remove fixed point lib
Browse files Browse the repository at this point in the history
  • Loading branch information
thedavidmeister committed Aug 22, 2024
1 parent 24f82fc commit a15e3cc
Show file tree
Hide file tree
Showing 33 changed files with 77 additions and 121 deletions.
6 changes: 0 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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/",
Expand Down
1 change: 0 additions & 1 deletion lib/rain.chainlink
Submodule rain.chainlink deleted from c9844b
1 change: 0 additions & 1 deletion lib/rain.math.fixedpoint
Submodule rain.math.fixedpoint deleted from f0d74e
1 change: 0 additions & 1 deletion src/concrete/extern/RainterpreterReferenceExternNPE2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/op/LibAllStandardOpsNP.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
1 change: 0 additions & 1 deletion src/lib/op/bitwise/LibOpCtPopNP.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/lib/op/erc20/LibOpERC20Allowance.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/lib/op/erc20/LibOpERC20BalanceOf.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/lib/op/erc20/LibOpERC20TotalSupply.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/lib/op/evm/LibOpBlockNumberNP.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion src/lib/op/evm/LibOpChainIdNP.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion src/lib/op/evm/LibOpTimestampNP.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion src/lib/op/math/LibOpE.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion src/lib/op/math/LibOpScale18.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
1 change: 0 additions & 1 deletion src/lib/op/math/LibOpScale18Dynamic.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
1 change: 0 additions & 1 deletion src/lib/op/math/LibOpScaleN.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
1 change: 0 additions & 1 deletion src/lib/op/math/LibOpScaleNDynamic.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
144 changes: 72 additions & 72 deletions src/lib/op/math/LibOpSub.sol
Original file line number Diff line number Diff line change
@@ -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;
// }
// }
// }
1 change: 0 additions & 1 deletion src/lib/parse/LibParseOperand.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/lib/parse/literal/LibParseLiteral.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 0 additions & 1 deletion test/src/lib/op/bitwise/LibOpShiftBitsLeftNP.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 0 additions & 1 deletion test/src/lib/op/bitwise/LibOpShiftBitsRightNP.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 0 additions & 1 deletion test/src/lib/parse/LibParse.operand8M1M1.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion test/src/lib/parse/LibParse.operandM1M1.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion test/src/lib/parse/LibParse.operandSingleFull.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions test/src/lib/parse/LibParseOperand.handleOperand8M1M1.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 0 additions & 2 deletions test/src/lib/parse/LibParseOperand.handleOperandM1M1.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading

0 comments on commit a15e3cc

Please sign in to comment.