diff options
author | zelig <viktor.tron@gmail.com> | 2015-01-18 16:03:39 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2015-02-06 07:00:34 +0800 |
commit | 88167f39a6437e282ff75a6ec30e8081d6d50441 (patch) | |
tree | 2d9e361a02cbd81509485bfe790468c2ed9e372c /p2p/client_identity_test.go | |
parent | c8a8aa0d43336491f6aa264467968e06b489d34c (diff) | |
download | go-tangerine-88167f39a6437e282ff75a6ec30e8081d6d50441.tar.gz go-tangerine-88167f39a6437e282ff75a6ec30e8081d6d50441.tar.zst go-tangerine-88167f39a6437e282ff75a6ec30e8081d6d50441.zip |
add privkey to clientIdentity + tests
Diffstat (limited to 'p2p/client_identity_test.go')
-rw-r--r-- | p2p/client_identity_test.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/p2p/client_identity_test.go b/p2p/client_identity_test.go index 7248a7b1a..61c34fbf1 100644 --- a/p2p/client_identity_test.go +++ b/p2p/client_identity_test.go @@ -1,13 +1,22 @@ package p2p import ( + "bytes" "fmt" "runtime" "testing" ) func TestClientIdentity(t *testing.T) { - clientIdentity := NewSimpleClientIdentity("Ethereum(G)", "0.5.16", "test", []byte("pubkey")) + clientIdentity := NewSimpleClientIdentity("Ethereum(G)", "0.5.16", "test", []byte("privkey"), []byte("pubkey")) + key := clientIdentity.Privkey() + if !bytes.Equal(key, []byte("privkey")) { + t.Errorf("Expected Privkey to be %x, got %x", key, []byte("privkey")) + } + key = clientIdentity.Pubkey() + if !bytes.Equal(key, []byte("pubkey")) { + t.Errorf("Expected Pubkey to be %x, got %x", key, []byte("pubkey")) + } clientString := clientIdentity.String() expected := fmt.Sprintf("Ethereum(G)/v0.5.16/test/%s/%s", runtime.GOOS, runtime.Version()) if clientString != expected { |