Skip to content

Conversation

@ermalkaleci
Copy link
Member

Closes #602

@codecov-commenter
Copy link

codecov-commenter commented Sep 9, 2021

Codecov Report

Merging #603 (881a4ca) into master (59df1df) will increase coverage by 0.27%.
The diff coverage is 86.04%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #603      +/-   ##
==========================================
+ Coverage   75.58%   75.86%   +0.27%     
==========================================
  Files          76       76              
  Lines        5955     6123     +168     
==========================================
+ Hits         4501     4645     +144     
- Misses       1454     1478      +24     
Impacted Files Coverage Δ
authority/src/weights.rs 3.03% <0.00%> (-1.52%) ⬇️
authority/src/lib.rs 89.00% <96.87%> (+3.70%) ⬆️
authority/src/tests.rs 100.00% <100.00%> (ø)
currencies/src/mock.rs 81.81% <0.00%> (-3.90%) ⬇️
xtokens/src/mock/para.rs 59.37% <0.00%> (-1.92%) ⬇️
tokens/src/mock.rs 26.38% <0.00%> (-0.38%) ⬇️
tokens/src/lib.rs 86.08% <0.00%> (-0.06%) ⬇️
tokens/src/tests.rs 100.00% <0.00%> (ø)
tokens/src/weights.rs 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 59df1df...881a4ca. Read the comment docs.

Copy link
Member

@xlc xlc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just need a way to cancel saved call and should be good

@ermalkaleci ermalkaleci marked this pull request as ready for review September 10, 2021 13:40
Copy link
Member

@xlc xlc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need benchmarking & weights and should be good.

@open-web3-stack open-web3-stack deleted a comment from ermalkaleci Sep 14, 2021
if let Some(caller) = maybe_caller {
ensure!(who == caller, Error::<T>::TriggerCallNotPermitted);
}
let result = call.dispatch(OriginFor::<T>::root());
Copy link
Contributor

@apopiak apopiak Sep 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you skip weighing the call
you'll probably want to pass a weight as param and then ensure that the executed call has lower or equal weight to it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you skip weighing the call
you'll probably want to pass a weight as param and then ensure that the executed call has lower or equal weight to it

pushed an update to handle call post_info

@ermalkaleci ermalkaleci requested a review from xlc September 14, 2021 17:21
})
}

#[pallet::weight(T::WeightInfo::trigger_call())]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to include the weight of the call. Add new #[pallet::compact] weight_bound: Weight and add it to the weight, and then ensure the call weight is lte the weight bound.
Something similar to this
https://github.com/paritytech/substrate/blob/ce1746ddf6588c8f9ecfb77411c3cac7a2c09db3/frame/collective/src/lib.rs#L662

@ermalkaleci ermalkaleci requested a review from xlc September 15, 2021 06:25
@xlc xlc merged commit d0f9033 into master Sep 15, 2021
@xlc xlc deleted the saved_calls branch September 15, 2021 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

orml-authority: authorize_root_call

5 participants