Skip to content

Commit e3e348f

Browse files
committed
Fix comments
1 parent 3916ee1 commit e3e348f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/anchor/coder/instructions.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export class PythOracleInstructionCoder implements InstructionCoder {
8989
throw new Error(`Unknown method: ${methodName}`)
9090
}
9191

92-
/// updProduct has its own format
92+
/// updProduct and addProduct have their own format
9393
if (methodName === 'updProduct' || methodName === 'addProduct') {
9494
let offset = 0
9595
for (const key of Object.keys(ix.productMetadata)) {
@@ -101,7 +101,7 @@ export class PythOracleInstructionCoder implements InstructionCoder {
101101
if (offset > MAX_METADATA_SIZE) {
102102
throw new Error('The metadata is too long')
103103
}
104-
const data = buffer.subarray(0, MAX_METADATA_SIZE)
104+
const data = buffer.subarray(0, offset)
105105
return Buffer.concat([discriminator, data])
106106
} else {
107107
const len = layout.encode(ix, buffer)
@@ -136,7 +136,7 @@ export class PythOracleInstructionCoder implements InstructionCoder {
136136
return null
137137
}
138138

139-
/// updProduct has its own format
139+
/// updProduct and addProduct have their own format
140140
if (decoder.name === 'updProduct' || decoder.name === 'addProduct') {
141141
const product: Product = {}
142142
let idx = 0

0 commit comments

Comments
 (0)