Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryQW committed Apr 17, 2024
1 parent a4b0227 commit 5cc4d98
Show file tree
Hide file tree
Showing 22 changed files with 662 additions and 652 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ require (

require (
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/dmarkham/enumer v1.5.9 // indirect
github.com/holiman/uint256 v1.2.4 // indirect
github.com/labstack/gommon v0.4.2 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
Expand Down
8 changes: 8 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dmarkham/enumer v1.5.9 h1:NM/1ma/AUNieHZg74w67GkHFBNB15muOt3sj486QVZk=
github.com/dmarkham/enumer v1.5.9/go.mod h1:e4VILe2b1nYK3JKJpRmNdl5xbDQvELc6tQ8b+GsGk6E=
github.com/ethereum/go-ethereum v1.13.14 h1:EwiY3FZP94derMCIam1iW4HFVrSgIcpsu0HwTQtm6CQ=
github.com/ethereum/go-ethereum v1.13.14/go.mod h1:TN8ZiHrdJwSe8Cb6x+p0hs5CxhJZPbqB7hHkaUXcmIU=
github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU=
Expand All @@ -15,6 +17,8 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/pascaldekloe/name v1.0.0 h1:n7LKFgHixETzxpRv2R77YgPUFo85QHGZKrdaYm7eY5U=
github.com/pascaldekloe/name v1.0.0/go.mod h1:Z//MfYJnH4jVpQ9wkclwu2I2MkHmXTlT9wR5UZScttM=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/samber/lo v1.39.0 h1:4gTz1wUhNYLhFSKl6O+8peW0v2F4BCY034GRpU9WnuA=
Expand All @@ -31,6 +35,8 @@ golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30=
golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ=
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE=
golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
Expand All @@ -39,5 +45,7 @@ golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/tools v0.15.0 h1:zdAyfUGbYmuVokhzVmghFl2ZJh5QhcfebBgmVPFYA+8=
golang.org/x/tools v0.15.0/go.mod h1:hpksKq4dtpQWS1uQ61JkdqWM3LscIS6Slf+VVkm+wQk=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
68 changes: 34 additions & 34 deletions schema/filter/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ type Network uint64

const (
NetworkUnknown Network = iota // unknown
NetworkEthereum // ethereum
NetworkOptimism // optimism
NetworkBase // base
NetworkPolygon // polygon
NetworkCrossbell // crossbell
NetworkArbitrum // arbitrum
NetworkRSS // rss
NetworkArweave // arweave
NetworkFarcaster // farcaster
NetworkAvalanche // avax
NetworkVSL // vsl
NetworkSatoshiVM // savm
NetworkBitcoin // bitcoin
NetworkBase // base
NetworkBinanceSmartChain // binance-smart-chain
NetworkBitcoin // bitcoin
NetworkCrossbell // crossbell
NetworkEthereum // ethereum
NetworkFarcaster // farcaster
NetworkGnosis // gnosis
NetworkLinea // linea
NetworkOptimism // optimism
NetworkPolygon // polygon
NetworkRSS // rss
NetworkSatoshiVM // savm
NetworkVSL // vsl
)

var _ echo.BindUnmarshaler = (*Network)(nil)
Expand All @@ -46,17 +46,17 @@ func (n *Network) UnmarshalParam(param string) error {
type NetworkSource string

const (
NetworkEthereumSource NetworkSource = "ethereum"
NetworkArweaveSource NetworkSource = "arweave"
NetworkEthereumSource NetworkSource = "ethereum"
NetworkFarcasterSource NetworkSource = "farcaster"
)

func (n Network) Source() NetworkSource {
switch n {
case NetworkEthereum, NetworkPolygon, NetworkOptimism, NetworkArbitrum, NetworkBase, NetworkCrossbell, NetworkAvalanche, NetworkVSL, NetworkSatoshiVM, NetworkBinanceSmartChain, NetworkGnosis, NetworkLinea:
return NetworkEthereumSource
case NetworkArweave:
return NetworkArweaveSource
case NetworkEthereum, NetworkPolygon, NetworkOptimism, NetworkArbitrum, NetworkBase, NetworkCrossbell, NetworkAvalanche, NetworkVSL, NetworkSatoshiVM, NetworkBinanceSmartChain, NetworkGnosis, NetworkLinea:
return NetworkEthereumSource
case NetworkFarcaster:
return NetworkFarcasterSource
default:
Expand All @@ -68,46 +68,46 @@ func (n Network) Source() NetworkSource {
type EthereumChainID uint64

const (
EthereumChainIDMainnet EthereumChainID = 1 // ethereum
EthereumChainIDOptimism EthereumChainID = 10 // optimism
EthereumChainIDPolygon EthereumChainID = 137 // polygon
EthereumChainIDArbitrum EthereumChainID = 42161 // arbitrum
EthereumChainIDBase EthereumChainID = 8453 // base
EthereumChainIDCrossbell EthereumChainID = 3737 // crossbell
EthereumChainIDAvalanche EthereumChainID = 43114 // avax
EthereumChainIDVSL EthereumChainID = 12553 // vsl
EthereumChainIDSatoshiVM EthereumChainID = 3109 // savm
EthereumChainIDBase EthereumChainID = 8453 // base
EthereumChainIDBinanceSmartChain EthereumChainID = 56 // binance-smart-chain
EthereumChainIDCrossbell EthereumChainID = 3737 // crossbell
EthereumChainIDGnosis EthereumChainID = 100 // gnosis
EthereumChainIDLinea EthereumChainID = 59144 // linea
EthereumChainIDMainnet EthereumChainID = 1 // ethereum
EthereumChainIDOptimism EthereumChainID = 10 // optimism
EthereumChainIDPolygon EthereumChainID = 137 // polygon
EthereumChainIDSatoshiVM EthereumChainID = 3109 // savm
EthereumChainIDVSL EthereumChainID = 12553 // vsl
)

func NetworkAndChainID(network string) (Network, EthereumChainID) {
switch network {
case NetworkEthereum.String():
return NetworkEthereum, EthereumChainIDMainnet
case NetworkOptimism.String():
return NetworkOptimism, EthereumChainIDOptimism
case NetworkPolygon.String():
return NetworkPolygon, EthereumChainIDPolygon
case NetworkArbitrum.String():
return NetworkArbitrum, EthereumChainIDArbitrum
case NetworkBase.String():
return NetworkBase, EthereumChainIDBase
case NetworkCrossbell.String():
return NetworkCrossbell, EthereumChainIDCrossbell
case NetworkAvalanche.String():
return NetworkAvalanche, EthereumChainIDAvalanche
case NetworkVSL.String():
return NetworkVSL, EthereumChainIDVSL
case NetworkSatoshiVM.String():
return NetworkSatoshiVM, EthereumChainIDSatoshiVM
case NetworkBase.String():
return NetworkBase, EthereumChainIDBase
case NetworkBinanceSmartChain.String():
return NetworkBinanceSmartChain, EthereumChainIDBinanceSmartChain
case NetworkCrossbell.String():
return NetworkCrossbell, EthereumChainIDCrossbell
case NetworkEthereum.String():
return NetworkEthereum, EthereumChainIDMainnet
case NetworkGnosis.String():
return NetworkGnosis, EthereumChainIDGnosis
case NetworkLinea.String():
return NetworkLinea, EthereumChainIDLinea
case NetworkOptimism.String():
return NetworkOptimism, EthereumChainIDOptimism
case NetworkPolygon.String():
return NetworkPolygon, EthereumChainIDPolygon
case NetworkSatoshiVM.String():
return NetworkSatoshiVM, EthereumChainIDSatoshiVM
case NetworkVSL.String():
return NetworkVSL, EthereumChainIDVSL
default:
return NetworkUnknown, 0
}
Expand Down
132 changes: 66 additions & 66 deletions schema/filter/network_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 17 additions & 17 deletions schema/filter/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,30 @@ import (
type Platform int

const (
PlatformRSS3 Platform = iota + 1 // RSS3
PlatformMirror // Mirror
PlatformFarcaster // Farcaster
PlatformParagraph // Paragraph
PlatformOpenSea // OpenSea
PlatformUniswap // Uniswap
PlatformOptimism // Optimism
Platform1inch Platform = iota + 1 // 1inch
PlatformAAVE // AAVE
PlatformAavegotchi // Aavegotchi
PlatformCrossbell // Crossbell
PlatformCurve // Curve
PlatformENS // ENS
PlatformFarcaster // Farcaster
PlatformHighlight // Highlight
PlatformIQWiki // IQWiki
PlatformKiwiStand // KiwiStand
PlatformLens // Lens
PlatformLido // Lido
PlatformLooksRare // LooksRare
PlatformMatters // Matters
PlatformMirror // Mirror
PlatformMomoka // Momoka
PlatformHighlight // Highlight
PlatformAAVE // AAVE
PlatformIQWiki // IQWiki
PlatformLido // Lido
PlatformCrossbell // Crossbell
PlatformENS // ENS
PlatformKiwiStand // KiwiStand
Platform1inch // 1inch
PlatformVSL // VSL
PlatformOpenSea // OpenSea
PlatformOptimism // Optimism
PlatformParagraph // Paragraph
PlatformRSS3 // RSS3
PlatformSAVM // SAVM
PlatformStargate // Stargate
PlatformCurve // Curve
PlatformUniswap // Uniswap
PlatformVSL // VSL
)

func (p Platform) ID() string {
Expand Down
Loading

0 comments on commit 5cc4d98

Please sign in to comment.