Skip to content

Commit

Permalink
Fixed PreImage bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ndkazu committed Feb 28, 2023
1 parent 94d908e commit b4df92d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 2 additions & 5 deletions pallets/asset_management/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,8 @@ impl<T: Config> Pallet<T> {

let proposal_hash = T::Hashing::hash_of(&call_dispatch);
let proposal_encoded: Vec<u8> = call_dispatch.encode();
match Dem::Pallet::<T>::note_preimage(origin, proposal_encoded) {
Ok(_) => (),
Err(x) if x == Error::<T>::DuplicatePreimage.into() => (),
Err(x) => panic!("{x:?}"),
}
Dem::Pallet::<T>::note_preimage(origin, proposal_encoded).ok();

proposal_hash
}

Expand Down
2 changes: 0 additions & 2 deletions pallets/asset_management/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,6 @@ pub mod pallet {
StorageOverflow,
/// The proposal could not be created
FailedToCreateProposal,
/// This Preimage already exists
DuplicatePreimage,
/// Not an owner in the corresponding virtual account
NotAnOwner,
/// The Asset Does not Exists
Expand Down

0 comments on commit b4df92d

Please sign in to comment.