(t *testing.T)
| 72 | } |
| 73 | |
| 74 | func TestP2SP(t *testing.T) { |
| 75 | pub1, _, _ := ed25519.GenerateKey(nil) |
| 76 | pub2, _, _ := ed25519.GenerateKey(nil) |
| 77 | prog, _ := P2SPMultiSigProgram([]ed25519.PublicKey{pub1, pub2}, 1) |
| 78 | pubs, n, err := ParseP2SPMultiSigProgram(prog) |
| 79 | if err != nil { |
| 80 | t.Fatal(err) |
| 81 | } |
| 82 | if n != 1 { |
| 83 | t.Errorf("expected nrequired=1, got %d", n) |
| 84 | } |
| 85 | if !bytes.Equal(pubs[0], pub1) { |
| 86 | t.Errorf("expected first pubkey to be %x, got %x", pub1, pubs[0]) |
| 87 | } |
| 88 | if !bytes.Equal(pubs[1], pub2) { |
| 89 | t.Errorf("expected second pubkey to be %x, got %x", pub2, pubs[1]) |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | func TestBlockMultisig(t *testing.T) { |
| 94 | pub1, _, _ := ed25519.GenerateKey(nil) |
nothing calls this directly
no test coverage detected