Skip to content

Commit

Permalink
update sov-seq-registry
Browse files Browse the repository at this point in the history
  • Loading branch information
bkolad committed Aug 24, 2023
1 parent 88cbfe9 commit 9a0ef52
Showing 1 changed file with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ use sov_state::{ProverStorage, WorkingSet};
mod helpers;

use helpers::*;
use sov_modules_api::Address;
use sov_rollup_interface::mocks::MockBlob;
use sov_rollup_interface::mocks::{MockAddress, MockBlob};
use sov_sequencer_registry::{SequencerOutcome, SequencerRegistry};

#[test]
Expand All @@ -23,7 +22,7 @@ fn begin_blob_hook_known_sequencer() {

let mut test_blob = MockBlob::new(
Vec::new(),
Address::from(GENESIS_SEQUENCER_DA_ADDRESS),
MockAddress::from(GENESIS_SEQUENCER_DA_ADDRESS),
[0_u8; 32],
);

Expand All @@ -50,7 +49,7 @@ fn begin_blob_hook_unknown_sequencer() {

let mut test_blob = MockBlob::new(
Vec::new(),
Address::from(UNKNOWN_SEQUENCER_DA_ADDRESS),
MockAddress::from(UNKNOWN_SEQUENCER_DA_ADDRESS),
[0_u8; 32],
);

Expand All @@ -60,7 +59,7 @@ fn begin_blob_hook_unknown_sequencer() {
assert!(result.is_err());
let expected_message = format!(
"sender {} is not allowed to submit blobs",
Address::from(UNKNOWN_SEQUENCER_DA_ADDRESS)
MockAddress::from(UNKNOWN_SEQUENCER_DA_ADDRESS)
);
let actual_message = result.err().unwrap().to_string();
assert_eq!(expected_message, actual_message);
Expand All @@ -80,7 +79,7 @@ fn end_blob_hook_success() {

let mut test_blob = MockBlob::new(
Vec::new(),
Address::from(GENESIS_SEQUENCER_DA_ADDRESS),
MockAddress::from(GENESIS_SEQUENCER_DA_ADDRESS),
[0_u8; 32],
);

Expand All @@ -89,7 +88,7 @@ fn end_blob_hook_success() {
.begin_blob_hook(&mut test_blob, working_set)
.unwrap();

<SequencerRegistry<C> as ApplyBlobHooks<MockBlob<Address>>>::end_blob_hook(
<SequencerRegistry<C> as ApplyBlobHooks<MockBlob<MockAddress>>>::end_blob_hook(
&test_sequencer.registry,
SequencerOutcome::Completed,
working_set,
Expand Down Expand Up @@ -118,7 +117,7 @@ fn end_blob_hook_slash() {

let mut test_blob = MockBlob::new(
Vec::new(),
Address::from(GENESIS_SEQUENCER_DA_ADDRESS),
MockAddress::from(GENESIS_SEQUENCER_DA_ADDRESS),
[0_u8; 32],
);

Expand All @@ -130,7 +129,7 @@ fn end_blob_hook_slash() {
let result = SequencerOutcome::Slashed {
sequencer: GENESIS_SEQUENCER_DA_ADDRESS.to_vec(),
};
<SequencerRegistry<C> as ApplyBlobHooks<MockBlob<Address>>>::end_blob_hook(
<SequencerRegistry<C> as ApplyBlobHooks<MockBlob<MockAddress>>>::end_blob_hook(
&test_sequencer.registry,
result,
working_set,
Expand Down Expand Up @@ -179,7 +178,7 @@ fn end_blob_hook_slash_preferred_sequencer() {

let mut test_blob = MockBlob::new(
Vec::new(),
Address::from(GENESIS_SEQUENCER_DA_ADDRESS),
MockAddress::from(GENESIS_SEQUENCER_DA_ADDRESS),
[0_u8; 32],
);

Expand All @@ -191,7 +190,7 @@ fn end_blob_hook_slash_preferred_sequencer() {
let result = SequencerOutcome::Slashed {
sequencer: GENESIS_SEQUENCER_DA_ADDRESS.to_vec(),
};
<SequencerRegistry<C> as ApplyBlobHooks<MockBlob<Address>>>::end_blob_hook(
<SequencerRegistry<C> as ApplyBlobHooks<MockBlob<MockAddress>>>::end_blob_hook(
&test_sequencer.registry,
result,
working_set,
Expand Down Expand Up @@ -221,7 +220,7 @@ fn end_blob_hook_slash_unknown_sequencer() {

let mut test_blob = MockBlob::new(
Vec::new(),
Address::from(GENESIS_SEQUENCER_DA_ADDRESS),
MockAddress::from(GENESIS_SEQUENCER_DA_ADDRESS),
[0_u8; 32],
);

Expand All @@ -239,7 +238,7 @@ fn end_blob_hook_slash_unknown_sequencer() {
let result = SequencerOutcome::Slashed {
sequencer: UNKNOWN_SEQUENCER_DA_ADDRESS.to_vec(),
};
<SequencerRegistry<C> as ApplyBlobHooks<MockBlob<Address>>>::end_blob_hook(
<SequencerRegistry<C> as ApplyBlobHooks<MockBlob<MockAddress>>>::end_blob_hook(
&test_sequencer.registry,
result,
working_set,
Expand Down

0 comments on commit 9a0ef52

Please sign in to comment.