|
4 | 4 | Result,
|
5 | 5 | anyhow,
|
6 | 6 | },
|
| 7 | + ed25519_dalek::SecretKey, |
7 | 8 | futures_util::{
|
8 | 9 | SinkExt,
|
9 | 10 | stream::{
|
@@ -47,16 +48,16 @@ pub struct Config {
|
47 | 48 | pub relayer_urls: Vec<Url>,
|
48 | 49 | pub publisher_id: u32,
|
49 | 50 | pub authorization_token: String,
|
50 |
| - publisher_keypair: PublisherKeypair, |
| 51 | + publisher_secret_key: PublisherSecretKey, |
51 | 52 | #[serde(with = "humantime_serde", default = "default_publish_interval")]
|
52 | 53 | pub publish_interval_duration: Duration,
|
53 | 54 | }
|
54 | 55 |
|
55 | 56 | #[derive(Clone, Deserialize)]
|
56 |
| -struct PublisherKeypair(Vec<u8>); |
57 |
| -impl std::fmt::Debug for PublisherKeypair { |
| 57 | +struct PublisherSecretKey(SecretKey); |
| 58 | +impl std::fmt::Debug for PublisherSecretKey { |
58 | 59 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
59 |
| - write!(f, "PublisherKeypair(redacted)") |
| 60 | + write!(f, "PublisherSecretKey(redacted)") |
60 | 61 | }
|
61 | 62 | }
|
62 | 63 |
|
@@ -173,8 +174,8 @@ mod lazer_exporter {
|
173 | 174 | },
|
174 | 175 | anyhow::bail,
|
175 | 176 | ed25519_dalek::{
|
176 |
| - Keypair, |
177 | 177 | Signer,
|
| 178 | + SigningKey, |
178 | 179 | },
|
179 | 180 | futures_util::StreamExt,
|
180 | 181 | protobuf::{
|
@@ -258,7 +259,7 @@ mod lazer_exporter {
|
258 | 259 | stream_map.insert(config.relayer_urls[i].clone(), receiver);
|
259 | 260 | }
|
260 | 261 |
|
261 |
| - let keypair = Keypair::from_bytes(&config.publisher_keypair.0)?; |
| 262 | + let signing_key = SigningKey::from_bytes(&config.publisher_secret_key.0); |
262 | 263 | let mut publish_interval = tokio::time::interval(config.publish_interval_duration);
|
263 | 264 |
|
264 | 265 | loop {
|
@@ -310,7 +311,7 @@ mod lazer_exporter {
|
310 | 311 | continue;
|
311 | 312 | }
|
312 | 313 | };
|
313 |
| - let signature = keypair.sign(&buf); |
| 314 | + let signature = signing_key.sign(&buf); |
314 | 315 | let signed_lazer_transaction = SignedLazerTransaction {
|
315 | 316 | signature_type: Some(TransactionSignatureType::ed25519.into()),
|
316 | 317 | signature: Some(signature.to_bytes().to_vec()),
|
|
0 commit comments