Skip to content

Commit

Permalink
Merge pull request #25 from fivebinaries/chore/release-2.1.0
Browse files Browse the repository at this point in the history
chore: release 2.1.0
  • Loading branch information
slowbackspace authored Nov 22, 2022
2 parents 9fdde22 + de106ea commit a281512
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 2 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

## [2.1.0] - 2022-11-22

### Fixed

- occasionally too low fee while using `setMax` on token output
- order of inputs returned in txPlan did not always match the order of inputs in constructed transaction CBOR

### Changed

- Upgraded cardano-serialization-lib to babbage-compatible release
- Upgraded deps, cardano-serialization-lib to babbage-compatible release (v11)

## [2.0.0] - 2022-02-14

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fivebinaries/coin-selection",
"version": "2.0.0-beta.10",
"version": "2.1.0",
"description": "",
"keywords": [
"coin selection"
Expand Down
10 changes: 10 additions & 0 deletions tests/utils/common.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,14 @@ describe('common utils', () => {
expect(assets).toStrictEqual(f.result.assets);
});
});

fixtures.orderInputs.forEach(f => {
test(f.description, () => {
const inputs = utils.orderInputs(
f.inputsToOrder,
CardanoWasm.TransactionBody.from_bytes(Buffer.from(f.txBodyHex, 'hex')),
);
expect(inputs).toStrictEqual(f.result);
});
});
});
72 changes: 72 additions & 0 deletions tests/utils/fixtures/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,75 @@ export const buildTxOutput = [
},
},
];

export const orderInputs = [
{
description: 'reorder inputs to match order in txbody',
inputsToOrder: [
{
address:
'addr1qy4xpnf4lk560dgrds5zsunh6xdssg94c5sc8dqdclcn2fdl85agr52j3ffkwzq2yasu59ccwvfj39kel85ng3u7lhlq4e4m4l',
txHash:
'9ed3ef581f545f2143eca490d7f20a511100add747bb3d651cc2aa5815f77b1d',
outputIndex: 1,
amount: [
{
quantity: '1344974',
unit: 'lovelace',
},
{
quantity: '5675656536',
unit: '9a9693a9a37912a5097918f97918d15240c92ab729a0b7c4aa144d7753554e444145',
},
],
},
{
address:
'addr1q860vxljhadqxnrrsr2j6yxnwpdkyquq74lmghx502aj0r28d2kd47hsre5v9urjyu8s0ryk38dxzw0t5jesncw4v90sp0878u',
txHash:
'06227a5ee5640d26224470ad195c82941bfa49386a85149c09c465c4edb0edc0',
outputIndex: 0,
amount: [
{
quantity: '10000000',
unit: 'lovelace',
},
],
},
],
txBodyHex:
'a4008282582006227a5ee5640d26224470ad195c82941bfa49386a85149c09c465c4edb0edc0008258209ed3ef581f545f2143eca490d7f20a511100add747bb3d651cc2aa5815f77b1d010182825839013af9d8434bea8de03cd698d5fa1c6b82b991146a755f509e95d6b53b15ab05b40d24d39c9d14dfec04d87ed071f2c66484b3ab83ab3d603d821a0012050ca1581c9a9693a9a37912a5097918f97918d15240c92ab729a0b7c4aa144d77a14653554e4441451b00000001524ba55882583901f8a4be8308c12b910252b6fd6ee4a98730300009382becc049a6e618476aacdafaf01e68c2f072270f078c9689da6139eba4b309e1d5615f1a009865cd021a0002b175031a03f7e7bf',
result: [
{
address:
'addr1q860vxljhadqxnrrsr2j6yxnwpdkyquq74lmghx502aj0r28d2kd47hsre5v9urjyu8s0ryk38dxzw0t5jesncw4v90sp0878u',
txHash:
'06227a5ee5640d26224470ad195c82941bfa49386a85149c09c465c4edb0edc0',
outputIndex: 0,
amount: [
{
quantity: '10000000',
unit: 'lovelace',
},
],
},
{
address:
'addr1qy4xpnf4lk560dgrds5zsunh6xdssg94c5sc8dqdclcn2fdl85agr52j3ffkwzq2yasu59ccwvfj39kel85ng3u7lhlq4e4m4l',
txHash:
'9ed3ef581f545f2143eca490d7f20a511100add747bb3d651cc2aa5815f77b1d',
outputIndex: 1,
amount: [
{
quantity: '1344974',
unit: 'lovelace',
},
{
quantity: '5675656536',
unit: '9a9693a9a37912a5097918f97918d15240c92ab729a0b7c4aa144d7753554e444145',
},
],
},
],
},
];

0 comments on commit a281512

Please sign in to comment.