clightning-dumpkeys

dump clightning output descriptors
git clone git://jb55.com/clightning-dumpkeys
Log | Files | Refs | README | LICENSE

check.c (493B)


      1 
      2 #include "bip32.h"
      3 #include "descriptor.h"
      4 #include <stdio.h>
      5 #include <assert.h>
      6 #include <string.h>
      7 
      8 int main()
      9 {
     10 	char checksum[9];
     11 	const char desc[] = "combo(xpub661MyMwAqRbcEzDwwjzJhBnXBZpv9hdqY2JYRUtwzEZU6grFRhWkXx9c3HJ4EKR1Nvdwf5U3VoekstoKSKjfcJYhRrhMYeEzZzu2h7uZAQX/1/*)";
     12 	const char *desc_check = "j38hxvh0";
     13 	int ok = descriptor_checksum(desc, sizeof(desc)-1, checksum, sizeof(checksum));
     14 	assert(ok == (int)strlen(desc_check));
     15 	assert(streq(checksum, desc_check));
     16 	return 0;
     17 }