Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove namespace param from remaining manager calls #875

Merged
merged 9 commits into from
Jun 22, 2022
2 changes: 1 addition & 1 deletion internal/apiserver/route_delete_contract_listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var deleteContractListener = &ffapi.Route{
JSONOutputCodes: []int{http.StatusNoContent}, // Sync operation, no output
Extensions: &coreExtensions{
CoreJSONHandler: func(r *ffapi.APIRequest, cr *coreRequest) (output interface{}, err error) {
err = cr.or.Contracts().DeleteContractListenerByNameOrID(cr.ctx, extractNamespace(r.PP), r.PP["nameOrId"])
err = cr.or.Contracts().DeleteContractListenerByNameOrID(cr.ctx, r.PP["nameOrId"])
return nil, err
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func TestDeleteContractListenerByID(t *testing.T) {
req.Header.Set("Content-Type", "application/json; charset=utf-8")
res := httptest.NewRecorder()

mcm.On("DeleteContractListenerByNameOrID", mock.Anything, "mynamespace", id.String()).
mcm.On("DeleteContractListenerByNameOrID", mock.Anything, id.String()).
Return(nil, nil)
r.ServeHTTP(res, req)

Expand Down
2 changes: 1 addition & 1 deletion internal/apiserver/route_delete_subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var deleteSubscription = &ffapi.Route{
JSONOutputCodes: []int{http.StatusNoContent}, // Sync operation, no output
Extensions: &coreExtensions{
CoreJSONHandler: func(r *ffapi.APIRequest, cr *coreRequest) (output interface{}, err error) {
err = cr.or.DeleteSubscription(cr.ctx, extractNamespace(r.PP), r.PP["subid"])
err = cr.or.DeleteSubscription(cr.ctx, r.PP["subid"])
return nil, err
},
},
Expand Down
2 changes: 1 addition & 1 deletion internal/apiserver/route_delete_subscription_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestDeleteSubscription(t *testing.T) {
req.Header.Set("Content-Type", "application/json; charset=utf-8")
res := httptest.NewRecorder()

o.On("DeleteSubscription", mock.Anything, "ns1", u.String()).
o.On("DeleteSubscription", mock.Anything, u.String()).
Return(nil)
r.ServeHTTP(res, req)

Expand Down
2 changes: 1 addition & 1 deletion internal/apiserver/route_get_chart_histogram.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ var getChartHistogram = &ffapi.Route{
if err != nil {
return nil, i18n.NewError(cr.ctx, coremsgs.MsgInvalidChartNumberParam, "buckets")
}
return cr.or.GetChartHistogram(cr.ctx, extractNamespace(r.PP), startTime.UnixNano(), endTime.UnixNano(), buckets, database.CollectionName(r.PP["collection"]))
return cr.or.GetChartHistogram(cr.ctx, startTime.UnixNano(), endTime.UnixNano(), buckets, database.CollectionName(r.PP["collection"]))
},
},
}
2 changes: 1 addition & 1 deletion internal/apiserver/route_get_chart_histogram_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func TestGetChartHistogramSuccess(t *testing.T) {
startTime, _ := fftypes.ParseTimeString("1234567890")
endtime, _ := fftypes.ParseTimeString("1234567891")

o.On("GetChartHistogram", mock.Anything, "mynamespace", startTime.UnixNano(), endtime.UnixNano(), int64(30), database.CollectionName("test")).
o.On("GetChartHistogram", mock.Anything, startTime.UnixNano(), endtime.UnixNano(), int64(30), database.CollectionName("test")).
Return([]*core.ChartHistogram{}, nil)
r.ServeHTTP(res, req)

Expand Down
2 changes: 1 addition & 1 deletion internal/apiserver/route_get_contract_api_by_name.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var getContractAPIByName = &ffapi.Route{
JSONOutputCodes: []int{http.StatusOK},
Extensions: &coreExtensions{
CoreJSONHandler: func(r *ffapi.APIRequest, cr *coreRequest) (output interface{}, err error) {
return cr.or.Contracts().GetContractAPI(cr.ctx, cr.apiBaseURL, extractNamespace(r.PP), r.PP["apiName"])
return cr.or.Contracts().GetContractAPI(cr.ctx, cr.apiBaseURL, r.PP["apiName"])
},
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestGetContractAPIByName(t *testing.T) {
req.Header.Set("Content-Type", "application/json; charset=utf-8")
res := httptest.NewRecorder()

mcm.On("GetContractAPI", mock.Anything, "http://127.0.0.1:5000/api/v1", "ns1", "banana").
mcm.On("GetContractAPI", mock.Anything, "http://127.0.0.1:5000/api/v1", "banana").
Return(&core.ContractAPI{}, nil)
r.ServeHTTP(res, req)

Expand Down
2 changes: 1 addition & 1 deletion internal/apiserver/route_get_contract_api_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var getContractAPIInterface = &ffapi.Route{
JSONOutputCodes: []int{http.StatusOK},
Extensions: &coreExtensions{
CoreJSONHandler: func(r *ffapi.APIRequest, cr *coreRequest) (output interface{}, err error) {
return cr.or.Contracts().GetContractAPIInterface(cr.ctx, extractNamespace(r.PP), r.PP["apiName"])
return cr.or.Contracts().GetContractAPIInterface(cr.ctx, r.PP["apiName"])
},
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestGetContractAPIInterface(t *testing.T) {
req.Header.Set("Content-Type", "application/json; charset=utf-8")
res := httptest.NewRecorder()

mcm.On("GetContractAPIInterface", mock.Anything, "ns1", "banana").
mcm.On("GetContractAPIInterface", mock.Anything, "banana").
Return(&core.FFI{}, nil)
r.ServeHTTP(res, req)

Expand Down
2 changes: 1 addition & 1 deletion internal/apiserver/route_get_contract_api_listeners.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var getContractAPIListeners = &ffapi.Route{
Extensions: &coreExtensions{
FilterFactory: database.ContractListenerQueryFactory,
CoreJSONHandler: func(r *ffapi.APIRequest, cr *coreRequest) (output interface{}, err error) {
return filterResult(cr.or.Contracts().GetContractAPIListeners(cr.ctx, extractNamespace(r.PP), r.PP["apiName"], r.PP["eventPath"], cr.filter))
return filterResult(cr.or.Contracts().GetContractAPIListeners(cr.ctx, r.PP["apiName"], r.PP["eventPath"], cr.filter))
},
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestGetContractAPIListeners(t *testing.T) {
req.Header.Set("Content-Type", "application/json; charset=utf-8")
res := httptest.NewRecorder()

mcm.On("GetContractAPIListeners", mock.Anything, "ns1", "banana", "peeled", mock.Anything).
mcm.On("GetContractAPIListeners", mock.Anything, "banana", "peeled", mock.Anything).
Return([]*core.ContractListener{}, nil, nil)
r.ServeHTTP(res, req)

Expand Down
2 changes: 1 addition & 1 deletion internal/apiserver/route_get_contract_apis.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var getContractAPIs = &ffapi.Route{
Extensions: &coreExtensions{
FilterFactory: database.ContractAPIQueryFactory,
CoreJSONHandler: func(r *ffapi.APIRequest, cr *coreRequest) (output interface{}, err error) {
return filterResult(cr.or.Contracts().GetContractAPIs(cr.ctx, cr.apiBaseURL, extractNamespace(r.PP), cr.filter))
return filterResult(cr.or.Contracts().GetContractAPIs(cr.ctx, cr.apiBaseURL, cr.filter))
},
},
}
2 changes: 1 addition & 1 deletion internal/apiserver/route_get_contract_apis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestGetContractAPIs(t *testing.T) {
req.Header.Set("Content-Type", "application/json; charset=utf-8")
res := httptest.NewRecorder()

mcm.On("GetContractAPIs", mock.Anything, "http://127.0.0.1:5000/api/v1", "ns1", mock.Anything).
mcm.On("GetContractAPIs", mock.Anything, "http://127.0.0.1:5000/api/v1", mock.Anything).
Return([]*core.ContractAPI{}, nil, nil)
r.ServeHTTP(res, req)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ var getContractInterfaceNameVersion = &ffapi.Route{
Extensions: &coreExtensions{
CoreJSONHandler: func(r *ffapi.APIRequest, cr *coreRequest) (output interface{}, err error) {
if strings.EqualFold(r.QP["fetchchildren"], "true") {
return cr.or.Contracts().GetFFIWithChildren(cr.ctx, extractNamespace(r.PP), r.PP["name"], r.PP["version"])
return cr.or.Contracts().GetFFIWithChildren(cr.ctx, r.PP["name"], r.PP["version"])
}
return cr.or.Contracts().GetFFI(cr.ctx, extractNamespace(r.PP), r.PP["name"], r.PP["version"])
return cr.or.Contracts().GetFFI(cr.ctx, r.PP["name"], r.PP["version"])
},
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestGetContractInterfaceNameVersion(t *testing.T) {
req.Header.Set("Content-Type", "application/json; charset=utf-8")
res := httptest.NewRecorder()

mcm.On("GetFFI", mock.Anything, "ns1", "banana", "v1.0.0").
mcm.On("GetFFI", mock.Anything, "banana", "v1.0.0").
Return(&core.FFI{}, nil)
r.ServeHTTP(res, req)

Expand All @@ -57,7 +57,7 @@ func TestGetContractInterfaceNameVersionWithChildren(t *testing.T) {
req.Header.Set("Content-Type", "application/json; charset=utf-8")
res := httptest.NewRecorder()

mcm.On("GetFFIWithChildren", mock.Anything, "ns1", "banana", "v1.0.0").
mcm.On("GetFFIWithChildren", mock.Anything, "banana", "v1.0.0").
Return(&core.FFI{}, nil)
r.ServeHTTP(res, req)

Expand Down
2 changes: 1 addition & 1 deletion internal/apiserver/route_get_contract_interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var getContractInterfaces = &ffapi.Route{
Extensions: &coreExtensions{
FilterFactory: database.FFIQueryFactory,
CoreJSONHandler: func(r *ffapi.APIRequest, cr *coreRequest) (output interface{}, err error) {
return filterResult(cr.or.Contracts().GetFFIs(cr.ctx, extractNamespace(r.PP), cr.filter))
return filterResult(cr.or.Contracts().GetFFIs(cr.ctx, cr.filter))
},
},
}
2 changes: 1 addition & 1 deletion internal/apiserver/route_get_contract_interfaces_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestGetContractInterfaces(t *testing.T) {
req.Header.Set("Content-Type", "application/json; charset=utf-8")
res := httptest.NewRecorder()

mcm.On("GetFFIs", mock.Anything, "ns1", mock.Anything).
mcm.On("GetFFIs", mock.Anything, mock.Anything).
Return([]*core.FFI{}, nil, nil)
r.ServeHTTP(res, req)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var getContractListenerByNameOrID = &ffapi.Route{
JSONOutputCodes: []int{http.StatusOK},
Extensions: &coreExtensions{
CoreJSONHandler: func(r *ffapi.APIRequest, cr *coreRequest) (output interface{}, err error) {
return cr.or.Contracts().GetContractListenerByNameOrID(cr.ctx, extractNamespace(r.PP), r.PP["nameOrId"])
return cr.or.Contracts().GetContractListenerByNameOrID(cr.ctx, r.PP["nameOrId"])
},
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func TestGetContractListenerByNameOrID(t *testing.T) {
req.Header.Set("Content-Type", "application/json; charset=utf-8")
res := httptest.NewRecorder()

mcm.On("GetContractListenerByNameOrID", mock.Anything, "mynamespace", id.String()).
mcm.On("GetContractListenerByNameOrID", mock.Anything, id.String()).
Return(&core.ContractListener{}, nil)
r.ServeHTTP(res, req)

Expand Down
2 changes: 1 addition & 1 deletion internal/apiserver/route_get_contract_listener_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestGetContractListener(t *testing.T) {
req.Header.Set("Content-Type", "application/json; charset=utf-8")
res := httptest.NewRecorder()

mcm.On("GetContractListeners", mock.Anything, "mynamespace", mock.Anything).
mcm.On("GetContractListeners", mock.Anything, mock.Anything).
Return([]*core.ContractListener{}, nil, nil)
r.ServeHTTP(res, req)

Expand Down
2 changes: 1 addition & 1 deletion internal/apiserver/route_get_contract_listeners.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var getContractListeners = &ffapi.Route{
Extensions: &coreExtensions{
FilterFactory: database.ContractListenerQueryFactory,
CoreJSONHandler: func(r *ffapi.APIRequest, cr *coreRequest) (output interface{}, err error) {
return filterResult(cr.or.Contracts().GetContractListeners(cr.ctx, extractNamespace(r.PP), cr.filter))
return filterResult(cr.or.Contracts().GetContractListeners(cr.ctx, cr.filter))
},
},
}
2 changes: 1 addition & 1 deletion internal/apiserver/route_get_data_blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var getDataBlob = &ffapi.Route{
Extensions: &coreExtensions{
FilterFactory: database.MessageQueryFactory,
CoreJSONHandler: func(r *ffapi.APIRequest, cr *coreRequest) (output interface{}, err error) {
blob, reader, err := cr.or.Data().DownloadBlob(cr.ctx, extractNamespace(r.PP), r.PP["dataid"])
blob, reader, err := cr.or.Data().DownloadBlob(cr.ctx, r.PP["dataid"])
if err == nil {
r.ResponseHeaders.Set(core.HTTPHeadersBlobHashSHA256, blob.Hash.String())
if blob.Size > 0 {
Expand Down
2 changes: 1 addition & 1 deletion internal/apiserver/route_get_data_blob_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestGetDataBlob(t *testing.T) {
res := httptest.NewRecorder()

blobHash := fftypes.NewRandB32()
mdm.On("DownloadBlob", mock.Anything, "mynamespace", "abcd1234").
mdm.On("DownloadBlob", mock.Anything, "abcd1234").
Return(&core.Blob{
Hash: blobHash,
Size: 12345,
Expand Down
2 changes: 1 addition & 1 deletion internal/apiserver/route_get_subscription_by_id.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var getSubscriptionByID = &ffapi.Route{
JSONOutputCodes: []int{http.StatusOK},
Extensions: &coreExtensions{
CoreJSONHandler: func(r *ffapi.APIRequest, cr *coreRequest) (output interface{}, err error) {
output, err = cr.or.GetSubscriptionByID(cr.ctx, extractNamespace(r.PP), r.PP["subid"])
output, err = cr.or.GetSubscriptionByID(cr.ctx, r.PP["subid"])
return output, err
},
},
Expand Down
2 changes: 1 addition & 1 deletion internal/apiserver/route_get_subscription_by_id_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestGetSubscriptionByID(t *testing.T) {
req.Header.Set("Content-Type", "application/json; charset=utf-8")
res := httptest.NewRecorder()

o.On("GetSubscriptionByID", mock.Anything, "mynamespace", "abcd12345").
o.On("GetSubscriptionByID", mock.Anything, "abcd12345").
Return(&core.Subscription{}, nil)
r.ServeHTTP(res, req)

Expand Down
2 changes: 1 addition & 1 deletion internal/apiserver/route_get_subscriptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var getSubscriptions = &ffapi.Route{
Extensions: &coreExtensions{
FilterFactory: database.SubscriptionQueryFactory,
CoreJSONHandler: func(r *ffapi.APIRequest, cr *coreRequest) (output interface{}, err error) {
return filterResult(cr.or.GetSubscriptions(cr.ctx, extractNamespace(r.PP), cr.filter))
return filterResult(cr.or.GetSubscriptions(cr.ctx, cr.filter))
},
},
}
2 changes: 1 addition & 1 deletion internal/apiserver/route_get_subscriptions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestGetSubscriptions(t *testing.T) {
req.Header.Set("Content-Type", "application/json; charset=utf-8")
res := httptest.NewRecorder()

o.On("GetSubscriptions", mock.Anything, "mynamespace", mock.Anything).
o.On("GetSubscriptions", mock.Anything, mock.Anything).
Return([]*core.Subscription{}, nil, nil)
r.ServeHTTP(res, req)

Expand Down
2 changes: 1 addition & 1 deletion internal/apiserver/route_get_token_account_pools.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var getTokenAccountPools = &ffapi.Route{
Extensions: &coreExtensions{
FilterFactory: database.TokenAccountPoolQueryFactory,
CoreJSONHandler: func(r *ffapi.APIRequest, cr *coreRequest) (output interface{}, err error) {
return filterResult(cr.or.Assets().GetTokenAccountPools(cr.ctx, extractNamespace(r.PP), r.PP["key"], cr.filter))
return filterResult(cr.or.Assets().GetTokenAccountPools(cr.ctx, r.PP["key"], cr.filter))
},
},
}
2 changes: 1 addition & 1 deletion internal/apiserver/route_get_token_account_pools_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestGetTokenAccountPools(t *testing.T) {
req.Header.Set("Content-Type", "application/json; charset=utf-8")
res := httptest.NewRecorder()

mam.On("GetTokenAccountPools", mock.Anything, "ns1", "0x1", mock.Anything).
mam.On("GetTokenAccountPools", mock.Anything, "0x1", mock.Anything).
Return([]*core.TokenAccountPool{}, nil, nil)
r.ServeHTTP(res, req)

Expand Down
2 changes: 1 addition & 1 deletion internal/apiserver/route_get_token_accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var getTokenAccounts = &ffapi.Route{
Extensions: &coreExtensions{
FilterFactory: database.TokenAccountQueryFactory,
CoreJSONHandler: func(r *ffapi.APIRequest, cr *coreRequest) (output interface{}, err error) {
return filterResult(cr.or.Assets().GetTokenAccounts(cr.ctx, extractNamespace(r.PP), cr.filter))
return filterResult(cr.or.Assets().GetTokenAccounts(cr.ctx, cr.filter))
},
},
}
2 changes: 1 addition & 1 deletion internal/apiserver/route_get_token_accounts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestGetTokenAccounts(t *testing.T) {
req.Header.Set("Content-Type", "application/json; charset=utf-8")
res := httptest.NewRecorder()

mam.On("GetTokenAccounts", mock.Anything, "ns1", mock.Anything).
mam.On("GetTokenAccounts", mock.Anything, mock.Anything).
Return([]*core.TokenAccount{}, nil, nil)
r.ServeHTTP(res, req)

Expand Down
2 changes: 1 addition & 1 deletion internal/apiserver/route_get_token_approvals.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var getTokenApprovals = &ffapi.Route{
FilterFactory: database.TokenApprovalQueryFactory,
CoreJSONHandler: func(r *ffapi.APIRequest, cr *coreRequest) (output interface{}, err error) {
filter := cr.filter
return filterResult(cr.or.Assets().GetTokenApprovals(cr.ctx, extractNamespace(r.PP), filter))
return filterResult(cr.or.Assets().GetTokenApprovals(cr.ctx, filter))
},
},
}
2 changes: 1 addition & 1 deletion internal/apiserver/route_get_token_approvals_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestGetTokenApprovals(t *testing.T) {
req.Header.Set("Content-Type", "application/json; charset=utf-8")
res := httptest.NewRecorder()

mam.On("GetTokenApprovals", mock.Anything, "ns1", mock.Anything).
mam.On("GetTokenApprovals", mock.Anything, mock.Anything).
Return([]*core.TokenApproval{}, nil, nil)
r.ServeHTTP(res, req)

Expand Down
2 changes: 1 addition & 1 deletion internal/apiserver/route_get_token_balances.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var getTokenBalances = &ffapi.Route{
Extensions: &coreExtensions{
FilterFactory: database.TokenBalanceQueryFactory,
CoreJSONHandler: func(r *ffapi.APIRequest, cr *coreRequest) (output interface{}, err error) {
return filterResult(cr.or.Assets().GetTokenBalances(cr.ctx, extractNamespace(r.PP), cr.filter))
return filterResult(cr.or.Assets().GetTokenBalances(cr.ctx, cr.filter))
},
},
}
2 changes: 1 addition & 1 deletion internal/apiserver/route_get_token_balances_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestGetTokenBalances(t *testing.T) {
req.Header.Set("Content-Type", "application/json; charset=utf-8")
res := httptest.NewRecorder()

mam.On("GetTokenBalances", mock.Anything, "ns1", mock.Anything).
mam.On("GetTokenBalances", mock.Anything, mock.Anything).
Return([]*core.TokenBalance{}, nil, nil)
r.ServeHTTP(res, req)

Expand Down
2 changes: 1 addition & 1 deletion internal/apiserver/route_get_token_connectors.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var getTokenConnectors = &ffapi.Route{
JSONOutputCodes: []int{http.StatusOK},
Extensions: &coreExtensions{
CoreJSONHandler: func(r *ffapi.APIRequest, cr *coreRequest) (output interface{}, err error) {
return cr.or.Assets().GetTokenConnectors(cr.ctx, extractNamespace(r.PP)), nil
return cr.or.Assets().GetTokenConnectors(cr.ctx), nil
},
},
}
2 changes: 1 addition & 1 deletion internal/apiserver/route_get_token_connectors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestGetTokenConnectors(t *testing.T) {
req.Header.Set("Content-Type", "application/json; charset=utf-8")
res := httptest.NewRecorder()

mam.On("GetTokenConnectors", mock.Anything, "ns1", mock.Anything).
mam.On("GetTokenConnectors", mock.Anything, mock.Anything).
Return([]*core.TokenConnector{}, nil)
r.ServeHTTP(res, req)

Expand Down
2 changes: 1 addition & 1 deletion internal/apiserver/route_get_token_pools.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var getTokenPools = &ffapi.Route{
Extensions: &coreExtensions{
FilterFactory: database.TokenPoolQueryFactory,
CoreJSONHandler: func(r *ffapi.APIRequest, cr *coreRequest) (output interface{}, err error) {
return filterResult(cr.or.Assets().GetTokenPools(cr.ctx, extractNamespace(r.PP), cr.filter))
return filterResult(cr.or.Assets().GetTokenPools(cr.ctx, cr.filter))
},
},
}
2 changes: 1 addition & 1 deletion internal/apiserver/route_get_token_pools_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestGetTokenPools(t *testing.T) {
req.Header.Set("Content-Type", "application/json; charset=utf-8")
res := httptest.NewRecorder()

mam.On("GetTokenPools", mock.Anything, "ns1", mock.Anything).
mam.On("GetTokenPools", mock.Anything, mock.Anything).
Return([]*core.TokenPool{}, nil, nil)
r.ServeHTTP(res, req)

Expand Down
2 changes: 1 addition & 1 deletion internal/apiserver/route_get_token_transfer_by_id.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var getTokenTransferByID = &ffapi.Route{
JSONOutputCodes: []int{http.StatusOK},
Extensions: &coreExtensions{
CoreJSONHandler: func(r *ffapi.APIRequest, cr *coreRequest) (output interface{}, err error) {
output, err = cr.or.Assets().GetTokenTransferByID(cr.ctx, extractNamespace(r.PP), r.PP["transferId"])
output, err = cr.or.Assets().GetTokenTransferByID(cr.ctx, r.PP["transferId"])
return output, err
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestGetTokenTransferByID(t *testing.T) {
req.Header.Set("Content-Type", "application/json; charset=utf-8")
res := httptest.NewRecorder()

mam.On("GetTokenTransferByID", mock.Anything, "ns1", "id1").
mam.On("GetTokenTransferByID", mock.Anything, "id1").
Return(&core.TokenTransfer{}, nil)
r.ServeHTTP(res, req)

Expand Down
2 changes: 1 addition & 1 deletion internal/apiserver/route_get_token_transfers.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var getTokenTransfers = &ffapi.Route{
Condition(fb.Eq("from", fromOrTo)).
Condition(fb.Eq("to", fromOrTo)))
}
return filterResult(cr.or.Assets().GetTokenTransfers(cr.ctx, extractNamespace(r.PP), filter))
return filterResult(cr.or.Assets().GetTokenTransfers(cr.ctx, filter))
},
},
}
Loading