Skip to content

Commit

Permalink
Merge pull request #132 from ipfs-force-community/chore/update-deps
Browse files Browse the repository at this point in the history
chore: upgrade venus and venus-auth
  • Loading branch information
hunjixin authored May 12, 2023
2 parents 7f8d5e9 + 0eb0522 commit 272b7cd
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 56 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ require (
github.com/filecoin-project/go-address v1.1.0
github.com/filecoin-project/go-jsonrpc v0.1.5
github.com/filecoin-project/go-state-types v0.11.1
github.com/filecoin-project/venus v1.11.0
github.com/filecoin-project/venus-auth v1.11.0
github.com/filecoin-project/venus v1.11.2-0.20230511060025-c6ed196f613c
github.com/filecoin-project/venus-auth v1.11.1-0.20230511013901-7829b3effbcd
github.com/google/uuid v1.3.0
github.com/gorilla/mux v1.8.0
github.com/ipfs-force-community/metrics v1.0.1-0.20220719063006-2c54bb379466
Expand Down
9 changes: 4 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -408,11 +408,11 @@ github.com/filecoin-project/specs-storage v0.2.2/go.mod h1:6cc/lncmAxMUocPi0z1EP
github.com/filecoin-project/storetheindex v0.3.5/go.mod h1:0r3d0kSpK63O6AvLr1CjAINLi+nWD49clzcnKV+GLpI=
github.com/filecoin-project/test-vectors/schema v0.0.5/go.mod h1:iQ9QXLpYWL3m7warwvK1JC/pTri8mnfEmKygNDqqY6E=
github.com/filecoin-project/venus v1.2.4/go.mod h1:hJULXHGAnWuq5S5KRtPkwbT8DqgM9II7NwyNU7t59D0=
github.com/filecoin-project/venus v1.11.0 h1:cH7ydd+O2dw7zg8tKfeiuwVd5SokZ8TBu+WoBU60pAA=
github.com/filecoin-project/venus v1.11.0/go.mod h1:H8A3djsrHKRWuKnJI/8Y6xZRudbV9V2x5NIP8/PVPfQ=
github.com/filecoin-project/venus v1.11.2-0.20230511060025-c6ed196f613c h1:f8ZwGwjnGTa4mlH8x7yqKTdw+AIcHMUd6hO2AtwRokQ=
github.com/filecoin-project/venus v1.11.2-0.20230511060025-c6ed196f613c/go.mod h1:DA73O3dB54B9dxxxQncq0ZGy5f+zwY+hRMgnaiHdhrk=
github.com/filecoin-project/venus-auth v1.3.2/go.mod h1:m5Jog2GYxztwP7w3m/iJdv/V1/bTcAVU9rm/CbhxRQU=
github.com/filecoin-project/venus-auth v1.11.0 h1:9PBswWxc113vqaHABMcRyMm+1BtlJCwOFTPQJg/OVtQ=
github.com/filecoin-project/venus-auth v1.11.0/go.mod h1:aBfIfNxQkdcY8Rk5wrQn9qRtJpH4RTDdc10Ac+ferzs=
github.com/filecoin-project/venus-auth v1.11.1-0.20230511013901-7829b3effbcd h1:l02UJuEbSUIBi3NC/+17K2gBbAzsUNQg42rNCXskOBc=
github.com/filecoin-project/venus-auth v1.11.1-0.20230511013901-7829b3effbcd/go.mod h1:PoTmfEn5lljjAQThBzX0+friJYGgi7Z3VLLujkOkCT4=
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6/go.mod h1:1i71OnUq3iUe1ma7Lr6yG6/rjvM3emb6yoL7xLFzcVQ=
github.com/flynn/noise v1.0.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag=
Expand Down Expand Up @@ -2779,7 +2779,6 @@ gorm.io/driver/mysql v1.1.1/go.mod h1:KdrTanmfLPPyAOeYGyG+UpDys7/7eeWT1zCq+oekYn
gorm.io/gorm v1.21.9/go.mod h1:F+OptMscr0P2F2qU97WT1WimdH9GaQPoDW7AYd5i2Y0=
gorm.io/gorm v1.21.12 h1:3fQM0Eiz7jcJEhPggHEpoYnsGZqynMzverL77DV40RM=
gorm.io/gorm v1.21.12/go.mod h1:F+OptMscr0P2F2qU97WT1WimdH9GaQPoDW7AYd5i2Y0=
gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o=
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
Expand Down
3 changes: 2 additions & 1 deletion integrate_test/mock_deamon.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"github.com/ipfs-force-community/venus-gateway/config"

"github.com/filecoin-project/venus-auth/auth"
"github.com/filecoin-project/venus-auth/core"
"github.com/filecoin-project/venus-auth/jwtclient"

v2API "github.com/filecoin-project/venus/venus-shared/api/gateway/v2"
Expand Down Expand Up @@ -90,7 +91,7 @@ func MockMain(ctx context.Context, validateMiner []address.Address, repoPath str

if len(cfg.RateLimit.Redis) > 0 {
limiter, err := ratelimit.NewRateLimitHandler(cfg.RateLimit.Redis, nil,
&jwtclient.ValueFromCtx{},
&core.ValueFromCtx{},
authClient,
logging.Logger("rate-limit"))
_ = logging.SetLogLevel("rate-limit", "info")
Expand Down
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (

"github.com/filecoin-project/go-jsonrpc"

"github.com/filecoin-project/venus-auth/core"
"github.com/filecoin-project/venus-auth/jwtclient"

_ "github.com/filecoin-project/venus/pkg/crypto/bls"
Expand Down Expand Up @@ -195,7 +196,7 @@ func RunMain(ctx context.Context, repoPath string, cfg *config.Config) error {

if len(cfg.RateLimit.Redis) > 0 {
limiter, err := ratelimit.NewRateLimitHandler(cfg.RateLimit.Redis, nil,
&jwtclient.ValueFromCtx{},
&core.ValueFromCtx{},
jwtclient.WarpLimitFinder(remoteJwtCli),
logging.Logger("rate-limit"))
_ = logging.SetLogLevel("rate-limit", "info")
Expand Down
5 changes: 2 additions & 3 deletions marketevent/market_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ import (

"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"

"github.com/filecoin-project/venus-auth/jwtclient"
"github.com/filecoin-project/venus-auth/core"

v2API "github.com/filecoin-project/venus/venus-shared/api/gateway/v2"
sharedTypes "github.com/filecoin-project/venus/venus-shared/types"
Expand Down Expand Up @@ -51,7 +50,7 @@ func NewMarketEventStream(ctx context.Context, validator validator.IAuthMinerVal
}

func (m *MarketEventStream) ListenMarketEvent(ctx context.Context, policy *types2.MarketRegisterPolicy) (<-chan *types2.RequestEvent, error) {
ip, exist := jwtclient.CtxGetTokenLocation(ctx)
ip, exist := core.CtxGetTokenLocation(ctx)
if !exist {
return nil, fmt.Errorf("ip not exist")
}
Expand Down
16 changes: 8 additions & 8 deletions marketevent/market_event_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/filecoin-project/go-state-types/abi"

"github.com/filecoin-project/venus-auth/auth"
"github.com/filecoin-project/venus-auth/jwtclient"
"github.com/filecoin-project/venus-auth/core"

sharedTypes "github.com/filecoin-project/venus/venus-shared/types"

Expand All @@ -34,7 +34,7 @@ func TestListenMarketEvent(t *testing.T) {
marketEvent := setupMarketEvent(t, supportAccount, minerAddr)

client := NewMarketEventClient(marketEvent, minerAddr, nil, log.With())
go client.ListenMarketRequest(jwtclient.CtxWithName(jwtclient.CtxWithTokenLocation(ctx, "127.1.1.1"), supportAccount))
go client.ListenMarketRequest(core.CtxWithName(core.CtxWithTokenLocation(ctx, "127.1.1.1"), supportAccount))
client.WaitReady(ctx)
})

Expand All @@ -47,7 +47,7 @@ func TestListenMarketEvent(t *testing.T) {
marketEvent := setupMarketEvent(t, supportAccount, minerAddr)
client := NewMarketEventClient(marketEvent, addrGetter(), nil, log.With())
// stm: @VENUSGATEWAY_MARKET_EVENT_LISTEN_MARKET_EVENT_002
err := client.listenMarketRequestOnce(jwtclient.CtxWithName(jwtclient.CtxWithTokenLocation(ctx, "127.1.1.1"), supportAccount))
err := client.listenMarketRequestOnce(core.CtxWithName(core.CtxWithTokenLocation(ctx, "127.1.1.1"), supportAccount))
require.Contains(t, err.Error(), "not exist")
})

Expand All @@ -60,7 +60,7 @@ func TestListenMarketEvent(t *testing.T) {
marketEvent := setupMarketEvent(t, supportAccount, minerAddr)
client := NewMarketEventClient(marketEvent, minerAddr, nil, log.With())
// stm: @VENUSGATEWAY_MARKET_EVENT_LISTEN_MARKET_EVENT_003
err := client.listenMarketRequestOnce(jwtclient.CtxWithName(ctx, supportAccount))
err := client.listenMarketRequestOnce(core.CtxWithName(ctx, supportAccount))
require.Contains(t, err.Error(), "ip not exist")
})
}
Expand All @@ -76,7 +76,7 @@ func TestUnsealed(t *testing.T) {
marketEvent := setupMarketEvent(t, walletAccount, minerAddr)
handler := testhelper.NewMarketHandler(t)
client := NewMarketEventClient(marketEvent, minerAddr, handler, log.With())
go client.ListenMarketRequest(jwtclient.CtxWithName(jwtclient.CtxWithTokenLocation(ctx, "127.1.1.1"), walletAccount))
go client.ListenMarketRequest(core.CtxWithName(core.CtxWithTokenLocation(ctx, "127.1.1.1"), walletAccount))
client.WaitReady(ctx)

sid := abi.SectorNumber(10)
Expand All @@ -97,7 +97,7 @@ func TestUnsealed(t *testing.T) {
marketEvent := setupMarketEvent(t, walletAccount, minerAddr)
handler := testhelper.NewMarketHandler(t)
client := NewMarketEventClient(marketEvent, minerAddr, handler, log.With())
go client.ListenMarketRequest(jwtclient.CtxWithName(jwtclient.CtxWithTokenLocation(ctx, "127.1.1.1"), walletAccount))
go client.ListenMarketRequest(core.CtxWithName(core.CtxWithTokenLocation(ctx, "127.1.1.1"), walletAccount))
client.WaitReady(ctx)

sid := abi.SectorNumber(10)
Expand All @@ -118,7 +118,7 @@ func TestUnsealed(t *testing.T) {
marketEvent := setupMarketEvent(t, walletAccount, minerAddr)
handler := testhelper.NewMarketHandler(t)
client := NewMarketEventClient(marketEvent, minerAddr, handler, log.With())
go client.ListenMarketRequest(jwtclient.CtxWithName(jwtclient.CtxWithTokenLocation(ctx, "127.1.1.1"), walletAccount))
go client.ListenMarketRequest(core.CtxWithName(core.CtxWithTokenLocation(ctx, "127.1.1.1"), walletAccount))
client.WaitReady(ctx)

sid := abi.SectorNumber(10)
Expand All @@ -143,7 +143,7 @@ func TestListMarketConnectionsState(t *testing.T) {
marketEvent := setupMarketEvent(t, walletAccount, minerAddr)
handler := testhelper.NewMarketHandler(t)
client := NewMarketEventClient(marketEvent, minerAddr, handler, log.With())
go client.ListenMarketRequest(jwtclient.CtxWithName(jwtclient.CtxWithTokenLocation(ctx, "127.1.1.1"), walletAccount))
go client.ListenMarketRequest(core.CtxWithName(core.CtxWithTokenLocation(ctx, "127.1.1.1"), walletAccount))
client.WaitReady(ctx)

// stm: @VENUSGATEWAY_MARKET_EVENT_LIST_MARKET_CONNECTIONS_STATE_001
Expand Down
5 changes: 2 additions & 3 deletions proofevent/proof_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/network"
"github.com/filecoin-project/venus-auth/core"

"github.com/ipfs-force-community/venus-gateway/metrics"
"github.com/ipfs-force-community/venus-gateway/types"
"github.com/ipfs-force-community/venus-gateway/validator"

"github.com/filecoin-project/venus-auth/jwtclient"

"github.com/filecoin-project/venus/venus-shared/actors/builtin"
v2API "github.com/filecoin-project/venus/venus-shared/api/gateway/v2"
sharedTypes "github.com/filecoin-project/venus/venus-shared/types"
Expand Down Expand Up @@ -51,7 +50,7 @@ func NewProofEventStream(ctx context.Context, validator validator.IAuthMinerVali
}

func (e *ProofEventStream) ListenProofEvent(ctx context.Context, policy *sharedGatewayTypes.ProofRegisterPolicy) (<-chan *sharedGatewayTypes.RequestEvent, error) {
ip, exist := jwtclient.CtxGetTokenLocation(ctx)
ip, exist := core.CtxGetTokenLocation(ctx)
if !exist {
return nil, fmt.Errorf("ip not exist")
}
Expand Down
26 changes: 13 additions & 13 deletions proofevent/proof_event_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/network"
"github.com/filecoin-project/venus-auth/jwtclient"
"github.com/filecoin-project/venus-auth/core"
"github.com/filecoin-project/venus/venus-shared/actors/builtin"
types2 "github.com/filecoin-project/venus/venus-shared/types"
types "github.com/filecoin-project/venus/venus-shared/types/gateway"
Expand All @@ -33,7 +33,7 @@ func TestListenProofEvent(t *testing.T) {
t.Run("init connect", func(t *testing.T) {
proof := setupProofEvent(t, []address.Address{addr1})
ctx, cancel := context.WithCancel(context.Background())
ctx = jwtclient.CtxWithTokenLocation(ctx, "127.1.1.1")
ctx = core.CtxWithTokenLocation(ctx, "127.1.1.1")
// stm: @VENUSGATEWAY_PROOF_EVENT_LISTEN_PROOF_EVENT_001
requestCh, err := proof.ListenProofEvent(ctx, &types.ProofRegisterPolicy{
MinerAddress: addr1,
Expand Down Expand Up @@ -67,7 +67,7 @@ func TestListenProofEvent(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
proofClient := NewProofEvent(proof, addr1, testhelper.NewTimeoutProofHandler(time.Second), log.With())
// stm:
go proofClient.ListenProofRequest(jwtclient.CtxWithTokenLocation(ctx, "127.1.1.1"))
go proofClient.ListenProofRequest(core.CtxWithTokenLocation(ctx, "127.1.1.1"))
proofClient.WaitReady(ctx)

// fill request
Expand Down Expand Up @@ -100,7 +100,7 @@ func TestListenProofEvent(t *testing.T) {
proof := setupProofEvent(t, []address.Address{addr1})
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
ctx = jwtclient.CtxWithTokenLocation(ctx, "127.1.1.1")
ctx = core.CtxWithTokenLocation(ctx, "127.1.1.1")

// stm: @VENUSGATEWAY_PROOF_EVENT_LISTEN_PROOF_EVENT_003
_, err := proof.ListenProofEvent(ctx, &types.ProofRegisterPolicy{
Expand Down Expand Up @@ -148,7 +148,7 @@ func TestComputeProofEvent(t *testing.T) {
handler := testhelper.NewProofHander(t, expectInfo, expectRand, expectEpoch, expectVersion, expectProof, false)
proofClient := NewProofEvent(proof, addr, handler, log.With())

go proofClient.ListenProofRequest(jwtclient.CtxWithTokenLocation(ctx, "127.1.1.1"))
go proofClient.ListenProofRequest(core.CtxWithTokenLocation(ctx, "127.1.1.1"))
proofClient.WaitReady(ctx)

// stm: @VENUSGATEWAY_PROOF_EVENT_COMPUTE_PROOF_001
Expand Down Expand Up @@ -181,7 +181,7 @@ func TestComputeProofEvent(t *testing.T) {
handler := testhelper.NewProofHander(t, expectInfo, expectRand, expectEpoch, expectVersion, expectProof, false)
proofClient := NewProofEvent(proof, addr, handler, log.With())

ctx = jwtclient.CtxWithTokenLocation(ctx, "127.1.1.1")
ctx = core.CtxWithTokenLocation(ctx, "127.1.1.1")
go proofClient.ListenProofRequest(ctx)
proofClient.WaitReady(ctx)

Expand Down Expand Up @@ -214,7 +214,7 @@ func TestComputeProofEvent(t *testing.T) {
handler := testhelper.NewProofHander(t, expectInfo, expectRand, expectEpoch, expectVersion, nil, true)
proofClient := NewProofEvent(proof, addr, handler, log.With())

go proofClient.ListenProofRequest(jwtclient.CtxWithTokenLocation(ctx, "127.1.1.1"))
go proofClient.ListenProofRequest(core.CtxWithTokenLocation(ctx, "127.1.1.1"))
proofClient.WaitReady(ctx)

// stm: @VENUSGATEWAY_PROOF_EVENT_COMPUTE_PROOF_004
Expand All @@ -232,7 +232,7 @@ func TestComputeProofEvent(t *testing.T) {
t.Run("incorrect result error", func(t *testing.T) {
proof := setupProofEvent(t, []address.Address{addr})
{
ctx := jwtclient.CtxWithTokenLocation(context.Background(), "127.1.1.1")
ctx := core.CtxWithTokenLocation(context.Background(), "127.1.1.1")
requestCh, err := proof.ListenProofEvent(ctx, &types.ProofRegisterPolicy{
MinerAddress: addr,
})
Expand Down Expand Up @@ -264,7 +264,7 @@ func TestComputeProofEvent(t *testing.T) {

t.Run("mistake request id error", func(t *testing.T) {
proof := setupProofEvent(t, []address.Address{addr})
ctx := jwtclient.CtxWithTokenLocation(context.Background(), "127.1.1.1")
ctx := core.CtxWithTokenLocation(context.Background(), "127.1.1.1")
_, err := proof.ListenProofEvent(ctx, &types.ProofRegisterPolicy{
MinerAddress: addr,
})
Expand All @@ -289,14 +289,14 @@ func TestListConnectedMiners(t *testing.T) {
defer cancel()
{
proofClient := NewProofEvent(proof, addr1, nil, log.With())
ctx = jwtclient.CtxWithTokenLocation(ctx, "127.1.1.1")
ctx = core.CtxWithTokenLocation(ctx, "127.1.1.1")
go proofClient.ListenProofRequest(ctx)
proofClient.WaitReady(ctx)
}

{
proofClient := NewProofEvent(proof, addr2, nil, log.With())
ctx = jwtclient.CtxWithTokenLocation(ctx, "127.1.1.1")
ctx = core.CtxWithTokenLocation(ctx, "127.1.1.1")
go proofClient.ListenProofRequest(ctx)
proofClient.WaitReady(ctx)
}
Expand All @@ -314,14 +314,14 @@ func TestListMinerConnection(t *testing.T) {

{
proofClient := NewProofEvent(proof, addr1, nil, log.With())
ctx = jwtclient.CtxWithTokenLocation(ctx, "127.1.1.1")
ctx = core.CtxWithTokenLocation(ctx, "127.1.1.1")
go proofClient.ListenProofRequest(ctx)
proofClient.WaitReady(ctx)
}

{
proofClient := NewProofEvent(proof, addr1, nil, log.With())
ctx = jwtclient.CtxWithTokenLocation(ctx, "127.1.1.2")
ctx = core.CtxWithTokenLocation(ctx, "127.1.1.2")
go proofClient.ListenProofRequest(ctx)
proofClient.WaitReady(ctx)
}
Expand Down
2 changes: 1 addition & 1 deletion validator/miner_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type IAuthMinerValidator interface {
var _ IAuthMinerValidator = (*AuthMinerValidator)(nil)

func (amv *AuthMinerValidator) Validate(ctx context.Context, miner address.Address) error {
account, exist := jwtclient.CtxGetName(ctx)
account, exist := core.CtxGetName(ctx)
if !exist {
return fmt.Errorf("user name not exist in rpc context")
}
Expand Down
4 changes: 2 additions & 2 deletions validator/miner_validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/filecoin-project/venus/venus-shared/types"

"github.com/filecoin-project/venus-auth/auth"
"github.com/filecoin-project/venus-auth/jwtclient"
"github.com/filecoin-project/venus-auth/core"

"github.com/ipfs-force-community/venus-gateway/validator/mocks"
)
Expand Down Expand Up @@ -72,7 +72,7 @@ func TestAuthMinerValidator_Validate(t *testing.T) {
authClient.AddMockUser(ctx, arg.user)
var ctx = context.Background()
if userName != "" {
ctx = jwtclient.CtxWithName(ctx, userName)
ctx = core.CtxWithName(ctx, userName)
}

// miner not exists
Expand Down
11 changes: 6 additions & 5 deletions walletevent/wallet_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/filecoin-project/go-state-types/crypto"

"github.com/filecoin-project/venus-auth/auth"
"github.com/filecoin-project/venus-auth/core"
"github.com/filecoin-project/venus-auth/jwtclient"

wcrypto "github.com/filecoin-project/venus/pkg/crypto"
Expand Down Expand Up @@ -60,12 +61,12 @@ func NewWalletEventStream(ctx context.Context, authClient jwtclient.IAuthClient,
}

func (w *WalletEventStream) ListenWalletEvent(ctx context.Context, policy *sharedGatewayTypes.WalletRegisterPolicy) (<-chan *sharedGatewayTypes.RequestEvent, error) {
walletAccount, exit := jwtclient.CtxGetName(ctx)
walletAccount, exit := core.CtxGetName(ctx)
if !exit {
return nil, errors.New("unable to get account name in method ListenWalletEvent request")
}

ip, _ := jwtclient.CtxGetTokenLocation(ctx) // todo sure exit?
ip, _ := core.CtxGetTokenLocation(ctx) // todo sure exit?
out := make(chan *sharedGatewayTypes.RequestEvent, w.cfg.RequestQueueSize)
walletLog := log.With("account", walletAccount).With("ip", ip)
ctx, _ = tag.New(ctx, tag.Upsert(metrics.WalletAccountKey, walletAccount), tag.Upsert(metrics.IPKey, ip))
Expand Down Expand Up @@ -155,7 +156,7 @@ func (w *WalletEventStream) ResponseWalletEvent(ctx context.Context, resp *share
}

func (w *WalletEventStream) SupportNewAccount(ctx context.Context, channelId sharedTypes.UUID, account string) error {
walletAccount, exit := jwtclient.CtxGetName(ctx)
walletAccount, exit := core.CtxGetName(ctx)
if !exit {
return errors.New("unable to get account name in method SupportNewAccount request")
}
Expand All @@ -171,7 +172,7 @@ func (w *WalletEventStream) SupportNewAccount(ctx context.Context, channelId sha
}

func (w *WalletEventStream) AddNewAddress(ctx context.Context, channelId sharedTypes.UUID, addrs []address.Address) error {
walletAccount, exit := jwtclient.CtxGetName(ctx)
walletAccount, exit := core.CtxGetName(ctx)
if !exit {
return errors.New("unable to get account name in method AddNewAddress request")
}
Expand Down Expand Up @@ -214,7 +215,7 @@ func (w *WalletEventStream) AddNewAddress(ctx context.Context, channelId sharedT
}

func (w *WalletEventStream) RemoveAddress(ctx context.Context, channelId sharedTypes.UUID, addrs []address.Address) error {
walletAccount, exit := jwtclient.CtxGetName(ctx)
walletAccount, exit := core.CtxGetName(ctx)
if !exit {
return errors.New("unable to get account name in method RemoveAddress request")
}
Expand Down
Loading

0 comments on commit 272b7cd

Please sign in to comment.