Skip to content

Commit 6afa993

Browse files
authored
Merge pull request #16 from Anastasia-Labs/develop
Fix Address Data Encoding
2 parents 39be245 + bff007c commit 6afa993

3 files changed

Lines changed: 33 additions & 29 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@anastasia-labs/smart-handles-offchain",
3-
"version": "0.3.4",
3+
"version": "0.3.5",
44
"description": "https://docs.github.com/en/packages/quickstart",
55
"main": "./dist/index.js",
66
"types": "./dist/index.d.ts",
@@ -31,7 +31,7 @@
3131
"vitest": "^2.0.5"
3232
},
3333
"dependencies": {
34-
"@lucid-evolution/lucid": "^0.4.14",
34+
"@lucid-evolution/lucid": "^0.4.16",
3535
"lucid-cardano": "^0.10.9"
3636
},
3737
"packageManager": "pnpm@9.0.4+sha1.b198ac6d38244fd829253720f9daafd6a606834d"

pnpm-lock.yaml

Lines changed: 25 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/utils/utils.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,11 @@ export const fromAddressToData = (address: Address): Result<Data> => {
202202
};
203203

204204
const stakingCred = new Constr(0, [
205-
new Constr(0, [new Constr(0, [addrDetails.stakeCredential.hash])]),
205+
new Constr(0, [
206+
new Constr(addrDetails.stakeCredential.type === "Key" ? 0 : 1, [
207+
addrDetails.stakeCredential.hash,
208+
]),
209+
]),
206210
]);
207211

208212
return { type: "ok", data: new Constr(0, [paymentCred, stakingCred]) };
@@ -486,7 +490,7 @@ export function printUTxOOutRef(u: UTxO): `${string}#${string}` {
486490

487491
export function mergeUTxOs(utxos0: UTxO[], utxos1: UTxO[]): UTxO[] {
488492
const uniques0 = new Set(utxos0.map(printUTxOOutRef));
489-
const filtered1 = utxos1.filter(u => !uniques0.has(printUTxOOutRef(u)));
493+
const filtered1 = utxos1.filter((u) => !uniques0.has(printUTxOOutRef(u)));
490494
return [...utxos0, ...filtered1];
491495
}
492496

0 commit comments

Comments
 (0)