-
Notifications
You must be signed in to change notification settings - Fork 0
Afloat setup permissions #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…prove code readability ✨ feat(types.rs): add InitialSetupArgs enum to handle initial setup arguments for asset creation and role assignment
…improve code cleanliness and readability ✨ feat(functions.rs): rename `do_setup_asset` function to `do_create_afloat_asset` for better naming consistency and clarity ✨ feat(lib.rs): refactor `InitialSetupArgs::All` match arm to call necessary setup functions in the correct order for initializing afloat pallet
…dd_account_to_afloat_frunique for better clarity and consistency 🐛 fix(lib.rs): rename add_to_afloat_collection function to do_add_account_to_afloat_frunique for better clarity and consistency
…`cargo fmt` before committing 🐛 fix(afloat): remove unnecessary commented out code in pallet module
… in Afloat pallet to explain its inputs and purpose 🔥 refactor(lib.rs): remove unnecessary empty line in Afloat pallet module
| @@ -0,0 +1,13 @@ | |||
| #!/bin/bash | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "Drawdowns", | ||
| "Frunique", | ||
| "fruniques", | ||
| "Permill" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @@ -1,894 +1,985 @@ | |||
| use super::*; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
|
||
| mod functions; | ||
| pub mod types; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @@ -1,13 +1,13 @@ | |||
| use crate as pallet_afloat; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| use super::*; | ||
| use crate::{mock::*, types::*, Error}; | ||
| use frame_support::{assert_noop, assert_ok, traits::Currency, BoundedVec}; | ||
| use frame_system::RawOrigin; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @@ -1,6 +1,5 @@ | |||
| use super::*; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @@ -1,18 +1,19 @@ | |||
| use super::*; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GPT summary of 0a814a - a963f9:
- Removed unnecessary imports and added imports for lite-json and sp_runtime
- Added a new function
do_remove_proofto remove a proof of reserves - Added a new function
get_pending_vaultsto get vaults with pending descriptors - Added a new function
get_pending_proposalsto get proposals with pending PSBTs - Added a new function
get_finalizable_proposalsto get proposals that can be finalized - Added a new function
do_insert_descriptorsto insert vault descriptors - Added a new function
do_insert_proposalto insert a proposal - Added a new function
do_finalize_proposalto finalize a proposal - Added a new function
bdk_gen_finalized_proposalto generate a finalized proposal - Added a new function
parse_vault_descriptorsto parse vault descriptors - Added a new function
http_postto make HTTP POST requests - Added a new function
build_offchain_errto build an offchain error - Implemented BlockNumberProvider trait
| #[frame_support::pallet] | ||
| pub mod pallet { | ||
| use frame_support::pallet_prelude::*; | ||
| //#[cfg(feature = "std")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @@ -1,20 +1,22 @@ | |||
| use crate as pallet_bitcoin_vaults; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @@ -1,22 +1,21 @@ | |||
| use super::*; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @@ -1,6 +1,5 @@ | |||
| use super::*; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| #[pallet::constant] | ||
| type MaxMemberGroups: Get<u32>; | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| assert_ok!(ConfidentialDocs::update_shared_document_metadata( | ||
| RuntimeOrigin::signed(to), | ||
| shared_doc1.clone() | ||
| )); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GPT summary of 8ed742 - 6e4c07:
- Updated the
update_shared_document_metadata_works()test to remove a line - Updated the
remove_group_member_works_for_admin_removing_member_he_added()test to add a line and update an existing line - Added a new test
remove_group_member_should_fail_for_trying_to_remove_owner() - Updated the
remove_group_member_should_fail_for_role_member_as_authorizer()test - Updated the
remove_group_member_should_fail_for_admin_removing_member_he_did_not_add()test to remove a line
| pub fn can_add_group_member(&self) -> bool { | ||
| self.role == GroupRole::Admin || self.role == GroupRole::Owner | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
|
||
| mod functions; | ||
| pub mod types; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| use crate as pallet_fruniques; | ||
| use frame_support::{construct_runtime, parameter_types, traits::AsEnsureOriginWithArg}; | ||
| use frame_system::{EnsureRoot, EnsureSigned}; | ||
| use pallet_balances; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // ($( $x:tt )*) => { | ||
| // vec![$( $x )*].try_into().unwrap() | ||
| // } | ||
| // } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| pub type Percentage = u16; | ||
|
|
||
| #[derive(Encode, Decode, RuntimeDebugNoBound, Default, TypeInfo, MaxEncodedLen)] | ||
| #[scale_info(skip_type_params(T))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
GPT summary of ec717fc: Error: couldn't generate summary |
|
GPT summary of 04d6062: Error: couldn't generate summary |
|
GPT summary of 48a7d51: Error: couldn't generate summary |
|
GPT summary of 47e772c: Error: couldn't generate summary |
|
GPT summary of c32c0dc: Error: couldn't generate summary |
|
GPT summary of 2dbc165:
|
|
GPT summary of 1f7fd19: Error: couldn't generate summary |
|
GPT summary of 83b7b5a: Error: couldn't generate summary |
|
GPT summary of 1670518: Error: couldn't generate summary |
|
GPT summary of dee30ef:
|
|
GPT summary of 960f859:
|
|
GPT summary of a716dd9:
|
|
GPT summary of 9e88a8d:
|
|
GPT summary of 9b9f146:
PR summary so far:
|
🔧 chore(check.yml): add step to check Rust build using cargo check --release
| curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
| source ~/.cargo/env | ||
| rustup default stable | ||
| rustup update nightly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| }: _(RawOrigin::Signed(caller), s) | ||
| verify { | ||
| assert_eq!(Something::<T>::get(), Some(s)); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @@ -1,64 +1,55 @@ | |||
| use super::*; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GPT summary of 852ac5 - 716176:
- Added a function
do_add_recordto add records to the storage - Validated the inputs of the function to check if the project ID and hashed info are not empty
- Generated a unique record ID based on the inputs
- Inserted the record into the storage
- Emitted an event to notify that a record was added
|
|
||
| mod functions; | ||
| mod types; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GPT summary of c6aced - 7a20e4:
- Changed
use frame_support::pallet_prelude::*;touse frame_support::{pallet_prelude::*, traits::Time}; - Removed
use frame_support::traits::Time; - Added
MaxRecordsAtTimeconstant - Added
SignerAccountstorage - Added
Recordsstorage - Added
RecordAddedevent - Added
MaxRegistrationsAtATimeReachederror - Added
set_signer_accountextrinsic - Added
add_recordextrinsic - Added
kill_storageextrinsic
| type Timestamp = Timestamp; | ||
| type RemoveOrigin = EnsureRoot<Self::AccountId>; | ||
| type Moment = u64; | ||
| type MaxRecordsAtTime = MaxRecordsAtTime; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| use crate::{mock::*, types::*, Records, Error}; | ||
| use frame_support::{assert_ok, assert_noop, bounded_vec}; | ||
|
|
||
| use crate::{mock::*, types::*, Error, Records}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| use frame_support::pallet_prelude::*; | ||
|
|
||
| pub type HashedInfo = BoundedVec<u8, ConstU32<400>>; | ||
| pub type Id = [u8; 32]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| //! Various pieces of common functionality. | ||
| use super::*; | ||
|
|
||
| const LOG_TARGET: &str = "\nFund Admin pallet migration "; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
GPT summary of 62494a9:
PR summary so far:
|
Uh oh!
There was an error while loading. Please reload this page.