mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-22 13:15:49 +00:00
Refactored UInt and Derived Classes (#83)
Refactored UInt and Derived classes to be constructed from Buffers, and swapped out BN.js in favor of BigInt to reduce dependencies.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
/* eslint-disable func-style */
|
||||
|
||||
import { BN } from "bn.js";
|
||||
import { coreTypes } from "./types";
|
||||
const { HashPrefix } = require("./hash-prefixes");
|
||||
const { BinaryParser } = require("./serdes/binary-parser");
|
||||
@@ -34,7 +33,7 @@ function signingData(tx, prefix = HashPrefix.transactionSig) {
|
||||
function signingClaimData(claim) {
|
||||
const prefix = HashPrefix.paymentChannelClaim;
|
||||
const channel = coreTypes.Hash256.from(claim.channel).toBytes();
|
||||
const amount = new coreTypes.UInt64(new BN(claim.amount)).toBytes();
|
||||
const amount = coreTypes.UInt64.from(BigInt(claim.amount)).toBytes();
|
||||
|
||||
const bytesList = new BytesList();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user