|
|
@ -13,7 +13,7 @@ func TestMessageSimpleWrap(t *testing.T) { |
|
|
|
payload := []byte("hello world") |
|
|
|
payload := []byte("hello world") |
|
|
|
|
|
|
|
|
|
|
|
msg := NewMessage(payload) |
|
|
|
msg := NewMessage(payload) |
|
|
|
if _, err := msg.Wrap(DefaultProofOfWork, Options{}); err != nil { |
|
|
|
if _, err := msg.Wrap(DefaultPoW, Options{}); err != nil { |
|
|
|
t.Fatalf("failed to wrap message: %v", err) |
|
|
|
t.Fatalf("failed to wrap message: %v", err) |
|
|
|
} |
|
|
|
} |
|
|
|
if msg.Flags&signatureFlag != 0 { |
|
|
|
if msg.Flags&signatureFlag != 0 { |
|
|
@ -36,7 +36,7 @@ func TestMessageCleartextSignRecover(t *testing.T) { |
|
|
|
payload := []byte("hello world") |
|
|
|
payload := []byte("hello world") |
|
|
|
|
|
|
|
|
|
|
|
msg := NewMessage(payload) |
|
|
|
msg := NewMessage(payload) |
|
|
|
if _, err := msg.Wrap(DefaultProofOfWork, Options{ |
|
|
|
if _, err := msg.Wrap(DefaultPoW, Options{ |
|
|
|
From: key, |
|
|
|
From: key, |
|
|
|
}); err != nil { |
|
|
|
}); err != nil { |
|
|
|
t.Fatalf("failed to sign message: %v", err) |
|
|
|
t.Fatalf("failed to sign message: %v", err) |
|
|
@ -69,7 +69,7 @@ func TestMessageAnonymousEncryptDecrypt(t *testing.T) { |
|
|
|
payload := []byte("hello world") |
|
|
|
payload := []byte("hello world") |
|
|
|
|
|
|
|
|
|
|
|
msg := NewMessage(payload) |
|
|
|
msg := NewMessage(payload) |
|
|
|
envelope, err := msg.Wrap(DefaultProofOfWork, Options{ |
|
|
|
envelope, err := msg.Wrap(DefaultPoW, Options{ |
|
|
|
To: &key.PublicKey, |
|
|
|
To: &key.PublicKey, |
|
|
|
}) |
|
|
|
}) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
@ -104,7 +104,7 @@ func TestMessageFullCrypto(t *testing.T) { |
|
|
|
|
|
|
|
|
|
|
|
payload := []byte("hello world") |
|
|
|
payload := []byte("hello world") |
|
|
|
msg := NewMessage(payload) |
|
|
|
msg := NewMessage(payload) |
|
|
|
envelope, err := msg.Wrap(DefaultProofOfWork, Options{ |
|
|
|
envelope, err := msg.Wrap(DefaultPoW, Options{ |
|
|
|
From: fromKey, |
|
|
|
From: fromKey, |
|
|
|
To: &toKey.PublicKey, |
|
|
|
To: &toKey.PublicKey, |
|
|
|
}) |
|
|
|
}) |
|
|
|