common, crypto: add ICAP functions

This commit is contained in:
Gustav Simonsson
2015-10-06 18:39:42 +02:00
parent 44fd395141
commit 2db9798646
5 changed files with 314 additions and 0 deletions

View File

@ -20,6 +20,7 @@ import (
"encoding/hex"
"fmt"
"reflect"
"strings"
"testing"
"github.com/ethereum/go-ethereum/common"
@ -223,3 +224,10 @@ func loadKeyStoreTestV1(file string, t *testing.T) map[string]KeyStoreTestV1 {
}
return tests
}
func TestKeyForDirectICAP(t *testing.T) {
key := NewKeyForDirectICAP(randentropy.Reader)
if !strings.HasPrefix(key.Address.Hex(), "0x00") {
t.Errorf("Expected first address byte to be zero, have: %s", key.Address.Hex())
}
}