Skip to content

Commit

Permalink
Updates tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ggaabe committed Jun 2, 2023
1 parent fc45263 commit 86ee531
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/registration.ts
Expand Up @@ -15,7 +15,7 @@ export const CatalystLabels = {
SIG: 61285,
} as const;

const CATALYST_PURPOSE = 0;
export const CATALYST_PURPOSE = 0;

function prefix0x(hex: string): string {
if (hex.startsWith("0x")) {
Expand Down
16 changes: 13 additions & 3 deletions tests/index.test.ts
@@ -1,7 +1,11 @@
// https://github.com/cardano-foundation/CIPs/blob/master/CIP-0015/test-vector.md

import CSL from "@emurgo/cardano-serialization-lib-nodejs";
import { CatalystLabels, generateRegistration } from "../src/registration";
import {
CATALYST_PURPOSE,
CatalystLabels,
generateRegistration,
} from "../src/registration";
import * as keyGen from "../src/keyGen";
import {
encryptWithPassword,
Expand Down Expand Up @@ -57,13 +61,19 @@ test("Generate Catalyst registration tx", () => {
);
const expectedResult = {
"61284": {
"1": "0x0036ef3e1f0d3f5989e2d155ea54bdb2a72c4c456ccb959af4c94868f473f5a0",
"1": [
[
"0x0036ef3e1f0d3f5989e2d155ea54bdb2a72c4c456ccb959af4c94868f473f5a0",
1,
],
],
"2": "0x86870efc99c453a873a16492ce87738ec79a0ebd064379a62e2c9cf4e119219e",
"3": "0xe0ae3a0a7aeda4aea522e74e4fe36759fca80789a613a58a4364f6ecef",
"4": nonce,
"5": CATALYST_PURPOSE,
},
"61285": {
"1": "0x6c2312cd49067ecf0920df7e067199c55b3faef4ec0bce1bd2cfb99793972478c45876af2bc271ac759c5ce40ace5a398b9fdb0e359f3c333fe856648804780e",
"1": "0x503e1b9e607e32f0d74a93da7261eb603132cf95d5405ee36d14431d3212bd49902445eeb47168e48858e295fd495cfad69f9fc1ea6da0ee3272c016a0bdef0b",
},
};

Expand Down

0 comments on commit 86ee531

Please sign in to comment.