You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// If this is Some then signed mode is used for blocks_processor and tbv_push is done via blocks_processor_url (signed block-processor also handles flashbots_reportBestTrueValue)
103
+
/// If this is Some then blocks_processor_url MUST be some and:
104
+
/// - signed mode is used for blocks_processor.
105
+
/// - tbv_push is done via blocks_processor_url (signed block-processor also handles flashbots_reportBestTrueValue).
107
106
pubkey_registration_url:Option<String>,
108
107
109
108
pubblocks_processor_url:Option<String>,
110
109
111
-
/// For production: Some <=> key_registration_url is Some since it's used by smart-multiplexing.
110
+
/// Cfg to push tbv to redis.
111
+
/// For production we always need some tbv push (since it's used by smart-multiplexing.) so:
let expected_signature = hex::encode(expected_signature.as_bytes());
172
171
// verify that the header contains expected address and signature
173
172
assert_eq!(header_address, signer_address);
174
173
assert_eq!(header_signature, expected_signature);
175
174
}
176
175
177
176
#[tokio::test]
178
177
asyncfntest_skips_non_json(){
179
-
let fb_signer = LocalWallet::new(&mut thread_rng());
178
+
let fb_signer = PrivateKeySigner::random();
180
179
181
180
// mock service that returns the request headers
182
181
let svc = FlashbotsSigner{
@@ -210,7 +209,7 @@ mod tests {
210
209
211
210
#[tokio::test]
212
211
asyncfntest_returns_error_when_not_post(){
213
-
let fb_signer = LocalWallet::new(&mut thread_rng());
212
+
let fb_signer = PrivateKeySigner::random();
214
213
215
214
// mock service that returns the request headers
216
215
let svc = FlashbotsSigner{
@@ -240,5 +239,52 @@ mod tests {
240
239
// should be an error
241
240
assert!(res.is_err());
242
241
}
242
+
243
+
/// Uses a static private key and compares the signature generated by this package to the signature
244
+
/// generated by the `cast` CLI.
245
+
/// Test copied from https://github.com/flashbots/go-utils/blob/main/signature/signature_test.go#L146 501d395be6a9802494ef1ef25a755acaa4448c17 (TestSignatureCreateCompareToCastAndEthers)
let signer_address = "0x96216849c49358B10257cb55b28eA603c874b05E".to_lowercase();
285
+
let expected_signature = "1446053488f02d460c012c84c4091cd5054d98c6cfca01b65f6c1a72773e80e60b8a4931aeee7ed18ce3adb45b2107e8c59e25556c1f871a8334e30e5bddbed21c";
286
+
// verify that the header contains expected address and signature
0 commit comments