@@ -25,6 +25,10 @@ object EthereumNodeRecord {
25
25
// Normally clients treat the values as RLP, however we don't have access to the RLP types here, hence it's just bytes.
26
26
attrs : SortedMap [ByteVector , ByteVector ]
27
27
)
28
+ object Content {
29
+ def apply (seq : Long , attrs : (ByteVector , ByteVector )* ): Content =
30
+ Content (seq, SortedMap (attrs : _* ))
31
+ }
28
32
29
33
object Keys {
30
34
private def key (k : String ): ByteVector =
@@ -61,14 +65,14 @@ object EthereumNodeRecord {
61
65
def apply (signature : Signature , seq : Long , attrs : (ByteVector , ByteVector )* ): EthereumNodeRecord =
62
66
EthereumNodeRecord (
63
67
signature,
64
- EthereumNodeRecord .Content (seq, SortedMap ( attrs : _* ) )
68
+ EthereumNodeRecord .Content (seq, attrs : _* )
65
69
)
66
70
67
71
def apply (privateKey : PrivateKey , seq : Long , attrs : (ByteVector , ByteVector )* )(
68
72
implicit sigalg : SigAlg ,
69
73
codec : Codec [Content ]
70
74
): Attempt [EthereumNodeRecord ] = {
71
- val content = EthereumNodeRecord .Content (seq, SortedMap ( attrs : _* ) )
75
+ val content = EthereumNodeRecord .Content (seq, attrs : _* )
72
76
codec.encode(content).map { data =>
73
77
val sig = sigalg.removeRecoveryId(sigalg.sign(privateKey, data))
74
78
EthereumNodeRecord (sig, content)
0 commit comments