Skip to content

Commit

Permalink
set who when raising disputes (#292)
Browse files Browse the repository at this point in the history
* set who when raising disputes

* fix for tests
  • Loading branch information
samelamin committed Dec 11, 2023
1 parent d993fcc commit 9b49d17
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
14 changes: 10 additions & 4 deletions pallets/disputes/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,14 @@ pub mod pallet {
#[pallet::generate_deposit(pub(super) fn deposit_event)]
pub enum Event<T: Config> {
/// A dispute has been raised.
DisputeRaised { dispute_key: T::DisputeKey },
DisputeRaised {
who: AccountIdOf<T>,
dispute_key: T::DisputeKey,
},
/// A disute has been voted on
DisputeVotedOn {
dispute_key: T::DisputeKey,
who: AccountIdOf<T>,
dispute_key: T::DisputeKey,
vote: bool,
},
/// A dispute has been completed.
Expand Down Expand Up @@ -339,7 +342,7 @@ pub mod pallet {
let expiration_block =
frame_system::Pallet::<T>::block_number().saturating_add(T::VotingTimeLimit::get());
let dispute = Self {
raised_by,
raised_by: raised_by.clone(),
jury,
votes: Default::default(),
specifiers,
Expand All @@ -356,7 +359,10 @@ pub mod pallet {
Ok::<(), DispatchError>(())
})?;

crate::Pallet::<T>::deposit_event(Event::<T>::DisputeRaised { dispute_key });
crate::Pallet::<T>::deposit_event(Event::<T>::DisputeRaised {
who: raised_by,
dispute_key,
});
Ok(())
}

Expand Down
6 changes: 5 additions & 1 deletion pallets/disputes/src/tests/pallet_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ fn raise_dispute_assert_event() {
specifics,
));
System::assert_last_event(RuntimeEvent::PalletDisputes(Event::<Test>::DisputeRaised {
who: ALICE,
dispute_key,
}));
});
Expand All @@ -51,7 +52,10 @@ fn raise_dispute_assert_event_too_many_disputes() {
i, ALICE, jury, specifics,
));
System::assert_last_event(RuntimeEvent::PalletDisputes(
Event::<Test>::DisputeRaised { dispute_key: i },
Event::<Test>::DisputeRaised {
who: ALICE,
dispute_key: i,
},
));
} else {
let actual_result = <PalletDisputes as DisputeRaiser<AccountId>>::raise_dispute(
Expand Down
2 changes: 1 addition & 1 deletion runtime/imbue-kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("imbue"),
impl_name: create_runtime_str!("imbue"),
authoring_version: 2,
spec_version: 1_100_001,
spec_version: 1_100_002,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
Expand Down
2 changes: 1 addition & 1 deletion scripts/docker-compose-kusama-archive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3.2"
services:
imbue-1:
container_name: imbue-1
image: samelamin/imbue:polkadot-v0.9.37-v4
image: samelamin/imbue:release-polkadot-v1.1.0
ports:
- "9615:9615"
- "9616:9616"
Expand Down

0 comments on commit 9b49d17

Please sign in to comment.