Conversation
12a7abb to
8f80758
Compare
gaetbout
reviewed
Dec 11, 2023
src/core/timelock.cairo
Outdated
Comment on lines
+47
to
+54
| use core::traits::Into; | ||
| use core::zeroable::Zeroable; | ||
| use core::array::ArrayTrait; | ||
| use core::starknet::event::EventEmitter; | ||
| use core::option::OptionTrait; | ||
| use core::serde::Serde; | ||
| use core::traits::TryInto; | ||
| use core::box::BoxTrait; |
There was a problem hiding this comment.
Think you can safely remove all the core imports, those are in the prelude (there are few a bit further too)
Contributor
Author
There was a problem hiding this comment.
Done ! Some core import still needed for hash functionnality.
src/utils/hash.cairo
Outdated
| @@ -0,0 +1,25 @@ | |||
| use hash::{LegacyHash, HashStateTrait, HashStateExTrait}; | |||
src/utils/hash.cairo
Outdated
Comment on lines
+10
to
+12
| let mut call_data_state = LegacyHash::hash(0, *self); | ||
| call_data_state = LegacyHash::hash(call_data_state, (*self).len()); | ||
| call_data_state |
There was a problem hiding this comment.
Better using:
PedersenTrait::new(0);
state = state.update_with(x);
state = state.update_with(y);
state.finalize()062ca69 to
0b63cda
Compare
gaetbout
approved these changes
Jan 3, 2024
src/core/timelock.cairo
Outdated
Comment on lines
+86
to
+88
| old_admin: ContractAddress, | ||
| #[key] | ||
| new_admin: ContractAddress |
There was a problem hiding this comment.
Suggested change
| old_admin: ContractAddress, | |
| #[key] | |
| new_admin: ContractAddress | |
| #[key] | |
| new_admin: ContractAddress | |
| old_admin: ContractAddress, |
| impl InternalFunctions of InternalFunctionsTrait { | ||
| fn _is_valid_delay(_delay: u256) {} | ||
| fn _admin_only() {} | ||
| fn is_valid_delay(self: @ContractState, delay: u256) { |
There was a problem hiding this comment.
This could be inlined, but no big deal
Contributor
Author
There was a problem hiding this comment.
Done for is_valid_delay and admin_only
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request type
Please add the labels corresponding to the type of changes your PR introduces:
What is the current behavior?
Implement timelock
Resolves: #6
What is the new behavior?
Does this introduce a breaking change?
No
Other information