Skip to content

Commit

Permalink
Add silentpayments_test_outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
jlest01 committed Aug 1, 2024
1 parent baf189e commit 5c604b4
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions src/modules/silentpayments/main_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,6 @@ static int secp256k1_silentpayments_create_output_pubkey(const secp256k1_context
return ret;
}

static void print_hex(unsigned char* data, size_t size) {
size_t i;
printf("0x");
for (i = 0; i < size; i++) {
printf("%02x", data[i]);
}
printf("\n");
}

int secp256k1_silentpayments_test_outputs(
const secp256k1_context *ctx,
const secp256k1_silentpayments_recipient *recipients,
Expand All @@ -165,9 +156,7 @@ int secp256k1_silentpayments_test_outputs(
unsigned char compressed_scan_pubkey[33];
unsigned char compressed_spend_pubkey[33];
size_t len;

printf("index: %ld\n", recipients[i].index);


/* Serialize pubkey1 in a compressed form (33 bytes), should always return 1 */
len = sizeof(compressed_scan_pubkey);
ret = secp256k1_ec_pubkey_serialize(ctx, compressed_scan_pubkey, &len, &recipients[i].scan_pubkey, SECP256K1_EC_COMPRESSED);
Expand All @@ -178,13 +167,6 @@ int secp256k1_silentpayments_test_outputs(
ret = secp256k1_ec_pubkey_serialize(ctx, compressed_spend_pubkey, &len, &recipients[i].spend_pubkey, SECP256K1_EC_COMPRESSED);
/* Should be the same size as the size of the output, because we passed a 33 byte array. */
VERIFY_CHECK(len == sizeof(compressed_spend_pubkey));

printf("scan_pubkey: ");
print_hex(compressed_scan_pubkey, sizeof(compressed_scan_pubkey));

printf("spend_pubkey: ");
print_hex(compressed_spend_pubkey, sizeof(compressed_spend_pubkey));

}

return ret;
Expand Down

0 comments on commit 5c604b4

Please sign in to comment.