Skip to content

Commit

Permalink
Merge pull request #151 from taikoxyz/ga-fmt
Browse files Browse the repository at this point in the history
ga-fmt
  • Loading branch information
bennettyong authored Nov 4, 2024
2 parents 9989de6 + ebc7f89 commit c906c8c
Show file tree
Hide file tree
Showing 7 changed files with 143 additions and 40 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/go-fmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Go Fmt

on:
pull_request:
branches:
- main

jobs:
go-famt:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'

- name: Run gofmt
run: |
unformatted=$(gofmt -l .)
if [ -n "$unformatted" ]; then
echo "Unformatted files found:"
echo "$unformatted"
exit 1
else
echo "All Go files are properly formatted."
fi
22 changes: 11 additions & 11 deletions .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ on:
- main

jobs:
build:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'

- name: Install dependencies
run: go mod download
- name: Install dependencies
run: go mod download

- name: Run tests
run: go test ./...
- name: Run tests
run: go test ./...
34 changes: 34 additions & 0 deletions .github/workflows/json-fmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Check JSON Formatting

on:
pull_request:
branches:
- main

jobs:
json-fmt:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install jq
run: sudo apt-get install -y jq

- name: Find and check JSON formatting
run: |
unformatted_files=()
for file in $(find ./whitelist -name "*.json"); do
if [ "$(jq . "$file" | diff - "$file")" ]; then
unformatted_files+=("$file")
fi
done
if [ ${#unformatted_files[@]} -gt 0 ]; then
echo "The following JSON files are not formatted correctly:"
printf '%s\n' "${unformatted_files[@]}"
exit 1
else
echo "All JSON files are properly formatted."
fi
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ Create a pull request (PR) on GitHub to merge your changes into the main branch.

Wait for the PR to be reviewed by the maintainers. Once approved, your changes will be merged, and the new protocol will be added to the whitelist.


## Adding a new Adapter

### 1. Add your Project under `adapters/projects`
Expand Down
10 changes: 5 additions & 5 deletions adapters/projects/loopring/lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ func (indexer *LockIndexer) Index(ctx context.Context, logs ...types.Log) ([]ada
}

var depositWithDurationEvent struct {
From common.Address
To common.Address
Token common.Address
Amount *big.Int
Duration *big.Int
From common.Address
To common.Address
Token common.Address
Amount *big.Int
Duration *big.Int
}

loopringABI, err := abi.JSON(strings.NewReader(loopring.LoopringABI))
Expand Down
6 changes: 3 additions & 3 deletions cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ import (
"github.com/taikoxyz/trailblazer-adapters/adapters/projects/gaming"
"github.com/taikoxyz/trailblazer-adapters/adapters/projects/izumi"
"github.com/taikoxyz/trailblazer-adapters/adapters/projects/loopex"
"github.com/taikoxyz/trailblazer-adapters/adapters/projects/loopring"
"github.com/taikoxyz/trailblazer-adapters/adapters/projects/nfts2me"
"github.com/taikoxyz/trailblazer-adapters/adapters/projects/okx"
"github.com/taikoxyz/trailblazer-adapters/adapters/projects/omnihub"
"github.com/taikoxyz/trailblazer-adapters/adapters/projects/ritsu"
"github.com/taikoxyz/trailblazer-adapters/adapters/projects/symmetric"
"github.com/taikoxyz/trailblazer-adapters/adapters/projects/robinos"
"github.com/taikoxyz/trailblazer-adapters/adapters/projects/loopring"
"github.com/taikoxyz/trailblazer-adapters/adapters/projects/symmetric"
transactionsender "github.com/taikoxyz/trailblazer-adapters/adapters/transaction_sender"
)

Expand Down Expand Up @@ -182,7 +182,7 @@ func executeCommand(p prompt) error {
)
return processLog(ctx, client, indexer, p.Blocknumber)
case RobinosPrediction:
indexer := robinos.NewPredictionIndexer (
indexer := robinos.NewPredictionIndexer(
client,
[]common.Address{common.HexToAddress(robinos.RobinosAddress)},
robinos.SelectedMultiplierEvents,
Expand Down
80 changes: 60 additions & 20 deletions whitelist/protocols.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,43 @@
"slug": "nfts-2-me",
"twitter": "@NFTs2Me",
"logo": "nfts2me.png",
"contracts": ["0x00000000001594C61dD8a6804da9AB58eD2483ce"]
"contracts": [
"0x00000000001594C61dD8a6804da9AB58eD2483ce"
]
},
{
"name": "Magpie Protocol",
"slug": "magpie-protocol",
"twitter": "@magpieprotocol",
"logo": "magpie.svg",
"contracts": ["0x956df8424b556f0076e8abf5481605f5a791cc7f"]
"contracts": [
"0x956df8424b556f0076e8abf5481605f5a791cc7f"
]
},
{
"name": "Aspecta",
"slug": "aspecta",
"contracts": ["0x3636814Ab8d82854949d5794c428B8329115755D"]
"contracts": [
"0x3636814Ab8d82854949d5794c428B8329115755D"
]
},
{
"name": "DZap",
"slug": "dzap",
"logo": "dzap.png",
"twitter": "@dzap_io",
"contracts": ["0xF708e11A7C94abdE8f6217B13e6fE39C8b9cC0a6"]
"contracts": [
"0xF708e11A7C94abdE8f6217B13e6fE39C8b9cC0a6"
]
},
{
"name": "Eisen Finance",
"slug": "eisen",
"twitter": "@Eisenlabs",
"logo": "eisen.png",
"contracts": ["0xFA0e9251503DaE51670d10288e6962d63191731d"]
"contracts": [
"0xFA0e9251503DaE51670d10288e6962d63191731d"
]
},
{
"name": "Rubic",
Expand Down Expand Up @@ -189,7 +199,9 @@
"slug": "zns",
"twitter": "@ZNSConnect",
"logo": "zns.svg",
"contracts": ["0xFb2Cd41a8aeC89EFBb19575C6c48d872cE97A0A5"]
"contracts": [
"0xFb2Cd41a8aeC89EFBb19575C6c48d872cE97A0A5"
]
},
{
"name": "RubyScore",
Expand Down Expand Up @@ -234,7 +246,9 @@
"slug": "rhino-fi",
"twitter": "@RhinoFi",
"logo": "rhinofi.png",
"contracts": ["0x1Df2De291F909baA50C1456C87C71Edf9Fb199D5"]
"contracts": [
"0x1Df2De291F909baA50C1456C87C71Edf9Fb199D5"
]
},
{
"name": "DTX.TRADE",
Expand Down Expand Up @@ -288,7 +302,9 @@
"slug": "retrobridge",
"twitter": "@Retro_Bridge",
"logo": "retrobridge.jpg",
"contracts": ["0x009905bf008CcA637185EEaFE8F51BB56dD2ACa7"]
"contracts": [
"0x009905bf008CcA637185EEaFE8F51BB56dD2ACa7"
]
},
{
"name": "0xAstra",
Expand Down Expand Up @@ -386,7 +402,9 @@
"slug": "stupid-monkeys",
"twitter": "@StupidMonkeysRH",
"logo": "stupidmonkeys.png",
"contracts": ["0xCA99F9DbF4A13D4de05B41a68041dcE7929cb5e0"]
"contracts": [
"0xCA99F9DbF4A13D4de05B41a68041dcE7929cb5e0"
]
},
{
"name": "Owlto Finance",
Expand Down Expand Up @@ -445,7 +463,9 @@
"slug": "minibridge",
"twitter": "@Chaineye_tools",
"logo": "minibridge.jpeg",
"contracts": ["0x00000000000007736e2F9aA5630B8c812E1F3fc9"]
"contracts": [
"0x00000000000007736e2F9aA5630B8c812E1F3fc9"
]
},
{
"name": "Izumi Finance",
Expand Down Expand Up @@ -531,7 +551,9 @@
{
"name": "REVOX Lense",
"slug": "revox-lense",
"contracts": ["0x2c80179883217370F777e76c067Eea91D8283C5C"]
"contracts": [
"0x2c80179883217370F777e76c067Eea91D8283C5C"
]
},
{
"name": "Meridian Lend",
Expand Down Expand Up @@ -647,7 +669,9 @@
"slug": "robinos",
"twitter": "@RobinosPredict",
"logo": "robinos.svg",
"contracts": ["0x9EF9c57754eD079D750016b802DcCD45d0AB66f8"]
"contracts": [
"0x9EF9c57754eD079D750016b802DcCD45d0AB66f8"
]
},
{
"name": "TakoTako",
Expand All @@ -672,21 +696,27 @@
"slug": "1delta",
"twitter": "@1deltaDAO",
"logo": "1delta.svg",
"contracts": ["0x0bd7473CbBf81d9dD936c61117eD230d95006CA2"]
"contracts": [
"0x0bd7473CbBf81d9dD936c61117eD230d95006CA2"
]
},
{
"name": "OmniHub",
"slug": "omnihub",
"twitter": "@omni_hub",
"logo": "omnihub.jpg",
"contracts": ["0xb0B4B761C9e9Bf5A9194a42e944A4A6646B83919"]
"contracts": [
"0xb0B4B761C9e9Bf5A9194a42e944A4A6646B83919"
]
},
{
"name": "Chainspot",
"slug": "chainspot",
"twitter": "@ChainspotIO",
"logo": "chainspot.svg",
"contracts": ["0x3f96aF2AF6f644D5Fd1FC2d5A016CcE991198103"]
"contracts": [
"0x3f96aF2AF6f644D5Fd1FC2d5A016CcE991198103"
]
},
{
"name": "Panko",
Expand Down Expand Up @@ -747,7 +777,9 @@
"slug": "taikodrips",
"twitter": "@taikodrips",
"logo": "taikodrips.png",
"contracts": ["0xf90209C44dBf5Fa3d40ac85a008206b5A8c24899"]
"contracts": [
"0xf90209C44dBf5Fa3d40ac85a008206b5A8c24899"
]
},
{
"name": "CyberCrew DEATHMATCH",
Expand Down Expand Up @@ -796,14 +828,18 @@
"slug": "router",
"twitter": "@routerprotocol",
"logo": "router.svg",
"contracts": ["0x7BD616192fB2B364f9d29B2026165281a5f2ff2F"]
"contracts": [
"0x7BD616192fB2B364f9d29B2026165281a5f2ff2F"
]
},
{
"name": "NomisScore",
"slug": "nomis",
"twitter": "@0xNomis",
"logo": "nomis.svg",
"contracts": ["0x128B7290CdFA241E77337e0e42100bf6237a783C"]
"contracts": [
"0x128B7290CdFA241E77337e0e42100bf6237a783C"
]
},
{
"name": "21Blackjack",
Expand All @@ -818,7 +854,9 @@
"name": "EVMWarfare",
"slug": "evmwarfare",
"logo": "evmwarfare.png",
"contracts": ["0xA9E8e13BA0309486b2F710B8201B534D26633a89"]
"contracts": [
"0xA9E8e13BA0309486b2F710B8201B534D26633a89"
]
},
{
"name": "Swords & Dungeons",
Expand Down Expand Up @@ -847,7 +885,9 @@
"slug": "zyphernetwork",
"logo": "zyphergames.png",
"twitter": "@Zypher_Network",
"contracts": ["0xd4629d312CdC663D062F3Fbc322534A9Df0151bC"]
"contracts": [
"0xd4629d312CdC663D062F3Fbc322534A9Df0151bC"
]
},
{
"name": "IceCreamSwap",
Expand Down

0 comments on commit c906c8c

Please sign in to comment.