diff --git a/application.yaml b/application.yaml index db2978e..b49e860 100644 --- a/application.yaml +++ b/application.yaml @@ -32,7 +32,7 @@ cmd/freezer-refrigerant: jwtSecret: bogus tokenomics: &tokenomics kyc: - get-eskimo-user-state-url: https://something.example.com + try-reset-kyc-steps-url: https://something.example.com config-json-url: https://ice-staging.b-cdn.net/something/somebogus.json liveness-delay: 5m bookkeeper/storage: &bookkeeperStorage diff --git a/go.mod b/go.mod index f3a9f5a..bfe7af1 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/cenkalti/backoff/v4 v4.2.1 github.com/goccy/go-json v0.10.2 github.com/hashicorp/go-multierror v1.1.1 - github.com/ice-blockchain/eskimo v1.177.0 + github.com/ice-blockchain/eskimo v1.180.0 github.com/ice-blockchain/go-tarantool-client v0.0.0-20230327200757-4fc71fa3f7bb github.com/ice-blockchain/wintr v1.125.0 github.com/imroc/req/v3 v3.42.1 diff --git a/go.sum b/go.sum index a84acc1..a03b720 100644 --- a/go.sum +++ b/go.sum @@ -301,8 +301,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/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/ice-blockchain/eskimo v1.177.0 h1:Asx8JtlbxC/G4qw8RX+NbXA6mg6mc7Qk22KtFHFZcgs= -github.com/ice-blockchain/eskimo v1.177.0/go.mod h1:ef73dtR1bff40EugXbhRtRScPyUuqQ8oult0QbciMLc= +github.com/ice-blockchain/eskimo v1.180.0 h1:fhg0elXwuhJq1jYyFkTbGZeO/OhtU9rS2+oPtUJLe9o= +github.com/ice-blockchain/eskimo v1.180.0/go.mod h1:oXuuEPPEB4UMqyACv8LnTogIn4uU0tFCd2Y6ci7T+g4= 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/wintr v1.125.0 h1:pk/SVyztstUF19+JDCufJRMXJeNpchVA4O26xp47l3Y= diff --git a/tokenomics/contract.go b/tokenomics/contract.go index 1ca2e7a..18b2570 100644 --- a/tokenomics/contract.go +++ b/tokenomics/contract.go @@ -270,9 +270,9 @@ type ( disableAdvancedTeam *atomic.Pointer[[]string] kycConfigJSON *atomic.Pointer[kycConfigJSON] KYC struct { - GetEskimoUserStateURL string `yaml:"get-eskimo-user-state-url" mapstructure:"get-eskimo-user-state-url"` - ConfigJSONURL string `yaml:"config-json-url" mapstructure:"config-json-url"` - LivenessDelay stdlibtime.Duration `yaml:"liveness-delay" mapstructure:"liveness-delay"` + TryResetKYCStepsURL string `yaml:"try-reset-kyc-steps-url" mapstructure:"try-reset-kyc-steps-url"` + ConfigJSONURL string `yaml:"config-json-url" mapstructure:"config-json-url"` + LivenessDelay stdlibtime.Duration `yaml:"liveness-delay" mapstructure:"liveness-delay"` } `yaml:"kyc" mapstructure:"kyc"` AdoptionMilestoneSwitch struct { ActiveUserMilestones []struct { diff --git a/tokenomics/kyc.go b/tokenomics/kyc.go index adf2b0e..2715591 100644 --- a/tokenomics/kyc.go +++ b/tokenomics/kyc.go @@ -161,7 +161,8 @@ func (r *repository) isKYCEnabled(ctx context.Context, _ users.KYCStep) bool { /* Because existing users have empty KYCState in dragonfly cuz usersTableSource might not have updated it yet. -So we need to query Eskimo for the valid kyc state of the user to be sure. +And because we might need to reset any kyc steps for the user prior to starting to mine. +So we need to call Eskimo for that, to be sure we have the valid kyc state for the user before starting to mine. */ func (r *repository) overrideKYCStateWithEskimoKYCState(ctx context.Context, userID string, state *KYCState) error { if resp, err := req. @@ -187,7 +188,7 @@ func (r *repository) overrideKYCStateWithEskimoKYCState(ctx context.Context, use SetHeader("Cache-Control", "no-cache, no-store, must-revalidate"). SetHeader("Pragma", "no-cache"). SetHeader("Expires", "0"). - Get(fmt.Sprintf("%v/users/%v", r.cfg.KYC.GetEskimoUserStateURL, userID)); err != nil { + Post(fmt.Sprintf("%v/users/%v", r.cfg.KYC.TryResetKYCStepsURL, userID)); err != nil { return errors.Wrapf(err, "failed to fetch eskimo user state for userID:%v", userID) } else if data, err2 := resp.ToBytes(); err2 != nil { return errors.Wrapf(err2, "failed to read body of eskimo user state request for userID:%v", userID)