Skip to content

Commit

Permalink
chore: upgrade to chang-ready CSL 13
Browse files Browse the repository at this point in the history
  • Loading branch information
slowbackspace committed Nov 25, 2024
1 parent 66bbfee commit 57e4cc6
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 20 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 2 additions & 1 deletion CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Upgraded cardano-serialization-lib to Chang-compatible release (v12)
- Upgraded cardano-serialization-lib to Chang-compatible release (v13)
- All set types are now serialized with a tag "258", which will become mandatory after the next hard fork (HF)

## [2.2.1] - 2023-11-29

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fivebinaries/coin-selection",
"version": "2.2.1",
"version": "3.0.0-beta.0",
"description": "",
"keywords": [
"coin selection"
Expand Down Expand Up @@ -48,8 +48,8 @@
"typescript-eslint": "^8.8.0"
},
"dependencies": {
"@emurgo/cardano-serialization-lib-browser": "^12.1.0",
"@emurgo/cardano-serialization-lib-nodejs": "12.1.0"
"@emurgo/cardano-serialization-lib-browser": "^13.2.0",
"@emurgo/cardano-serialization-lib-nodejs": "13.2.0"
},
"packageManager": "[email protected]"
}
9 changes: 6 additions & 3 deletions src/methods/largestFirst.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,12 @@ export const largestFirst = (

txBuilder.set_fee(totalFeesAmount);
const txBody = txBuilder.build();
const txHash = Buffer.from(
CardanoWasm.hash_transaction(txBody).to_bytes(),
).toString('hex');

const txHash = CardanoWasm.FixedTransaction.new_from_body_bytes(
txBody.to_bytes(),
)
.transaction_hash()
.to_hex();
const txBodyHex = Buffer.from(txBody.to_bytes()).toString('hex');

const totalSpent = totalUserOutputsAmount.checked_add(totalFeesAmount);
Expand Down
8 changes: 5 additions & 3 deletions src/methods/randomImprove.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,11 @@ export const randomImprove = (

txBuilder.set_fee(fee);
const txBody = txBuilder.build();
const txHash = Buffer.from(
CardanoWasm.hash_transaction(txBody).to_bytes(),
).toString('hex');
const txHash = CardanoWasm.FixedTransaction.new_from_body_bytes(
txBody.to_bytes(),
)
.transaction_hash()
.to_hex();
const txBodyHex = Buffer.from(txBody.to_bytes()).toString('hex');

// reorder inputs to match order within tx
Expand Down
20 changes: 10 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -940,17 +940,17 @@ __metadata:
languageName: node
linkType: hard

"@emurgo/cardano-serialization-lib-browser@npm:^12.1.0":
version: 12.1.0
resolution: "@emurgo/cardano-serialization-lib-browser@npm:12.1.0"
checksum: 10/70ef63f6d34e49987740c06254b9abc405f646aac0ef1f18e201fead51ff3a862b5e0142e9cd4dbfe59c8b5e2b64ae7b8f3be3a860ece5fc6283bdcffa65d56e
"@emurgo/cardano-serialization-lib-browser@npm:^13.2.0":
version: 13.2.0
resolution: "@emurgo/cardano-serialization-lib-browser@npm:13.2.0"
checksum: 10/f60f47b7df9e1e783302921d9f225696d09e01b124a75dd8672effae17acdd42779da66a068c923261aabead52ac7aae9426ef13c875f48b5ef7b9d629b8b993
languageName: node
linkType: hard

"@emurgo/cardano-serialization-lib-nodejs@npm:12.1.0":
version: 12.1.0
resolution: "@emurgo/cardano-serialization-lib-nodejs@npm:12.1.0"
checksum: 10/cf1f07468cf60af873375368e9d4b2d605758835de56fb314879230f11086c1474426ab2b540a218ed447f40005cc9c49f7f7f47e2d331d10d2c12140ede0737
"@emurgo/cardano-serialization-lib-nodejs@npm:13.2.0":
version: 13.2.0
resolution: "@emurgo/cardano-serialization-lib-nodejs@npm:13.2.0"
checksum: 10/b8483dd74ec902da607f0ee00259674ba1794784fafd322948043dd4dfdbddecc81f6546fc98c9a57810639f91110cf76be7755a138a3506af6233954cfe449e
languageName: node
linkType: hard

Expand Down Expand Up @@ -1034,8 +1034,8 @@ __metadata:
version: 0.0.0-use.local
resolution: "@fivebinaries/coin-selection@workspace:."
dependencies:
"@emurgo/cardano-serialization-lib-browser": "npm:^12.1.0"
"@emurgo/cardano-serialization-lib-nodejs": "npm:12.1.0"
"@emurgo/cardano-serialization-lib-browser": "npm:^13.2.0"
"@emurgo/cardano-serialization-lib-nodejs": "npm:13.2.0"
"@eslint/js": "npm:^9.11.1"
"@swc-node/jest": "npm:^1.8.12"
"@swc/core": "npm:1.7.26"
Expand Down

0 comments on commit 57e4cc6

Please sign in to comment.