SatSale

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

test_xpub.py (957B)


      1 import os
      2 import sys
      3 
      4 sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
      5 from node.xpub import xpub
      6 
      7 
      8 def test_xpub():
      9     # Account 0, root = m/84'/0'/0'
     10     test_zpub = "zpub6rFR7y4Q2AijBEqTUquhVz398htDFrtymD9xYYfG1m4wAcvPhXNfE3EfH1r1ADqtfSdVCToUG868RvUUkgDKf31mGDtKsAYz2oz2AGutZYs"
     11     pseudonode = xpub({"xpub": test_zpub, "bip": "BIP84"})
     12     assert (
     13         pseudonode.get_address_at_index(0)
     14         == "bc1qcr8te4kr609gcawutmrza0j4xv80jy8z306fyu"
     15     )
     16     assert (
     17         pseudonode.get_address_at_index(1)
     18         == "bc1qnjg0jd8228aq7egyzacy8cys3knf9xvrerkf9g"
     19     )
     20 
     21     test_xpub = "xpub6C5uh2bEhmF8ck3LSnNsj261dt24wrJHMcsXcV25MjrYNo3ZiduE3pS2Xs7nKKTR6kGPDa8jemxCQPw6zX2LMEA6VG2sypt2LUJRHb8G63i"
     22     pseudonode2 = xpub({"xpub": test_xpub, "bip": "BIP44"})
     23     assert pseudonode2.get_address_at_index(0) == "1LLNwhAMsS3J9tZR2T4fFg2ibuZyRSxFZg"
     24     assert pseudonode2.get_address_at_index(1) == "1EaEuwMRVKdWBoKeJZzJ8abUzVbWNhGhtC"