This repository was archived by the owner on May 31, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -163,6 +163,24 @@ func (i *InstructionBuilder) UpdPrice(
163
163
}
164
164
}
165
165
166
+ // UpdPriceNoFailOnError publishes a new component price to a price account, ignoring errors.
167
+ func (i * InstructionBuilder ) UpdPriceNoFailOnError (
168
+ fundingKey solana.PublicKey ,
169
+ priceKey solana.PublicKey ,
170
+ payload CommandUpdPrice ,
171
+ ) * Instruction {
172
+ return & Instruction {
173
+ programKey : i .programKey ,
174
+ Header : makeCommandHeader (Instruction_UpdPriceNoFailOnError ),
175
+ accounts : []* solana.AccountMeta {
176
+ solana .Meta (fundingKey ).SIGNER ().WRITE (),
177
+ solana .Meta (priceKey ).WRITE (),
178
+ solana .Meta (solana .SysVarClockPubkey ),
179
+ },
180
+ Payload : & payload ,
181
+ }
182
+ }
183
+
166
184
// AggPrice computes the aggregate price for a product account.
167
185
func (i * InstructionBuilder ) AggPrice (
168
186
fundingKey solana.PublicKey ,
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ const (
44
44
Instruction_InitTest
45
45
Instruction_UpdTest
46
46
Instruction_SetMinPub
47
+ Instruction_UpdPriceNoFailOnError
47
48
instruction_count // number of different instruction types
48
49
)
49
50
@@ -76,6 +77,8 @@ func InstructionIDToName(id int32) string {
76
77
return "upd_test"
77
78
case Instruction_SetMinPub :
78
79
return "set_min_pub"
80
+ case Instruction_UpdPriceNoFailOnError :
81
+ return "upd_price_no_fail_on_error"
79
82
default :
80
83
return fmt .Sprintf ("unsupported (%d)" , id )
81
84
}
@@ -241,7 +244,7 @@ func DecodeInstruction(
241
244
case Instruction_DelPublisher :
242
245
impl = new (CommandDelPublisher )
243
246
numAccounts = 2
244
- case Instruction_UpdPrice :
247
+ case Instruction_UpdPrice , Instruction_UpdPriceNoFailOnError :
245
248
impl = new (CommandUpdPrice )
246
249
numAccounts = 3
247
250
case Instruction_AggPrice :
You can’t perform that action at this time.
0 commit comments