Skip to content

Commit

Permalink
fix: Add boba token addr to generated .env; print more info in hc-check.
Browse files Browse the repository at this point in the history
 Changes to be committed:
	modified:   hybrid-compute/aa-hc-check.sh
	modified:   hybrid-compute/deploy-local.py
  • Loading branch information
mmontour1306 committed Dec 10, 2024
1 parent 4a7c2fd commit 171c8f3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
22 changes: 19 additions & 3 deletions hybrid-compute/aa-hc-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,33 @@
set -e

echo "Using environment variables:"
echo "BOBA_TOKEN=$BOBA_TOKEN"
echo "DEPLOY_ADDR=$DEPLOY_ADDR"
echo "CLIENT_ADDR=$CLIENT_ADDR"
echo "NODE_HTTP=$NODE_HTTP"
echo "HC_HELPER_ADDR=$HC_HELPER_ADDR"
echo "OC_HYBRID_ACCOUNT=$OC_HYBRID_ACCOUNT"
echo "TEST_HYBRID=$TEST_HYBRID"

echo "Checking Client account"
echo "\n***Checking Client account***"
echo -n "Owner: "
cast call --rpc-url=$NODE_HTTP $CLIENT_ADDR "owner()"
echo -n "Balance: "
echo -n "ETH Balance: "
cast balance -e --rpc-url=$NODE_HTTP $CLIENT_ADDR
echo -n "BOBA Balance (wei): "
cast call --rpc-url=$NODE_HTTP $BOBA_TOKEN "balanceOf(address)" $CLIENT_ADDR
echo -n "EntryPoint: "
cast call --rpc-url=$NODE_HTTP $CLIENT_ADDR "entryPoint()"

echo "\n*** Checking HCHelper ***"
echo -n "Owner: "
cast call --rpc-url=$NODE_HTTP $HC_HELPER_ADDR "owner()"
echo -n "ETH Balance: "
cast balance -e --rpc-url=$NODE_HTTP $HC_HELPER_ADDR
echo -n "BOBA Balance (wei): "
cast call --rpc-url=$NODE_HTTP $BOBA_TOKEN "balanceOf(address)" $HC_HELPER_ADDR
echo -n "Price per credit (wei): "
cast call --rpc-url=$NODE_HTTP $HC_HELPER_ADDR "pricePerCall()"

echo "HybridAccount Registration (owner / URL / credits): "
REG=`cast call --rpc-url=$NODE_HTTP $HC_HELPER_ADDR "RegisteredCallers(address)" \
Expand Down Expand Up @@ -49,7 +58,14 @@ cast call --rpc-url=$NODE_HTTP $HC_HELPER_ADDR \
|| true

echo "\n*** Checking HybridAccount ***"

echo -n "Owner: "
cast call --rpc-url=$NODE_HTTP $OC_HYBRID_ACCOUNT "owner()"
echo -n "ETH Balance: "
cast balance -e --rpc-url=$NODE_HTTP $OC_HYBRID_ACCOUNT
echo -n "BOBA Balance (wei): "
cast call --rpc-url=$NODE_HTTP $BOBA_TOKEN "balanceOf(address)" $OC_HYBRID_ACCOUNT
echo -n "EntryPoint: "
cast call --rpc-url=$NODE_HTTP $OC_HYBRID_ACCOUNT "entryPoint()"
echo -n "Should be Permission denied: "
cast call --rpc-url=$NODE_HTTP $OC_HYBRID_ACCOUNT \
--from $DEPLOY_ADDR \
Expand Down
3 changes: 3 additions & 0 deletions hybrid-compute/deploy-local.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,9 @@ def boba_balance(addr):
env_vars['TEST_KYC'] = KYC.address
env_vars['TEST_TOKEN_PRICE'] = TEST_TOKEN_PRICE.address

# Other
env_vars['BOBA_TOKEN'] = boba_token

with open(".env", "w", encoding="ascii") as f:
for k in env_vars.items():
f.write(f"{k[0]}={k[1]}\n")

0 comments on commit 171c8f3

Please sign in to comment.