34 lines
1.0 KiB
Bash
34 lines
1.0 KiB
Bash
|
#!/bin/bash
|
||
|
set -e
|
||
|
|
||
|
# See https://github.com/zcash/lightwalletd/issues/263
|
||
|
#
|
||
|
# This generates the input to `genblocks` to create block sets for
|
||
|
# this test, which is two transactions mined into a block, then a
|
||
|
# reorg happens and the same two transactions are mined into a new
|
||
|
# version of the same-height block but in reverse order (so their
|
||
|
# index values have changed).
|
||
|
#
|
||
|
# The two transactions used here were copied from ../transactions;
|
||
|
# see that directory for how to reproduce them.
|
||
|
|
||
|
# We need to use the real mainnet version of 663150, so build a
|
||
|
# blockchain based on that block.
|
||
|
mkdir -p blocks
|
||
|
for i in {663151..663200}; do
|
||
|
touch blocks/$i.txt
|
||
|
done
|
||
|
|
||
|
# Add two transactions to height 663195, first shielded, then transparent
|
||
|
cat t-shielded-spend.txt t1.txt > blocks/663195.txt
|
||
|
|
||
|
# Generate the blockchain
|
||
|
cp 663150.txt before-reorg.txt
|
||
|
genblocks -start-height 663151 >> before-reorg.txt
|
||
|
|
||
|
# now reverse the order of the tx in the same block
|
||
|
cat t1.txt t-shielded-spend.txt > blocks/663195.txt
|
||
|
genblocks -start-height 663195 > after-reorg.txt
|
||
|
|
||
|
rm -r blocks
|