From 4995b6465b0f78a07c68faab8f12255cac7e8400 Mon Sep 17 00:00:00 2001 From: Willem Wyndham Date: Tue, 12 Sep 2023 12:27:43 -0400 Subject: [PATCH] fix: add back fund method --- cmd/soroban-rpc/internal/test/cli_test.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/cmd/soroban-rpc/internal/test/cli_test.go b/cmd/soroban-rpc/internal/test/cli_test.go index 38d3a32a3b..c84ddc50f4 100644 --- a/cmd/soroban-rpc/internal/test/cli_test.go +++ b/cmd/soroban-rpc/internal/test/cli_test.go @@ -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) @@ -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, @@ -257,5 +264,4 @@ func NewCLITest(t *testing.T) *Test { }) require.NoError(t, err) sendSuccessfulTransaction(t, client, sourceAccount, tx) - return test }