diff --git a/libs/ledger-live-common/src/__tests__/modulo.ts b/libs/ledger-live-common/src/__tests__/modulo.ts deleted file mode 100644 index f6e0bb2a788a..000000000000 --- a/libs/ledger-live-common/src/__tests__/modulo.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { BigNumber } from "bignumber.js"; -import { upperModulo } from "../modulo"; -test("upperModulo lower value", () => { - expect(upperModulo(new BigNumber("21111"), new BigNumber("136"), new BigNumber("1000"))).toEqual( - new BigNumber("21136"), - ); -}); -test("upperModulo equal value", () => { - expect(upperModulo(new BigNumber("21136"), new BigNumber("136"), new BigNumber("1000"))).toEqual( - new BigNumber("21136"), - ); -}); -test("upperModulo upper value", () => { - expect(upperModulo(new BigNumber("21611"), new BigNumber("136"), new BigNumber("1000"))).toEqual( - new BigNumber("22136"), - ); -}); diff --git a/libs/ledger-live-common/src/families/tezos/signOperation.ts b/libs/ledger-live-common/src/families/tezos/signOperation.ts index d35f6ad8161b..b93957df2666 100644 --- a/libs/ledger-live-common/src/families/tezos/signOperation.ts +++ b/libs/ledger-live-common/src/families/tezos/signOperation.ts @@ -6,8 +6,6 @@ import type { OperationType, SignOperationFnSignature } from "@ledgerhq/types-li import { withDevice } from "../../hw/deviceAccess"; import { getEnv } from "@ledgerhq/live-env"; import { FeeNotLoaded } from "@ledgerhq/errors"; -import { upperModulo } from "../../modulo"; -import BigNumber from "bignumber.js"; import { encodeOperationId } from "@ledgerhq/coin-framework/operation"; export const signOperation: SignOperationFnSignature = ({ @@ -54,15 +52,6 @@ export const signOperation: SignOperationFnSignature = ({ gasLimit: transaction.gasLimit?.toNumber() || 0, }; - if (["delegate", "undelegate"].includes(transaction.mode)) { - // https://ledgerhq.atlassian.net/browse/LL-8821 - params.gasLimit = upperModulo( - transaction.gasLimit || new BigNumber(0), - new BigNumber(136), - new BigNumber(1000), - ).toNumber(); - } - switch (transaction.mode) { case "send": res = await tezos.contract.transfer({ diff --git a/libs/ledger-live-common/src/modulo.ts b/libs/ledger-live-common/src/modulo.ts deleted file mode 100644 index 35f7d507fbb3..000000000000 --- a/libs/ledger-live-common/src/modulo.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { BigNumber } from "bignumber.js"; -export const upperModulo = (value: BigNumber, trackId: BigNumber, modulo: BigNumber): BigNumber => { - const lower = modulo.times(value.div(modulo).integerValue()); - const lowerPlusTrack = lower.plus(trackId); - if (value.lte(lowerPlusTrack)) return lowerPlusTrack; - return lowerPlusTrack.plus(modulo); -};