This repository was archived by the owner on Mar 11, 2025. It is now read-only.
File tree 3 files changed +10
-4
lines changed
token/confidential-transfer
3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -36,9 +36,12 @@ pub fn burn_split_proof_data(
36
36
burn_amount : u64 ,
37
37
source_elgamal_keypair : & ElGamalKeypair ,
38
38
source_aes_key : & AeKey ,
39
- auditor_elgamal_pubkey : & ElGamalPubkey ,
39
+ auditor_elgamal_pubkey : Option < & ElGamalPubkey > ,
40
40
supply_elgamal_pubkey : & ElGamalPubkey ,
41
41
) -> Result < BurnProofData , TokenProofGenerationError > {
42
+ let default_auditor_pubkey = ElGamalPubkey :: default ( ) ;
43
+ let auditor_elgamal_pubkey = auditor_elgamal_pubkey. unwrap_or ( & default_auditor_pubkey) ;
44
+
42
45
// split the burn amount into low and high bits
43
46
let ( burn_amount_lo, burn_amount_hi) = try_split_u64 ( burn_amount, BURN_AMOUNT_LO_BIT_LENGTH )
44
47
. ok_or ( TokenProofGenerationError :: IllegalAmountBitLength ) ?;
Original file line number Diff line number Diff line change @@ -38,8 +38,11 @@ pub fn mint_split_proof_data(
38
38
supply_elgamal_keypair : & ElGamalKeypair ,
39
39
supply_aes_key : & AeKey ,
40
40
destination_elgamal_pubkey : & ElGamalPubkey ,
41
- auditor_elgamal_pubkey : & ElGamalPubkey ,
41
+ auditor_elgamal_pubkey : Option < & ElGamalPubkey > ,
42
42
) -> Result < MintProofData , TokenProofGenerationError > {
43
+ let default_auditor_pubkey = ElGamalPubkey :: default ( ) ;
44
+ let auditor_elgamal_pubkey = auditor_elgamal_pubkey. unwrap_or ( & default_auditor_pubkey) ;
45
+
43
46
// split the mint amount into low and high bits
44
47
let ( mint_amount_lo, mint_amount_hi) = try_split_u64 ( mint_amount, MINT_AMOUNT_LO_BIT_LENGTH )
45
48
. ok_or ( TokenProofGenerationError :: IllegalAmountBitLength ) ?;
Original file line number Diff line number Diff line change @@ -238,7 +238,7 @@ fn test_mint_validity(mint_amount: u64, supply: u64) {
238
238
& supply_keypair,
239
239
& supply_aes_key,
240
240
destination_pubkey,
241
- auditor_pubkey,
241
+ Some ( auditor_pubkey) ,
242
242
)
243
243
. unwrap ( ) ;
244
244
@@ -291,7 +291,7 @@ fn test_burn_validity(spendable_balance: u64, burn_amount: u64) {
291
291
burn_amount,
292
292
& source_keypair,
293
293
& aes_key,
294
- auditor_pubkey,
294
+ Some ( auditor_pubkey) ,
295
295
supply_pubkey,
296
296
)
297
297
. unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments