Skip to content

Commit

Permalink
Address check and verify fixes. (#228)
Browse files Browse the repository at this point in the history
  • Loading branch information
ice-myles authored Dec 5, 2024
1 parent dea923e commit 17f21c6
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 34 deletions.
5 changes: 3 additions & 2 deletions coin-distribution/eligibility.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strings"
stdlibtime "time"

"github.com/ethereum/go-ethereum/common"
"github.com/multiversx/mx-sdk-go/data"

"github.com/ice-blockchain/freezer/model"
"github.com/ice-blockchain/wintr/time"
Expand Down Expand Up @@ -95,6 +95,7 @@ func isEthereumAddressValid(ethAddress string) bool {
if ethAddress == "skip" {
return true
}
addr, err := data.NewAddressFromBech32String(ethAddress)

return common.IsHexAddress(ethAddress)
return err == nil && addr.IsValid()
}
12 changes: 11 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ require (
github.com/ice-blockchain/go-tarantool-client v0.0.0-20230327200757-4fc71fa3f7bb
github.com/ice-blockchain/wintr v1.154.0
github.com/imroc/req/v3 v3.48.0
github.com/multiversx/mx-sdk-go v1.4.3
github.com/oklog/ulid/v2 v2.1.0
github.com/pkg/errors v0.9.1
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475
Expand Down Expand Up @@ -51,6 +52,7 @@ require (
github.com/VictoriaMetrics/fastcache v1.12.2 // indirect
github.com/andybalholm/brotli v1.1.1 // indirect
github.com/bits-and-blooms/bitset v1.17.0 // indirect
github.com/btcsuite/btcd/btcutil v1.1.6 // indirect
github.com/bytedance/sonic v1.12.5 // indirect
github.com/bytedance/sonic/loader v0.2.1 // indirect
github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect
Expand All @@ -74,6 +76,7 @@ require (
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/deckarep/golang-set/v2 v2.7.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/denisbrodbeck/machineid v1.0.1 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/dmarkham/enumer v1.5.10 // indirect
Expand Down Expand Up @@ -149,12 +152,20 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/multiversx/mx-chain-communication-go v1.1.1 // indirect
github.com/multiversx/mx-chain-core-go v1.2.23 // indirect
github.com/multiversx/mx-chain-crypto-go v1.2.12 // indirect
github.com/multiversx/mx-chain-go v1.8.6 // indirect
github.com/multiversx/mx-chain-logger-go v1.0.15 // indirect
github.com/multiversx/mx-chain-vm-common-go v1.5.16 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/onsi/ginkgo/v2 v2.22.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/opencontainers/runc v1.2.2 // indirect
github.com/pascaldekloe/name v1.0.1 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
github.com/pierrec/lz4/v4 v4.1.21 // indirect
github.com/planetscale/vtprotobuf v0.6.1-0.20240917153116-6f2963f01587 // indirect
Expand All @@ -178,7 +189,6 @@ require (
github.com/supranational/blst v0.3.13 // indirect
github.com/swaggo/files v1.0.1 // indirect
github.com/swaggo/gin-swagger v1.6.0 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
github.com/tklauser/go-sysconf v0.3.14 // indirect
github.com/tklauser/numcpus v0.9.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
Expand Down
Loading

0 comments on commit 17f21c6

Please sign in to comment.