-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add auction bot module #70
Merged
+3,902
−1,239
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
93f98f6
feat: wip: intermediate dependency update
boodyvo d7ebfca
feat: wip: intermediate dependency update
boodyvo 5e5f3e5
feat: wip: intermediate dependency update
boodyvo 8c463e1
feat: wip: intermediate dependency update
boodyvo 4d210d6
feat: update CI to with test, build and vet
boodyvo 17e2ed3
feat: update CI to with test, build and vet
boodyvo 3ba37bc
feat: update makefile
boodyvo b7c277f
feat: update deps for signer
boodyvo 358038c
feat: update deps for signer
boodyvo 2078da6
feat: update deps for signer
boodyvo 8264574
feat: update logger dep in spammer
boodyvo 338243b
feat: moved back grpc
boodyvo d25084f
feat: add integration test to the signing
boodyvo 10088b4
feat: add updates for ci command and replace dependency for auction bot
boodyvo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
get_block_number() { | ||
local BLOCK_NUMBER=$(curl -sS -X POST \ | ||
--data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \ | ||
-H "Content-Type: application/json" \ | ||
http://localhost:8545 | jq .result) | ||
echo $BLOCK_NUMBER | ||
} | ||
|
||
BLOCK_NUMBER=$(get_block_number) | ||
|
||
while [ "$BLOCK_NUMBER" == "" ] | ||
do | ||
BLOCK_NUMBER=$(get_block_number) | ||
sleep 0.5 | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: '1.21' | ||
|
||
- name: Cache Go Modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
|
||
- name: Build | ||
run: make build-all | ||
|
||
- name: Vet | ||
run: make vet | ||
|
||
- name: Test | ||
run: make test | ||
|
||
lint: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: '1.21' | ||
|
||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v6 | ||
with: | ||
args: --timeout=10m | ||
|
||
integration-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout go-tools-kava | ||
uses: actions/checkout@v4 | ||
with: | ||
path: go-tools | ||
|
||
# TODO(yevhenii): consider reusing already built kava docker image instead of rebuilding it | ||
- name: Checkout kava | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: Kava-Labs/kava | ||
ref: ${{ github.event.client_payload.ref }} | ||
path: kava | ||
submodules: 'true' | ||
|
||
- name: Print kava version | ||
run: | | ||
git branch | ||
git rev-parse HEAD | ||
working-directory: ./kava | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: go-tools/go.mod | ||
|
||
- name: Cache Go Modules | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('./rosetta-kava/**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
|
||
- name: Build kava docker image | ||
run: make docker-build | ||
working-directory: ./kava | ||
|
||
- name: Install kvtool | ||
run: make install | ||
working-directory: ./kava/tests/e2e/kvtool | ||
|
||
- name: Run kava docker container | ||
run: KAVA_TAG=local kvtool t bootstrap | ||
|
||
- name: Wait until kava node is ready to serve traffic | ||
run: bash ${GITHUB_WORKSPACE}/go-tools/.github/scripts/wait-for-node-init.sh | ||
|
||
- name: Run integration tests | ||
run: make test-integration | ||
working-directory: ./go-tools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Define the base directory (default is current directory) | ||
BASEDIR := $(shell pwd) | ||
|
||
# Find all directories containing a main.go file | ||
MODULES := $(shell find . -type f -name 'main.go' -not -path "*/vendor/*" -exec dirname {} \;) | ||
|
||
# output the list of modules | ||
.PHONY: modules | ||
modules: | ||
@echo $(MODULES) | ||
|
||
# Default target: build all modules | ||
.PHONY: build-all | ||
build-all: | ||
@for dir in $(MODULES); do \ | ||
echo "Building module in $$dir..."; \ | ||
if ! (cd $$dir && go build -o $(BASEDIR)/$$(basename $$dir)/$$(basename $$dir)); then \ | ||
echo "Failed to build $$dir"; \ | ||
exit 1; \ | ||
fi; \ | ||
echo "Built module $$dir successfully."; \ | ||
done | ||
|
||
.PHONY: golangci-lint | ||
golangci-lint: | ||
golangci-lint run | ||
|
||
.PHONY: vet | ||
vet: | ||
go vet ./... | ||
|
||
.PHONY: test | ||
test: | ||
go test -v ./... | ||
|
||
.PHONY: test-integration | ||
test-integration: | ||
cd signing/testing && go test -v -tags=integration -count=1 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be moved to the signing specific Makefile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it make sense. If we will extend integration test to other modules it's easier to run one integration test for all of them with just
make test-integration
, than running it directory b directory, so would prefer to keep one common make command in the root