Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions ironfish/src/rpc/routes/chain/getTransaction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ describe('Route chain/getTransaction', () => {

const transaction = block2.transactions[0]

const notesEncrypted: string[] = []
const notes: { hash: string; serialized: string }[] = []

for (const note of transaction.notes) {
notesEncrypted.push(note.serialize().toString('hex'))
notes.push({
hash: note.hash().toString('hex'),
serialized: note.serialize().toString('hex'),
Expand All @@ -44,10 +42,7 @@ describe('Route chain/getTransaction', () => {
expect(response.content).toMatchObject({
fee: Number(transaction.fee()),
expiration: transaction.expiration(),
notesCount: 1,
spendsCount: 0,
signature: transaction.transactionSignature().toString('hex'),
notesEncrypted,
spends,
mints: [],
burns: [],
Expand All @@ -63,11 +58,9 @@ describe('Route chain/getTransaction', () => {

const transaction = block2.transactions[0]

const notesEncrypted: string[] = []
const notes: { hash: string; serialized: string }[] = []

for (const note of transaction.notes) {
notesEncrypted.push(note.serialize().toString('hex'))
notes.push({
hash: note.hash().toString('hex'),
serialized: note.serialize().toString('hex'),
Expand All @@ -90,10 +83,7 @@ describe('Route chain/getTransaction', () => {
expect(response.content).toMatchObject({
fee: Number(transaction.fee()),
expiration: transaction.expiration(),
notesCount: 1,
spendsCount: 0,
signature: transaction.transactionSignature().toString('hex'),
notesEncrypted,
spends,
mints: [],
burns: [],
Expand Down
20 changes: 0 additions & 20 deletions ironfish/src/rpc/routes/chain/getTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,6 @@ export type GetTransactionRequest = { transactionHash: string; blockHash?: strin
export type GetTransactionResponse = RpcTransaction & {
noteSize: number
blockHash: string
/**
* @deprecated Please use `notes.length` instead
*/
notesCount: number
/**
* @deprecated Please use `spends.length` instead
*/
spendsCount: number
/**
* @deprecated Please use `notes` instead
*/
notesEncrypted: string[]
}

export const GetTransactionRequestSchema: yup.ObjectSchema<GetTransactionRequest> = yup
Expand All @@ -41,9 +29,6 @@ export const GetTransactionResponseSchema: yup.ObjectSchema<GetTransactionRespon
RpcTransactionSchema.concat(
yup
.object({
notesCount: yup.number().defined(),
spendsCount: yup.number().defined(),
notesEncrypted: yup.array(yup.string().defined()).defined(),
noteSize: yup.number().defined(),
blockHash: yup.string().defined(),
})
Expand Down Expand Up @@ -95,11 +80,6 @@ routes.register<typeof GetTransactionRequestSchema, GetTransactionResponse>(
...serializeRpcTransaction(chainTransaction.transaction, true),
blockHash: blockHashBuffer.toString('hex'),
noteSize: chainTransaction.initialNoteIndex + chainTransaction.transaction.notes.length,
notesCount: chainTransaction.transaction.notes.length,
spendsCount: chainTransaction.transaction.spends.length,
notesEncrypted: chainTransaction.transaction.notes.map((note) =>
note.serialize().toString('hex'),
),
})
},
)