Use 20 different taddrs/scriptpubs for testing dedevtax
This commit is contained in:
28
util/gen_scriptpubs.pl
Executable file
28
util/gen_scriptpubs.pl
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/perl
|
||||
# Copyright (c) 2016-2023 The Hush developers
|
||||
# Distributed under the GPLv3 software license, see the accompanying
|
||||
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
|
||||
use warnings;
|
||||
use strict;
|
||||
use JSON;
|
||||
|
||||
# Generates taddrs/scriptpubs for testing the decentralized devtax
|
||||
# all generated taddrs/scriptpubs will be part of existing wallet.dat
|
||||
|
||||
my $N = shift || 20;
|
||||
my $hush = "./src/hush-cli";
|
||||
my $getnew = "$hush getnewaddress";
|
||||
my $validate = "$hush validateaddress";
|
||||
|
||||
print "std::string DEVTAX_DATA[DEVTAX_NUM][2] = {\n";
|
||||
|
||||
for my $i (1 .. $N) {
|
||||
my $taddr = qx{$getnew};
|
||||
chomp $taddr;
|
||||
my $j = qx{$validate $taddr};
|
||||
my $json = decode_json($j);
|
||||
my $scriptpub = $json->{scriptPubKey};
|
||||
printf qq!{"%s", "%s"},\n!, $taddr, $scriptpub;
|
||||
}
|
||||
|
||||
print "};\n";
|
||||
Reference in New Issue
Block a user