Skip to content

Commit

Permalink
Afloat setup permissions (#16)
Browse files Browse the repository at this point in the history
* 🔧 chore(types.rs): remove duplicate CreateAsset enum definition to improve code readability
✨ feat(types.rs): add InitialSetupArgs enum to handle initial setup arguments for asset creation and role assignment

* update format with rustfmt

* update format with rustfmt

* update format with rustfmt

* update format with rustfmt

* update format with rustfmt

* update format with rustfmt

* update format with rustfmt

* update format with rustfmt

* update format and change funtions for setup

* 🐛 fix(functions.rs): remove unused imports and commented out code to 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

* 🐛 fix(functions.rs): rename add_to_afloat_collection function to do_add_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

* 🔧 chore(settings.json): update editor.tabSize from 2 to 4 for consistent indentation

* 🔧 chore(pre-commit): add pre-commit hook to enforce code style using `cargo fmt` before committing
🐛 fix(afloat): remove unnecessary commented out code in pallet module

* 📝 docs(functions.rs): add documentation for `do_setup_roles` function in Afloat pallet to explain its inputs and purpose
🔥 refactor(lib.rs): remove unnecessary empty line in Afloat pallet module

* 🔧 chore(check.yml): add step to check Rust code formatting using rustfmt
🔧 chore(check.yml): add step to check Rust build using cargo check --release
  • Loading branch information
tlacloc authored Sep 27, 2023
1 parent a9f61c2 commit d806af2
Show file tree
Hide file tree
Showing 53 changed files with 28,678 additions and 27,410 deletions.
13 changes: 13 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

diff=$(cargo fmt -- --check)
result=$?

if [[ ${result} -ne 0 ]] ; then
cat <<\EOF
There are some code style issues, run `cargo fmt` first.
EOF
exit 1
fi

exit 0
6 changes: 6 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ jobs:
rustup update nightly
rustup update stable
rustup target add wasm32-unknown-unknown --toolchain nightly
- name: Check format
run: |
rustup component add rustfmt
cargo fmt --all -- --check
- name: Check Build
run: |
SKIP_WASM_BUILD=1 cargo check --release
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"Permill"
],
"task.allowAutomaticTasks": "on",
"editor.tabSize": 2,
"editor.tabSize": 4,
"editor.formatOnSave": true,
"github.gitProtocol": "ssh",
"[rust]": {
Expand Down
Loading

0 comments on commit d806af2

Please sign in to comment.