From 016034587b66e183d43131c3407522c2f87b795d Mon Sep 17 00:00:00 2001 From: twwu123 Date: Fri, 14 Feb 2025 16:53:07 +0800 Subject: [PATCH] fix parsing pool id --- .../mesh-core-cst/test/utils/serializer-utils.test.ts | 10 ++++++++++ packages/mesh-transaction/src/transaction/index.ts | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/mesh-core-cst/test/utils/serializer-utils.test.ts b/packages/mesh-core-cst/test/utils/serializer-utils.test.ts index 96c535d9..07eee382 100644 --- a/packages/mesh-core-cst/test/utils/serializer-utils.test.ts +++ b/packages/mesh-core-cst/test/utils/serializer-utils.test.ts @@ -367,4 +367,14 @@ describe("Serialization utils", () => { const result = serializer.resolver.script.resolveScriptRef(nativeScript); expect(result).toEqual("d81846820082041864"); }); + + it("should deserialize pool id correctly", () => { + const result = serializer.deserializer.cert.deserializePoolId( + "pool1kgzq2g7glzcu76ygcl2llhamjjutcts5vhe2mzglmn5jxt2cnfs", + ); + + expect(result).toEqual( + "b2040523c8f8b1cf6888c7d5ffdfbb94b8bc2e1465f2ad891fdce923", + ); + }); }); diff --git a/packages/mesh-transaction/src/transaction/index.ts b/packages/mesh-transaction/src/transaction/index.ts index d9a7f830..06f321db 100644 --- a/packages/mesh-transaction/src/transaction/index.ts +++ b/packages/mesh-transaction/src/transaction/index.ts @@ -618,7 +618,7 @@ export class Transaction { delegateStake(rewardAddress: string, poolId: string): Transaction { this.txBuilder.delegateStakeCertificate( rewardAddress, - this.txBuilder.serializer.resolver.keys.resolveEd25519KeyHash(poolId), + this.txBuilder.serializer.deserializer.cert.deserializePoolId(poolId), ); return this; }