aboutsummaryrefslogtreecommitdiffstats
path: root/core/crypto
diff options
context:
space:
mode:
authorMission Liao <mission.liao@dexon.org>2018-09-28 12:32:50 +0800
committerGitHub <noreply@github.com>2018-09-28 12:32:50 +0800
commit5fc0efa940c7663a33d0fc501807a2627d2cb573 (patch)
tree932ef05c2d091bdbe6bc38f0391d45993cc1f42c /core/crypto
parent189a17a6586cd30ac355bd1165c44da6a2a08569 (diff)
downloaddexon-consensus-5fc0efa940c7663a33d0fc501807a2627d2cb573.tar
dexon-consensus-5fc0efa940c7663a33d0fc501807a2627d2cb573.tar.gz
dexon-consensus-5fc0efa940c7663a33d0fc501807a2627d2cb573.tar.bz2
dexon-consensus-5fc0efa940c7663a33d0fc501807a2627d2cb573.tar.lz
dexon-consensus-5fc0efa940c7663a33d0fc501807a2627d2cb573.tar.xz
dexon-consensus-5fc0efa940c7663a33d0fc501807a2627d2cb573.tar.zst
dexon-consensus-5fc0efa940c7663a33d0fc501807a2627d2cb573.zip
core: hide types.NodeID from full node. (#147)
* Refine core.Governance interface - Remove types.NodeID from interface declaration. - All parameter should be round based. * Add core.NodeSetCache * Agreement accepts map of nodeID directly. * test.Transport.Peers method return public keys.
Diffstat (limited to 'core/crypto')
-rw-r--r--core/crypto/ecdsa/ecdsa.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/crypto/ecdsa/ecdsa.go b/core/crypto/ecdsa/ecdsa.go
index 5f98395..0196c47 100644
--- a/core/crypto/ecdsa/ecdsa.go
+++ b/core/crypto/ecdsa/ecdsa.go
@@ -64,6 +64,12 @@ func newPublicKey(prvKey *ecdsa.PrivateKey) *publicKey {
}
}
+// NewPublicKeyFromByteSlice constructs an eth.publicKey instance from
+// a byte slice.
+func NewPublicKeyFromByteSlice(b []byte) crypto.PublicKey {
+ return publicKey{publicKey: b}
+}
+
// decompressPubkey parses a public key in the 33-byte compressed format.
func decompressPubkey(pubkey []byte) (publicKey, error) {
_, err := ethcrypto.DecompressPubkey(pubkey)