Skip to content

Commit

Permalink
move contract dev scripts to dev/contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
fbac committed Dec 20, 2024
1 parent 695aafd commit 9b178c9
Show file tree
Hide file tree
Showing 11 changed files with 3,325 additions and 62 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
*.so
*.dylib

# delve debugger
__debug_*

# build folder
build/
bin/
Expand Down
8 changes: 4 additions & 4 deletions contracts/script/output/31337/GroupMessages.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"addresses": {
"groupMessagesDeployer": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"groupMessagesImpl": "0xc0F115A19107322cFBf1cDBC7ea011C19EbDB4F8",
"groupMessagesProxy": "0xc96304e3c037f81dA488ed9dEa1D8F2a48278a75",
"groupMessagesImpl": "0xB0f05d25e41FbC2b52013099ED9616f1206Ae21B",
"groupMessagesProxy": "0x5FeaeBfB4439F3516c74939A9D04e95AFE82C4ae",
"groupMessagesProxyAdmin": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
},
"deploymentBlock": 107,
"latestUpgradeBlock": 107
"deploymentBlock": 43,
"latestUpgradeBlock": 43
}
8 changes: 4 additions & 4 deletions contracts/script/output/31337/IdentityUpdates.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"addresses": {
"identityUpdatesDeployer": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"identityUpdatesImpl": "0x34B40BA116d5Dec75548a9e9A8f15411461E8c70",
"identityUpdatesProxy": "0xD0141E899a65C95a556fE2B27e5982A6DE7fDD7A",
"identityUpdatesImpl": "0x976fcd02f7C4773dd89C309fBF55D5923B4c98a1",
"identityUpdatesProxy": "0x19cEcCd6942ad38562Ee10bAfd44776ceB67e923",
"identityUpdatesProxyAdmin": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
},
"deploymentBlock": 109,
"latestUpgradeBlock": 109
"deploymentBlock": 45,
"latestUpgradeBlock": 45
}
20 changes: 0 additions & 20 deletions dev/abigen

This file was deleted.

25 changes: 25 additions & 0 deletions dev/contracts/generate
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

set -e

PACKAGE_NAME="abis"
BUILD_DIR="build"
OUTPUT_DIR="pkg/abis"

mkdir -p ./build
rm -f ./build/*.abi.json
rm -f ./pkg/abis/*.go

function generate_bindings() {
cd contracts
forge inspect ./src/${1}.sol:${1} abi > ../${BUILD_DIR}/${1}.abi.json
forge inspect ./src/${1}.sol:${1} bytecode > ../${BUILD_DIR}/${1}.bin.json

cd ..
abigen --abi ./${BUILD_DIR}/${1}.abi.json --bin ./${BUILD_DIR}/${1}.bin.json --pkg "${PACKAGE_NAME}" --type "${1}" --out "./${OUTPUT_DIR}/${1}.go" > /dev/null 2>&1

}

for contract in Nodes GroupMessages IdentityUpdates; do
generate_bindings $contract
done
2 changes: 1 addition & 1 deletion dev/generate
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ set -euo pipefail
sqlc generate
go generate ./...
rm -rf pkg/mocks/*
./dev/abigen
./dev/contracts/generate
mockery
3 changes: 3 additions & 0 deletions dev/up
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ if ! which abigen &>/dev/null; then go install github.com/ethereum/go-ethereum/c
if ! which jq &>/dev/null; then brew install jq; fi

dev/docker/up

# Make sure the abis are updated
dev/contracts/generate
dev/contracts/deploy-local

echo "Registering local node-1"
Expand Down
1,677 changes: 1,646 additions & 31 deletions pkg/abis/groupMessages.go

Large diffs are not rendered by default.

1,617 changes: 1,616 additions & 1 deletion pkg/abis/identityUpdates.go

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions pkg/abis/nodes.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/indexer/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func TestStoreMessages(t *testing.T) {
publisher := messagePublisher(t, ctx)
defer cleanup()

message := testutils.RandomBytes(32)
message := testutils.RandomBytes(78)
groupID := testutils.RandomGroupID()
topic := topic.NewTopic(topic.TOPIC_KIND_GROUP_MESSAGES_V1, groupID[:]).Bytes()

Expand Down

0 comments on commit 9b178c9

Please sign in to comment.