-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathresponse.rs
More file actions
53 lines (48 loc) · 1.31 KB
/
Copy pathresponse.rs
File metadata and controls
53 lines (48 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
use alloy::{
primitives::{Address, B256, U256},
rpc::types::beacon::BlsSignature,
};
use serde::{Deserialize, Serialize};
use crate::signer::{BlsPublicKey, EcdsaSignature};
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct BlsSignResponse {
pub pubkey: BlsPublicKey,
pub object_root: B256,
pub module_signing_id: B256,
pub nonce: u64,
pub chain_id: U256,
pub signature: BlsSignature,
}
impl BlsSignResponse {
pub fn new(
pubkey: BlsPublicKey,
object_root: B256,
module_signing_id: B256,
nonce: u64,
chain_id: U256,
signature: BlsSignature,
) -> Self {
Self { pubkey, object_root, module_signing_id, nonce, chain_id, signature }
}
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct EcdsaSignResponse {
pub address: Address,
pub object_root: B256,
pub module_signing_id: B256,
pub nonce: u64,
pub chain_id: U256,
pub signature: EcdsaSignature,
}
impl EcdsaSignResponse {
pub fn new(
address: Address,
object_root: B256,
module_signing_id: B256,
nonce: u64,
chain_id: U256,
signature: EcdsaSignature,
) -> Self {
Self { address, object_root, module_signing_id, nonce, chain_id, signature }
}
}