Skip to content

Commit

Permalink
fix: add back fund method
Browse files Browse the repository at this point in the history
  • Loading branch information
willemneal committed Sep 12, 2023
1 parent cb25a0c commit 4995b64
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions cmd/soroban-rpc/internal/test/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,15 @@ func runCLICommand(t *testing.T, cmd string) *icmd.Result {
return icmd.RunCmd(c)
}

const MILLION string = "1000000"

func NewCLITest(t *testing.T) *Test {
test := NewTest(t)
fundAccount(t, test, testAccount(t, 0), MILLION)
return test
}

func fundAccount(t *testing.T, test *Test, account string, amount string) {
ch := jhttp.NewChannel(test.sorobanRPCURL(), nil)
client := jrpc2.NewClient(ch, nil)

Expand All @@ -246,8 +253,8 @@ func NewCLITest(t *testing.T) *Test {
},
IncrementSequenceNum: false,
Operations: []txnbuild.Operation{&txnbuild.CreateAccount{
Destination: "GDIY6AQQ75WMD4W46EYB7O6UYMHOCGQHLAQGQTKHDX4J2DYQCHVCR4W4",
Amount: "100000",
Destination: account,
Amount: amount,
}},
BaseFee: txnbuild.MinBaseFee,
Memo: nil,
Expand All @@ -257,5 +264,4 @@ func NewCLITest(t *testing.T) *Test {
})
require.NoError(t, err)
sendSuccessfulTransaction(t, client, sourceAccount, tx)
return test
}

0 comments on commit 4995b64

Please sign in to comment.