Skip to content

Commit

Permalink
Switch away from packed-bytesFormatted
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmillr committed May 9, 2024
1 parent 618e30a commit 3483f81
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,16 @@ export const shortVec = P.wrap({
});

const rustString = P.string(P.padRight(8, P.U32LE, undefined));
const pubKey = P.bytesFormatted(32, 'base58');

const b58 = () => {
const inner = P.bytes(32);
return P.wrap({
size: inner.size,
encodeStream: (w: P.Writer, value: string) => inner.encodeStream(w, base58.decode(value)),
decodeStream: (r: P.Reader): string => base58.encode(inner.decodeStream(r)),
});
};
const pubKey = b58();

export const Message = P.struct({
requiredSignatures: P.U8,
Expand Down

0 comments on commit 3483f81

Please sign in to comment.