Skip to content

Commit

Permalink
fix delegate, remove unneded feature
Browse files Browse the repository at this point in the history
  • Loading branch information
coreggon11 committed Jul 28, 2023
1 parent a81d53f commit bae858b
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions contracts/src/upgradeability/diamond/diamond.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ where
.set_tail_call(true),
)
.try_invoke()
.unwrap_or_else(|err| panic!("delegate call to {:?} failed due to {:?}", delegate_code, err))
.unwrap_or_else(|err| panic!("delegate call to {:?} failed due to {:?}", delegate_code, err));
unreachable!("the _fallback call will never return since `tail_call` was set");
}
Expand All @@ -204,6 +205,7 @@ where
.set_tail_call(true))
.returns::<()>()
.try_invoke()
.unwrap_or_else(|err| panic!("init call failed due to {:?}", err))
.unwrap_or_else(|err| panic!("init call failed due to {:?}", err));
unreachable!("the _init_call call will never return since `tail_call` was set");
}
Expand Down
7 changes: 7 additions & 0 deletions contracts/src/upgradeability/proxy/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ impl<T: Storage<Data>> Internal for T {
.set_tail_call(true),
)
.try_invoke()
.unwrap_or_else(|err| {
panic!(
"delegate call to {:?} failed due to {:?}",
self.data().forward_to.clone(),
err
)
})
.unwrap_or_else(|err| {
panic!(
"delegate call to {:?} failed due to {:?}",
Expand Down
1 change: 0 additions & 1 deletion examples/psp22_pallet/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![cfg_attr(not(feature = "std"), no_std, no_main)]
#![feature(min_specialization)]
#![feature(default_alloc_error_handler)]

#[openbrush::contract]
pub mod my_psp22_pallet {
Expand Down
1 change: 0 additions & 1 deletion examples/psp22_pallet_extensions/burnable/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![cfg_attr(not(feature = "std"), no_std, no_main)]
#![feature(min_specialization)]
#![feature(default_alloc_error_handler)]

#[openbrush::contract]
pub mod my_psp22_pallet_burnable {
Expand Down
1 change: 0 additions & 1 deletion examples/psp22_pallet_extensions/metadata/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![cfg_attr(not(feature = "std"), no_std, no_main)]
#![feature(min_specialization)]
#![feature(default_alloc_error_handler)]

#[openbrush::contract]
pub mod my_psp22_pallet_metadata {
Expand Down
1 change: 0 additions & 1 deletion examples/psp22_pallet_extensions/mintable/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![cfg_attr(not(feature = "std"), no_std, no_main)]
#![feature(min_specialization)]
#![feature(default_alloc_error_handler)]

#[openbrush::contract]
pub mod my_psp22_pallet_mintable {
Expand Down
1 change: 0 additions & 1 deletion examples/timelock_controller/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![cfg_attr(not(feature = "std"), no_std, no_main)]
#![feature(min_specialization)]
#![feature(default_alloc_error_handler)]

#[openbrush::contract]
pub mod my_timelock_controller {
Expand Down

0 comments on commit bae858b

Please sign in to comment.