Skip to content

Commit

Permalink
Fixes state interfaces for model info.
Browse files Browse the repository at this point in the history
Updating modelinfo state interfaces to match the new method definition
for model state.
  • Loading branch information
tlm committed May 29, 2024
1 parent dedb4b8 commit 15c4d24
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions domain/model/service/modelservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type ModelState interface {

// ModelGetterState represents the state required for reading all model information.
type ModelGetterState interface {
Get(context.Context, coremodel.UUID) (coremodel.Model, error)
GetModel(context.Context, coremodel.UUID) (coremodel.Model, error)
}

// ModelService defines a service for interacting with the underlying model
Expand Down Expand Up @@ -65,7 +65,7 @@ func (s *ModelService) CreateModel(
ctx context.Context,
controllerUUID uuid.UUID,
) error {
m, err := s.modelGetterSt.Get(ctx, s.modelID)
m, err := s.modelGetterSt.GetModel(ctx, s.modelID)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion domain/model/service/modelservice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (d *dummyModelState) Create(ctx context.Context, args model.ReadOnlyModelCr
return nil
}

func (d *dummyModelState) Get(ctx context.Context, id coremodel.UUID) (coremodel.Model, error) {
func (d *dummyModelState) GetModel(ctx context.Context, id coremodel.UUID) (coremodel.Model, error) {
args, exists := d.models[id]
if !exists {
return coremodel.Model{}, modelerrors.NotFound
Expand Down
2 changes: 1 addition & 1 deletion domain/modelconfig/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func SetModelConfig(
var m coremodel.Model
err = controller.StdTxn(ctx, func(ctx context.Context, tx *sql.Tx) error {
var err error
m, err = modelstate.Get(ctx, tx, modelID)
m, err = modelstate.GetModel(ctx, tx, modelID)
return err
})

Expand Down

0 comments on commit 15c4d24

Please sign in to comment.