Skip to content

Commit dc11912

Browse files
committed
remove twin id from create farm
1 parent 5a2b959 commit dc11912

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

node-registrar/client/farm.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import (
1313

1414
var ErrorFarmNotFround = fmt.Errorf("failed to get requested farm from node regiatrar")
1515

16-
func (c RegistrarClient) CreateFarm(farmName string, twinID uint64, dedicated bool) (farmID uint64, err error) {
17-
return c.createFarm(farmName, twinID, dedicated)
16+
func (c RegistrarClient) CreateFarm(farmName string, dedicated bool) (farmID uint64, err error) {
17+
return c.createFarm(farmName, dedicated)
1818
}
1919

2020
func (c RegistrarClient) UpdateFarm(farmID uint64, opts ...UpdateFarmOpts) (err error) {
@@ -91,7 +91,7 @@ func UpdateFarmWithDedicated() UpdateFarmOpts {
9191
}
9292
}
9393

94-
func (c RegistrarClient) createFarm(farmName string, twinID uint64, dedicated bool) (farmID uint64, err error) {
94+
func (c RegistrarClient) createFarm(farmName string, dedicated bool) (farmID uint64, err error) {
9595
err = c.ensureTwinID()
9696
if err != nil {
9797
return farmID, errors.Wrap(err, "failed to ensure twin id")
@@ -104,7 +104,7 @@ func (c RegistrarClient) createFarm(farmName string, twinID uint64, dedicated bo
104104

105105
data := Farm{
106106
FarmName: farmName,
107-
TwinID: twinID,
107+
TwinID: c.twinID,
108108
Dedicated: dedicated,
109109
}
110110

node-registrar/client/farm_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ func TestCreateFarm(t *testing.T) {
3636

3737
t.Run("test create farm with status conflict", func(t *testing.T) {
3838
request = createFarmStatusConflict
39-
_, err = c.CreateFarm(farm.FarmName, farm.TwinID, farm.Dedicated)
39+
_, err = c.CreateFarm(farm.FarmName, farm.Dedicated)
4040
require.Error(err)
4141
})
4242

4343
t.Run("test create farm with status ok", func(t *testing.T) {
4444
request = createFarmStatusCreated
45-
result, err := c.CreateFarm(farm.FarmName, farm.TwinID, farm.Dedicated)
45+
result, err := c.CreateFarm(farm.FarmName, farm.Dedicated)
4646
require.NoError(err)
4747
require.Equal(farm.FarmID, result)
4848
})

0 commit comments

Comments
 (0)