@mutants/cardano
Advanced tools
Comparing version 1.5.3 to 1.5.4
@@ -77,3 +77,3 @@ "use strict"; | ||
var inputs = inputsUtxo.map(function (u) { return transaction_1.CborTransaction.encodeTransaction(u.transaction).encoded; }); | ||
return "8" + inputs.length + inputs.join(""); | ||
return "" + array_1.CborArray.sizeToCbor(inputs.length) + inputs.join(""); | ||
}; | ||
@@ -80,0 +80,0 @@ var buildRedeemer = function (tag, index, plutusData, exUnits) { |
@@ -93,2 +93,3 @@ "use strict"; | ||
return __generator(this, function (_a) { | ||
utxos.sort(function (u1, u2) { return u2.utxo.amount.coin - u1.utxo.amount.coin; }); | ||
adaUtxos = utxos.reduce(function (adaUtxos, utxo) { | ||
@@ -95,0 +96,0 @@ if ((adaUtxos === null || adaUtxos === void 0 ? void 0 : adaUtxos.bestCase) || // In case we already found a single utxo for this transaction |
{ | ||
"name": "@mutants/cardano", | ||
"version": "1.5.3", | ||
"version": "1.5.4", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
@@ -70,3 +70,3 @@ import { Multiasset } from "../utils/assets"; | ||
return `8${inputs.length}${inputs.join("")}`; | ||
return `${CborArray.sizeToCbor(inputs.length)}${inputs.join("")}`; | ||
}; | ||
@@ -73,0 +73,0 @@ |
@@ -31,4 +31,4 @@ jest.mock(".."); | ||
test("ada total coin should be 583758768", () => { | ||
expect(adaUtxos.totalCoin).toBe(583758768); | ||
test("ada total coin should be 1000000000", () => { | ||
expect(adaUtxos.totalCoin).toBe(1000000000); | ||
}); | ||
@@ -40,9 +40,9 @@ | ||
test("utxo value should be 583.758768 ADA", () => { | ||
expect(adaUtxos.utxos[0].utxo.amount.coin).toBe(583758768); | ||
test("utxo value should be 1000 ADA", () => { | ||
expect(adaUtxos.utxos[0].utxo.amount.coin).toBe(1000000000); | ||
}); | ||
test("utxo hash should be 75901d6fadc37ea8750f8ebadd28492ef1fd1e22d4bf717303ad406471b08c6e", () => { | ||
test("utxo hash should be 06fc2419824d3b110187461f02fc546eba7801c0dcd1cdceba12154ec21016d3", () => { | ||
expect(adaUtxos.utxos[0].transaction.hash).toBe( | ||
"75901d6fadc37ea8750f8ebadd28492ef1fd1e22d4bf717303ad406471b08c6e" | ||
"06fc2419824d3b110187461f02fc546eba7801c0dcd1cdceba12154ec21016d3" | ||
); | ||
@@ -49,0 +49,0 @@ }); |
@@ -88,2 +88,3 @@ import { TransactionOutput } from "../builders/transaction.builder"; | ||
): Promise<AdaUTXOs> => { | ||
utxos.sort((u1, u2) => u2.utxo.amount.coin - u1.utxo.amount.coin); | ||
const adaUtxos = utxos.reduce( | ||
@@ -90,0 +91,0 @@ (adaUtxos: AdaUTXOs, utxo: CardanoUTXO) => { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
201316
4395