common/test: Fix test vector generation.
We were printing out the final merkle root before calculating it, resulting in the final one being the same as the previous. Reported-by: Aditya Sharma Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
d732fa9724
commit
83d9a0005d
|
@ -383,16 +383,17 @@ int main(int argc, char *argv[])
|
|||
ordered(b12,
|
||||
H(LnBranch,
|
||||
ordered(leaf[4], leaf[5]))))));
|
||||
json_out("],");
|
||||
json_out("\"merkle\": \"%s\"",
|
||||
type_to_string(tmpctx, struct sha256, m));
|
||||
json_out("}]");
|
||||
|
||||
m = H(LnBranch,
|
||||
ordered(H(LnBranch,
|
||||
ordered(H(LnBranch, ordered(leaf[0], leaf[1])),
|
||||
H(LnBranch, ordered(leaf[2], leaf[3])))),
|
||||
H(LnBranch, ordered(leaf[4], leaf[5]))));
|
||||
|
||||
json_out("],");
|
||||
json_out("\"merkle\": \"%s\"",
|
||||
type_to_string(tmpctx, struct sha256, m));
|
||||
json_out("}]");
|
||||
|
||||
printf("offer = %s, merkle = %s\n",
|
||||
tal_hex(tmpctx, all),
|
||||
type_to_string(tmpctx, struct sha256, m));
|
||||
|
|
Loading…
Reference in New Issue