Add serde for Signature types (#4109)

* refactor: Added `from_slice()` method to ECDSA signatures

* doc: Modified ECDSA signature docstring to note Recovery ID

* feat: Implemented serde for Signature types

Note: using hexstring encoding

* feat: Automatically derive serde for MultiSignature

* refactor: Convert hex bytes using try_from instead of from_slice

Avoids panicking in critical code

Implemented from Peer Review

* clean: spaces -> tabs

* test: Added tests for Signature serialization

Added dependency on serde_json for testing purposes
This commit is contained in:
Bryant Eisenbach
2019-11-18 15:00:47 -05:00
committed by Bastian Köcher
parent 621c02440a
commit 566328cd3e
6 changed files with 157 additions and 17 deletions
+1
View File
@@ -44,6 +44,7 @@ pretty_assertions = "0.6.1"
hex-literal = "0.2.1"
rand = "0.7.2"
criterion = "0.2.11"
serde_json = "1.0"
[[bench]]
name = "bench"