Skip to content

Commit

Permalink
Merge pull request #93 from kaleido-io/publish-ffi-children
Browse files Browse the repository at this point in the history
Publish FFI with children
  • Loading branch information
nguyer authored Jan 9, 2024
2 parents 6f81ef0 + 6d35015 commit e4ef60d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion internal/definitions/sender_contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (ds *definitionSender) PublishFFI(ctx context.Context, name, version, netwo

var sender *sendWrapper
err = ds.database.RunAsGroup(ctx, func(ctx context.Context) error {
if ffi, err = ds.contracts.GetFFI(ctx, name, version); err != nil {
if ffi, err = ds.contracts.GetFFIWithChildren(ctx, name, version); err != nil {
return err
}
if ffi.Published {
Expand Down
10 changes: 5 additions & 5 deletions internal/definitions/sender_contracts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ func TestPublishFFI(t *testing.T) {
}

ds.mdi.On("GetFFIByNetworkName", context.Background(), "ns1", "ffi1-shared", "1.0").Return(nil, nil)
ds.mcm.On("GetFFI", context.Background(), "ffi1", "1.0").Return(ffi, nil)
ds.mcm.On("GetFFIWithChildren", context.Background(), "ffi1", "1.0").Return(ffi, nil)
ds.mcm.On("ResolveFFI", context.Background(), ffi).Return(nil)
ds.mim.On("GetRootOrg", context.Background()).Return(&core.Identity{
IdentityBase: core.IdentityBase{
Expand Down Expand Up @@ -392,7 +392,7 @@ func TestPublishFFIAlreadyPublished(t *testing.T) {
Published: true,
}

ds.mcm.On("GetFFI", context.Background(), "ffi1", "1.0").Return(ffi, nil)
ds.mcm.On("GetFFIWithChildren", context.Background(), "ffi1", "1.0").Return(ffi, nil)
mockRunAsGroupPassthrough(ds.mdi)

_, err := ds.PublishFFI(context.Background(), "ffi1", "1.0", "ffi1-shared", false)
Expand All @@ -404,7 +404,7 @@ func TestPublishFFIQueryFail(t *testing.T) {
defer ds.cleanup(t)
ds.multiparty = true

ds.mcm.On("GetFFI", context.Background(), "ffi1", "1.0").Return(nil, fmt.Errorf("pop"))
ds.mcm.On("GetFFIWithChildren", context.Background(), "ffi1", "1.0").Return(nil, fmt.Errorf("pop"))
mockRunAsGroupPassthrough(ds.mdi)

_, err := ds.PublishFFI(context.Background(), "ffi1", "1.0", "ffi1-shared", false)
Expand All @@ -423,7 +423,7 @@ func TestPublishFFIResolveFail(t *testing.T) {
Published: false,
}

ds.mcm.On("GetFFI", context.Background(), "ffi1", "1.0").Return(ffi, nil)
ds.mcm.On("GetFFIWithChildren", context.Background(), "ffi1", "1.0").Return(ffi, nil)
ds.mcm.On("ResolveFFI", context.Background(), ffi).Return(fmt.Errorf("pop"))
mockRunAsGroupPassthrough(ds.mdi)

Expand All @@ -446,7 +446,7 @@ func TestPublishFFIPrepareFail(t *testing.T) {
}

ds.mdi.On("GetFFIByNetworkName", context.Background(), "ns1", "ffi1-shared", "1.0").Return(nil, nil)
ds.mcm.On("GetFFI", context.Background(), "ffi1", "1.0").Return(ffi, nil)
ds.mcm.On("GetFFIWithChildren", context.Background(), "ffi1", "1.0").Return(ffi, nil)
ds.mcm.On("ResolveFFI", context.Background(), ffi).Return(nil)
ds.mim.On("GetRootOrg", context.Background()).Return(&core.Identity{
IdentityBase: core.IdentityBase{
Expand Down

0 comments on commit e4ef60d

Please sign in to comment.