Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
benesjan committed Oct 26, 2023
1 parent 5e4bf71 commit 2dd7ff8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions yarn-project/aztec.js/src/pxe_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
L2Tx,
LogId,
NotePreimage,
NoteSpendingInfoDao,
PXE,
Tx,
TxExecutionRequest,
Expand All @@ -43,6 +44,7 @@ export const createPXEClient = (url: string, fetch = makeFetch([1, 2, 3], true))
Fr,
GrumpkinScalar,
NotePreimage,
NoteSpendingInfoDao,
AuthWitness,
L2Tx,
LogId,
Expand Down
2 changes: 2 additions & 0 deletions yarn-project/pxe/src/pxe_http/pxe_http_server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
L2Tx,
LogId,
NotePreimage,
NoteSpendingInfoDao,
PXE,
Tx,
TxExecutionRequest,
Expand Down Expand Up @@ -48,6 +49,7 @@ export function createPXERpcServer(pxeService: PXE): JsonRpcServer {
Fr,
GrumpkinScalar,
NotePreimage,
NoteSpendingInfoDao,
AuthWitness,
L2Block,
L2Tx,
Expand Down
9 changes: 9 additions & 0 deletions yarn-project/types/src/notes/note_spending_info_dao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,15 @@ export class NoteSpendingInfoDao {
);
}

toString() {
return '0x' + this.toBuffer().toString('hex');
}

static fromString(str: string) {
const hex = str.replace(/^0x/, '');
return NotePreimage.fromBuffer(Buffer.from(hex, 'hex'));
}

/**
* Returns the size in bytes of a note spending info dao.
* @param note - The note.
Expand Down

0 comments on commit 2dd7ff8

Please sign in to comment.