From 456f05d1d23038093edd282880b19807c7d44b31 Mon Sep 17 00:00:00 2001 From: Myles <96409608+ice-myles@users.noreply.github.com> Date: Tue, 26 Nov 2024 10:14:48 +0300 Subject: [PATCH] Verification flow cmc changes. (#244) --- cmd/eskimo-hut/kyc.go | 4 ++-- go.mod | 4 ++-- go.sum | 8 ++++---- kyc/verification_scenarios/contract.go | 18 +++++++++--------- .../verification_scenarios.go | 6 ++++-- 5 files changed, 21 insertions(+), 19 deletions(-) diff --git a/cmd/eskimo-hut/kyc.go b/cmd/eskimo-hut/kyc.go index 66ef691..9367293 100644 --- a/cmd/eskimo-hut/kyc.go +++ b/cmd/eskimo-hut/kyc.go @@ -425,8 +425,8 @@ func (s *service) VerifyKYCScenarios( //nolint:gocritic // . func validateScenariosData(data *verificationscenarios.VerificationMetadata) error { switch data.ScenarioEnum { case verificationscenarios.CoinDistributionScenarioCmc: - if data.CMCProfileLink == "" { - return errors.Errorf("empty cmc profile link `%v`", data.CMCProfileLink) + if data.CMCProfileLink == "" || !strings.HasPrefix(data.CMCProfileLink, "https://coinmarketcap.com") { + return errors.Errorf("wrong cmc profile link `%v`", data.CMCProfileLink) } case verificationscenarios.CoinDistributionScenarioTwitter: if data.Language == "" { diff --git a/go.mod b/go.mod index 67c4c1c..ef78a13 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/google/uuid v1.6.0 github.com/hashicorp/go-multierror v1.1.1 github.com/ice-blockchain/go-tarantool-client v0.0.0-20230327200757-4fc71fa3f7bb - github.com/ice-blockchain/santa v1.178.0 + github.com/ice-blockchain/santa v1.181.0 github.com/ice-blockchain/wintr v1.154.0 github.com/imroc/req/v3 v3.48.0 github.com/ip2location/ip2location-go/v9 v9.7.0 @@ -139,7 +139,7 @@ require ( github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/quic-go/qpack v0.5.1 // indirect - github.com/quic-go/quic-go v0.48.1 // indirect + github.com/quic-go/quic-go v0.48.2 // indirect github.com/refraction-networking/utls v1.6.7 // indirect github.com/rogpeppe/go-internal v1.13.1 // indirect github.com/rs/zerolog v1.33.0 // indirect diff --git a/go.sum b/go.sum index 83ce48b..d4e2b80 100644 --- a/go.sum +++ b/go.sum @@ -247,8 +247,8 @@ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/ice-blockchain/go-tarantool-client v0.0.0-20230327200757-4fc71fa3f7bb h1:8TnFP3mc7O+tc44kv2e0/TpZKnEVUaKH+UstwfBwRkk= github.com/ice-blockchain/go-tarantool-client v0.0.0-20230327200757-4fc71fa3f7bb/go.mod h1:ZsQU7i3mxhgBBu43Oev7WPFbIjP4TniN/b1UPNGbrq8= -github.com/ice-blockchain/santa v1.178.0 h1:6Pi3yJzVZfO4zW9M2+ylrrX8J3hwUj3UohpBab41LNk= -github.com/ice-blockchain/santa v1.178.0/go.mod h1:r+iUCqHKRYr4hNdmnypfQ6Zdiug/sJqUT8s5aEeoKH0= +github.com/ice-blockchain/santa v1.181.0 h1:TjlYV8Ayz2fLKx+pJUY+J5Bh0Jc1zNPrZv16tcL9MPE= +github.com/ice-blockchain/santa v1.181.0/go.mod h1:WJGs17EYYH+f+GX1zLUXb01nKs9SXsvNvTDxgvZfNwU= github.com/ice-blockchain/wintr v1.154.0 h1:yZSQtAEwGHTSmJ5pXjX0tpui1TNnG615QfpBkhY99a4= github.com/ice-blockchain/wintr v1.154.0/go.mod h1:DoUn66XJGzPzfCZTsHyMjfgj2aVLGvjqDSuKj2pa3KE= github.com/imroc/req/v3 v3.48.0 h1:IYuMGetuwLzOOTzDCquDqs912WNwpsPK0TBXWPIvoqg= @@ -362,8 +362,8 @@ github.com/prometheus/prometheus v0.300.0 h1:nVxAKi1ceyQxKa8r3gzMQyp7pMLeN1sPWvO github.com/prometheus/prometheus v0.300.0/go.mod h1:gtTPY/XVyCdqqnjA3NzDMb0/nc5H9hOu1RMame+gHyM= github.com/quic-go/qpack v0.5.1 h1:giqksBPnT/HDtZ6VhtFKgoLOWmlyo9Ei6u9PqzIMbhI= github.com/quic-go/qpack v0.5.1/go.mod h1:+PC4XFrEskIVkcLzpEkbLqq1uCoxPhQuvK5rH1ZgaEg= -github.com/quic-go/quic-go v0.48.1 h1:y/8xmfWI9qmGTc+lBr4jKRUWLGSlSigv847ULJ4hYXA= -github.com/quic-go/quic-go v0.48.1/go.mod h1:yBgs3rWBOADpga7F+jJsb6Ybg1LSYiQvwWlLX+/6HMs= +github.com/quic-go/quic-go v0.48.2 h1:wsKXZPeGWpMpCGSWqOcqpW2wZYic/8T3aqiOID0/KWE= +github.com/quic-go/quic-go v0.48.2/go.mod h1:yBgs3rWBOADpga7F+jJsb6Ybg1LSYiQvwWlLX+/6HMs= github.com/redis/go-redis/v9 v9.7.0 h1:HhLSs+B6O021gwzl+locl0zEDnyNkxMtf/Z3NNBMa9E= github.com/redis/go-redis/v9 v9.7.0/go.mod h1:f6zhXITC7JUJIlPEiBOTXxJgPLdZcA93GewI7inzyWw= github.com/refraction-networking/utls v1.6.7 h1:zVJ7sP1dJx/WtVuITug3qYUq034cDq9B2MR1K67ULZM= diff --git a/kyc/verification_scenarios/contract.go b/kyc/verification_scenarios/contract.go index 6aebf44..b3d3389 100644 --- a/kyc/verification_scenarios/contract.go +++ b/kyc/verification_scenarios/contract.go @@ -85,15 +85,15 @@ const ( var ( //nolint:gochecknoglobals,gomnd // We need it to sort scenarios. scenarioOrder = map[Scenario]int{ - CoinDistributionScenarioCmc: 0, - Scenario(CoinDistributionScenarioSignUpSunwaves): 1, - Scenario(CoinDistributionScenarioSignUpCallfluent): 2, - Scenario(CoinDistributionScenarioSignUpDoctorx): 3, - Scenario(CoinDistributionScenarioSignUpSauces): 4, - Scenario(CoinDistributionScenarioSignUpSealsend): 5, - Scenario(CoinDistributionScenarioSignUpCryptomayors): 6, - CoinDistributionScenarioTwitter: 7, - CoinDistributionScenarioTelegram: 8, + Scenario(CoinDistributionScenarioSignUpSunwaves): 0, + Scenario(CoinDistributionScenarioSignUpCallfluent): 1, + Scenario(CoinDistributionScenarioSignUpDoctorx): 2, + Scenario(CoinDistributionScenarioSignUpSauces): 3, + Scenario(CoinDistributionScenarioSignUpSealsend): 4, + Scenario(CoinDistributionScenarioSignUpCryptomayors): 5, + CoinDistributionScenarioTwitter: 6, + CoinDistributionScenarioTelegram: 7, + CoinDistributionScenarioCmc: 8, } ) diff --git a/kyc/verification_scenarios/verification_scenarios.go b/kyc/verification_scenarios/verification_scenarios.go index 5f0ec9e..47f8a04 100644 --- a/kyc/verification_scenarios/verification_scenarios.go +++ b/kyc/verification_scenarios/verification_scenarios.go @@ -62,8 +62,10 @@ func (r *repository) VerifyScenarios(ctx context.Context, metadata *Verification } switch metadata.ScenarioEnum { case CoinDistributionScenarioCmc: - if vErr := r.VerifyCMC(ctx, metadata); vErr != nil { - return nil, errors.Wrapf(vErr, "haven't passed the CMC verification for userID:%v", metadata.UserID) + if false { + if vErr := r.VerifyCMC(ctx, metadata); vErr != nil { + return nil, errors.Wrapf(vErr, "haven't passed the CMC verification for userID:%v", metadata.UserID) + } } case CoinDistributionScenarioTwitter: if metadata.TweetURL == "" {