decred.org/dcrdex@v1.0.5/dex/networks/dgb/params_test.go (about) 1 package dgb 2 3 import ( 4 "encoding/hex" 5 "testing" 6 7 btctest "decred.org/dcrdex/dex/networks/btc/test" 8 ) 9 10 func TestCompatibility(t *testing.T) { 11 fromHex := func(str string) []byte { 12 b, err := hex.DecodeString(str) 13 if err != nil { 14 t.Fatalf("error decoding %s: %v", str, err) 15 } 16 return b 17 } 18 // These scripts and addresses are just copy-pasted from random 19 // getrawtransaction output. 20 items := &btctest.CompatibilityItems{ 21 P2PKHScript: fromHex("76a914621b33eb176c7800f5da7b71765d091b1592e58788ac"), 22 PKHAddr: "DE5qM9Bepj1bra5cQE8wZfgGik2e11YhGz", 23 P2WPKHScript: fromHex("0014289593f256d5e258f8baa9f9f309187cb4c982d0"), 24 WPKHAddr: "dgb1q9z2e8ujk6h39379648ulxzgc0j6vnqksyznpa9", 25 P2SHScript: fromHex("a914473219ec32e225dfed8e21d96c2405626ed8981087"), 26 SHAddr: "STnT2ZLedFDsrBZpohp7HrTFyGzXdJMoV4", 27 P2WSHScript: fromHex("0020dd779dad5ed7f478e8d41600a9e9ade3904f8113796207322fc829107d353a78"), 28 WSHAddr: "dgb1qm4memt276l6836x5zcq2n6dduwgylqgn093qwv30eq53qlf48fuq5jjcje", 29 } 30 btctest.CompatibilityCheck(t, items, MainNetParams) 31 }