Skip to content

Commit

Permalink
Reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
atodorov committed Apr 4, 2024
1 parent b1ca2bf commit a99e246
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 30 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/crunch-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
push:
branches:
- 'release/*'
- "release/*"

permissions: read-all

Expand Down Expand Up @@ -76,15 +76,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
-
name: Set up QEMU
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

-
name: Login to Docker Hub
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ jobs:
- name: Prepare commit
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/dev' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository)
run: |
sudo chown -Rc $UID .git/
git diff
sudo chown -Rc $UID .git/
git diff
- name: Commit and push applied linter fixes
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/dev' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository)
Expand Down
6 changes: 1 addition & 5 deletions .jscpd.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
{
"ignore": [
"src/crunch.rs",
"src/config.rs",
".github/workflows/*.yml"
]
"ignore": ["src/crunch.rs", "src/config.rs", ".github/workflows/*.yml"]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ subxt metadata --version 14 -f bytes > metadata/creditcoin_metadata.scale

Or use the handy `gen_metadata.sh` script.

## How to update docker image when metadata changes.
## How to update docker image when metadata changes

Create a new branch. Run a local version of your node with the updated runtime and run the
`gen_metadata.sh` script. Move that metadata to the `metadata` folder and check that the binary
Expand Down
19 changes: 9 additions & 10 deletions gen_metadata.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,23 @@ CURL_PARAMS="-H 'Content-Type: application/json' -d '{\"id\":\"1\", \"jsonrpc\":
COUNTER=0
# make sure there is a node running at TARGET_URL
while [[ "$(eval curl -s -o /dev/null -w '%{http_code}' "$CURL_PARAMS")" != "200" && $COUNTER -lt 10 ]]; do
echo "ATTEMPT: $COUNTER - Not ready yet ....."
(( COUNTER=COUNTER+1 ))
sleep 2
echo "ATTEMPT: $COUNTER - Not ready yet ....."
((COUNTER = COUNTER + 1))
sleep 2
done

# fail if we still can't connect after 10 attempts
set -e

# Note: using eval b/c params are specified as string above
eval curl "$CURL_PARAMS" > /dev/null
eval curl "$CURL_PARAMS" >/dev/null

subxt metadata --url "$TARGET_URL" --version "$TARGET_VERSION" -f bytes > "$TARGET_DEST"
subxt metadata --url "$TARGET_URL" --version "$TARGET_VERSION" -f bytes >"$TARGET_DEST"

# Check for the target file and sound the alarm if its not found
if [ -e "$TARGET_DEST" ]
then
echo "$TARGET_DEST generated successfully"
if [ -e "$TARGET_DEST" ]; then
echo "$TARGET_DEST generated successfully"
else
echo "$TARGET_DEST not found" >&2
exit 1
echo "$TARGET_DEST not found" >&2
exit 1
fi
10 changes: 5 additions & 5 deletions src/runtimes/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Supported Runtimes
- Polkadot
- Kusama
- Westend
- Aleph Zero testnet
- Aleph Zero mainnet
- Polkadot
- Kusama
- Westend
- Aleph Zero testnet
- Aleph Zero mainnet

TODO: Improve the runtimes implementation without the need of replicating the same functions for each runtime. Note that *RuntimeApi* is runtime specific. It gives access to api functions specific for each runtime.

Expand Down

0 comments on commit a99e246

Please sign in to comment.