Skip to content

Commit

Permalink
Event listener for Messenger Contracts (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
havan authored and evlekht committed Sep 29, 2024
1 parent c45fad8 commit f882b3e
Show file tree
Hide file tree
Showing 12 changed files with 902 additions and 84 deletions.
39 changes: 23 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name: CI

on:
pull_request:
tags-ignore: ["*"]
branches: [c4t, dev]
push:
branches: [c4t, dev]
workflow_dispatch:

Expand All @@ -14,47 +11,58 @@ concurrency:
cancel-in-progress: true

env:
go_version: '~1.20.12'
go_version: "~1.23.1"

permissions:
# Required: allow read access to the content for analysis.
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
pull-requests: read
# Optional: allow write access to checks to allow the action to annotate code in the PR.
checks: write

jobs:
unit:
name: Unit Tests
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Update dependencies
run: git submodule update --init
- uses: actions/setup-go@v3
- uses: actions/setup-go@v5
with:
go-version: ${{ env.go_version }}
- name: Install libolm
run: sudo apt update && sudo apt-get install -y libolm-dev
- name: build_test
shell: bash
run: ./scripts/build_test.sh
# When the golangci-lint version is updated here, also update it in scripts/lint.sh
lint:
name: Static Analysis
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Update dependencies
run: git submodule update --init
- uses: actions/setup-go@v3
with:
go-version: ${{ env.go_version }}
- name: Install libolm
run: sudo apt update && sudo apt-get install -y libolm-dev
- name: GolangCI-Lint
shell: bash
run: ./scripts/lint.sh
- uses: actions/setup-go@v5
with:
go-version: ${{ env.go_version }}
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.60
only-new-issues: true
go_mod_tidy:
name: Check state of go.mod and go.sum
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Update dependencies
run: git submodule update --init
- uses: actions/setup-go@v3
- uses: actions/setup-go@v5
with:
go-version: ${{ env.go_version }}
- name: Go Mod Tidy
Expand All @@ -63,4 +71,3 @@ jobs:
- name: Check Clean Branch
shell: bash
run: .github/workflows/check-clean-branch.sh

15 changes: 7 additions & 8 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@

# https://golangci-lint.run/usage/configuration/
run:
skip-dirs:
- camino-matrix-go
timeout: 5m

issues:
# Maximum count of issues with the same text. Set to 0 to disable. Default: 3.
max-same-issues: 0
exclude-dirs: camino-matrix-go

linters:
disable-all: true
enable:
- asciicheck
- bodyclose
# - cyclop TODO enable
# - cyclop TODO enable
- depguard
- dupl
- errcheck
- errorlint
- exportloopref
- copyloopvar
- goconst
- gocritic
- gofmt
Expand Down Expand Up @@ -52,6 +54,3 @@ linters-settings:
desc: github.com/stretchr/testify/require should be used instead.
- pkg: "github.com/golang/mock/gomock"
desc: go.uber.org/mock/gomock should be used instead.
issues:
# Maximum count of issues with the same text. Set to 0 to disable. Default: 3.
max-same-issues: 0
2 changes: 1 addition & 1 deletion camino-messenger-bot-distributor.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ supported_request_types:
evm_private_key: PrivateKey-YOUR_PRIVATE_KEY

# C-Chain RPC URL
rpc_url: https://columbus.camino.network/ext/bc/C/rpc
rpc_url: wss://columbus.camino.network/ext/bc/C/ws

### Booking Token

Expand Down
2 changes: 1 addition & 1 deletion camino-messenger-bot-supplier.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ supported_request_types:
evm_private_key: PrivateKey-YOUR_PRIVATE_KEY

# C-Chain RPC URL
rpc_url: https://columbus.camino.network/ext/bc/C/rpc
rpc_url: wss://columbus.camino.network/ext/bc/C/ws

### Booking Token

Expand Down
Loading

0 comments on commit f882b3e

Please sign in to comment.