Skip to content

Commit

Permalink
Pre commit hooks (#670)
Browse files Browse the repository at this point in the history
  • Loading branch information
kongzii authored Feb 5, 2025
1 parent f43be5b commit 0c66b91
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/python_ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,10 @@ jobs:
run: |
poetry run isort --profile black .
git diff --exit-code --quiet || exit 1
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/python_prepare
- uses: pre-commit/[email protected]
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
repos:
- repo: https://github.com/kongzii/pre-commit-hooks
rev: peter/web3
hooks:
- id: detect-private-key
- id: check-added-large-files
args: ['--maxkb=5000']
- id: detect-web3-private-key
exclude: 'poetry.lock'
13 changes: 13 additions & 0 deletions install_hooks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

# Install pre-commit if not already installed
if ! command -v pre-commit &> /dev/null
then
echo "pre-commit is not installed. Installing now..."
brew install pre-commit
fi

# Install the hooks
pre-commit install

echo "Pre-commit hooks installed successfully."
6 changes: 3 additions & 3 deletions tests/agents/microchain/test_messages_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ def account2_address() -> ChecksumAddress:
def account2_private_key() -> SecretStr:
"Anvil test account private key. It's public already."
return SecretStr(
"0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d"
"0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d" # web3-private-key-ok
)


# Random transactions found on Gnosisscan.
MOCK_HASH_1 = "0x5ba6dd51d3660f98f02683e032daa35644d3f7f975975da3c2628a5b4b1f5cb6"
MOCK_HASH_2 = "0x429f61ea3e1afdd104fdd0a6f3b88432ec4c7b298fd126378e53a63bc60fed6a"
MOCK_HASH_1 = "0x5ba6dd51d3660f98f02683e032daa35644d3f7f975975da3c2628a5b4b1f5cb6" # web3-private-key-ok
MOCK_HASH_2 = "0x429f61ea3e1afdd104fdd0a6f3b88432ec4c7b298fd126378e53a63bc60fed6a" # web3-private-key-ok
MOCK_SENDER = Web3.to_checksum_address(
"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
) # anvil account 1
Expand Down

0 comments on commit 0c66b91

Please sign in to comment.