Skip to content

Commit d806af2

Browse files
authored
Afloat setup permissions (#16)
* 🔧 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
1 parent a9f61c2 commit d806af2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+28678
-27410
lines changed

.githooks/pre-commit

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
diff=$(cargo fmt -- --check)
4+
result=$?
5+
6+
if [[ ${result} -ne 0 ]] ; then
7+
cat <<\EOF
8+
There are some code style issues, run `cargo fmt` first.
9+
EOF
10+
exit 1
11+
fi
12+
13+
exit 0

.github/workflows/check.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ jobs:
3636
rustup update nightly
3737
rustup update stable
3838
rustup target add wasm32-unknown-unknown --toolchain nightly
39+
40+
- name: Check format
41+
run: |
42+
rustup component add rustfmt
43+
cargo fmt --all -- --check
44+
3945
- name: Check Build
4046
run: |
4147
SKIP_WASM_BUILD=1 cargo check --release

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"Permill"
77
],
88
"task.allowAutomaticTasks": "on",
9-
"editor.tabSize": 2,
9+
"editor.tabSize": 4,
1010
"editor.formatOnSave": true,
1111
"github.gitProtocol": "ssh",
1212
"[rust]": {

0 commit comments

Comments
 (0)