Skip to content

Commit

Permalink
fix parsing pool id
Browse files Browse the repository at this point in the history
  • Loading branch information
twwu123 committed Feb 14, 2025
1 parent e9b2a80 commit 0160345
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions packages/mesh-core-cst/test/utils/serializer-utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
);
});
});
2 changes: 1 addition & 1 deletion packages/mesh-transaction/src/transaction/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 0160345

Please sign in to comment.