File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ export class PythOracleInstructionCoder implements InstructionCoder {
89
89
throw new Error ( `Unknown method: ${ methodName } ` )
90
90
}
91
91
92
- /// updProduct has its own format
92
+ /// updProduct and addProduct have their own format
93
93
if ( methodName === 'updProduct' || methodName === 'addProduct' ) {
94
94
let offset = 0
95
95
for ( const key of Object . keys ( ix . productMetadata ) ) {
@@ -101,7 +101,7 @@ export class PythOracleInstructionCoder implements InstructionCoder {
101
101
if ( offset > MAX_METADATA_SIZE ) {
102
102
throw new Error ( 'The metadata is too long' )
103
103
}
104
- const data = buffer . subarray ( 0 , MAX_METADATA_SIZE )
104
+ const data = buffer . subarray ( 0 , offset )
105
105
return Buffer . concat ( [ discriminator , data ] )
106
106
} else {
107
107
const len = layout . encode ( ix , buffer )
@@ -136,7 +136,7 @@ export class PythOracleInstructionCoder implements InstructionCoder {
136
136
return null
137
137
}
138
138
139
- /// updProduct has its own format
139
+ /// updProduct and addProduct have their own format
140
140
if ( decoder . name === 'updProduct' || decoder . name === 'addProduct' ) {
141
141
const product : Product = { }
142
142
let idx = 0
You can’t perform that action at this time.
0 commit comments