From c1bfe41e8b8d506cae346715b4728ebc2eba018d Mon Sep 17 00:00:00 2001 From: Stanislav Bezkorovainyi Date: Thu, 7 Oct 2021 15:26:15 +0300 Subject: [PATCH] Make some signing utils public --- src/main/java/io/zksync/signer/SigningUtils.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/io/zksync/signer/SigningUtils.java b/src/main/java/io/zksync/signer/SigningUtils.java index 8045e6a..ec158ba 100644 --- a/src/main/java/io/zksync/signer/SigningUtils.java +++ b/src/main/java/io/zksync/signer/SigningUtils.java @@ -254,21 +254,21 @@ private static byte[] packAmountChecked(BigInteger amount) { return packAmount(amount); } - private static BigInteger closestPackableTransactionFee(BigInteger fee) { + public static BigInteger closestPackableTransactionFee(BigInteger fee) { final byte[] packedFee = packFee(fee); return decimalByteArrayToInteger(packedFee, FEE_EXPONENT_BIT_WIDTH, FEE_MANTISSA_BIT_WIDTH, 10); } - private static BigInteger closestPackableTransactionAmount(BigInteger amount) { + public static BigInteger closestPackableTransactionAmount(BigInteger amount) { final byte[] packedAmount = packAmount(amount); return decimalByteArrayToInteger(packedAmount, AMOUNT_EXPONENT_BIT_WIDTH, AMOUNT_MANTISSA_BIT_WIDTH, 10); } - private static byte[] packFee(BigInteger fee) { + public static byte[] packFee(BigInteger fee) { return reverseBits(integerToDecimalByteArray(fee, FEE_EXPONENT_BIT_WIDTH, FEE_MANTISSA_BIT_WIDTH, 10)); } - private static byte[] packAmount(BigInteger amount) { + public static byte[] packAmount(BigInteger amount) { return reverseBits(integerToDecimalByteArray(amount, AMOUNT_EXPONENT_BIT_WIDTH, AMOUNT_MANTISSA_BIT_WIDTH, 10)); }