@@ -115,15 +115,16 @@ pub fn create_registry(
115
115
] ;
116
116
let proof_instruction_offset = proof_instruction_offset ( & mut accounts, proof_location) ;
117
117
118
- let registry_instruction = Instruction {
118
+ let mut instructions = vec ! [ Instruction {
119
119
program_id: id( ) ,
120
120
accounts,
121
121
data: RegistryInstruction :: CreateRegistry {
122
122
proof_instruction_offset,
123
123
}
124
124
. pack( ) ,
125
- } ;
126
- append_zk_elgamal_proof ( registry_instruction, proof_location)
125
+ } ] ;
126
+ append_zk_elgamal_proof ( & mut instructions, proof_location) ?;
127
+ Ok ( instructions)
127
128
}
128
129
129
130
/// Create a `RegistryInstruction::UpdateRegistry` instruction
@@ -137,15 +138,16 @@ pub fn update_registry(
137
138
let proof_instruction_offset = proof_instruction_offset ( & mut accounts, proof_location) ;
138
139
accounts. push ( AccountMeta :: new_readonly ( * owner_address, true ) ) ;
139
140
140
- let registry_instruction = Instruction {
141
+ let mut instructions = vec ! [ Instruction {
141
142
program_id: id( ) ,
142
143
accounts,
143
144
data: RegistryInstruction :: UpdateRegistry {
144
145
proof_instruction_offset,
145
146
}
146
147
. pack( ) ,
147
- } ;
148
- append_zk_elgamal_proof ( registry_instruction, proof_location)
148
+ } ] ;
149
+ append_zk_elgamal_proof ( & mut instructions, proof_location) ?;
150
+ Ok ( instructions)
149
151
}
150
152
151
153
/// Takes a `ProofLocation`, updates the list of accounts, and returns a
@@ -172,11 +174,9 @@ fn proof_instruction_offset(
172
174
/// Takes a `RegistryInstruction` and appends the pubkey validity proof
173
175
/// instruction
174
176
fn append_zk_elgamal_proof (
175
- registry_instruction : Instruction ,
177
+ instructions : & mut Vec < Instruction > ,
176
178
proof_data_location : ProofLocation < PubkeyValidityProofData > ,
177
- ) -> Result < Vec < Instruction > , ProgramError > {
178
- let mut instructions = vec ! [ registry_instruction] ;
179
-
179
+ ) -> Result < ( ) , ProgramError > {
180
180
if let ProofLocation :: InstructionOffset ( proof_instruction_offset, proof_data) =
181
181
proof_data_location
182
182
{
@@ -193,5 +193,5 @@ fn append_zk_elgamal_proof(
193
193
) ,
194
194
}
195
195
}
196
- Ok ( instructions )
196
+ Ok ( ( ) )
197
197
}
0 commit comments