diff --git a/integration/execution_layer_test.go b/integration/execution_layer_test.go index 7efb7aeaf06..af8635bb64a 100644 --- a/integration/execution_layer_test.go +++ b/integration/execution_layer_test.go @@ -35,16 +35,6 @@ func theInsurancePoolInitialBalanceForTheMarketsIs(amountstr string) error { return nil } -func theMakesADepositOfIntoTheAccount(trader, amountstr, asset string) error { - amount, _ := strconv.ParseUint(amountstr, 10, 0) - // row.0 = traderID, row.1 = amount to topup - - _, err := execsetup.collateral.Deposit( - context.Background(), trader, asset, amount, - ) - return err -} - func generalAccountForAssetBalanceIs(trader, asset, balancestr string) error { balance, _ := strconv.ParseUint(balancestr, 10, 0) acc, err := execsetup.broker.GetTraderGeneralAccount(trader, asset) diff --git a/integration/main_test.go b/integration/main_test.go index e1083095198..ae9270d83e3 100644 --- a/integration/main_test.go +++ b/integration/main_test.go @@ -62,7 +62,9 @@ func FeatureContext(s *godog.Suite) { s.Step(`^The "([^"]*)" withdraw "([^"]*)" from the "([^"]*)" account$`, func(owner, amountStr, asset string) error { return steps.WithdrawFromAccount(execsetup.collateral, owner, amountStr, asset) }) - s.Step(`^The "([^"]*)" makes a deposit of "([^"]*)" into the "([^"]*)" account$`, theMakesADepositOfIntoTheAccount) + s.Step(`^The "([^"]*)" makes a deposit of "([^"]*)" into the "([^"]*)" account$`, func(owner, amountstr, asset string) error { + return steps.DepositIntoAccount(execsetup.collateral, owner, amountstr, asset) + }) s.Step(`^"([^"]*)" general account for asset "([^"]*)" balance is "([^"]*)"$`, generalAccountForAssetBalanceIs) s.Step(`^"([^"]*)" have only one account per asset$`, func(owner string) error { return steps.HaveOnlyOneAccountPerAsset(execsetup.broker, owner) diff --git a/integration/steps/deposit_Into_account.go b/integration/steps/deposit_Into_account.go new file mode 100644 index 00000000000..0bb301a2b01 --- /dev/null +++ b/integration/steps/deposit_Into_account.go @@ -0,0 +1,16 @@ +package steps + +import ( + "context" + "strconv" + + "code.vegaprotocol.io/vega/collateral" +) + +func DepositIntoAccount(collateral *collateral.Engine, owner, amountstr, asset string) error { + amount, _ := strconv.ParseUint(amountstr, 10, 0) + _, err := collateral.Deposit( + context.Background(), owner, asset, amount, + ) + return err +}