Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix static check tests. #3005

Merged
merged 4 commits into from
Sep 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions services/horizon/internal/actions/claimable_balance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/stellar/go/support/errors"
"github.com/stellar/go/support/render/problem"
"github.com/stellar/go/xdr"
"github.com/stretchr/testify/assert"
)

func TestGetClaimableBalanceByID(t *testing.T) {
Expand Down Expand Up @@ -530,3 +531,10 @@ func TestGetClaimableBalances(t *testing.T) {
// )
// }
}

func TestClaimableBalancesQueryURLTemplate(t *testing.T) {
tt := assert.New(t)
expected := "/claimable_balances?{asset,claimant,sponsor}"
q := ClaimableBalancesQuery{}
tt.Equal(expected, q.URITemplate())
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//lint:file-ignore U1001 Ignore all unused code, staticcheck doesn't understand testify/suite
package processors

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//lint:file-ignore U1001 Ignore all unused code, staticcheck doesn't understand testify/suite
package processors

import (
Expand Down
17 changes: 0 additions & 17 deletions services/horizon/internal/test/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,23 +325,6 @@ func (i *IntegrationTest) CreateAccounts(count int) ([]*keypair.Full, []txnbuild
return pairs, accounts
}

// Establishes a trustline for a given asset for a particular account.
//
// Note: The function panics if this account doesn't exist in the ledger yet, so
// be sure to fund it before doing this.
func (i *IntegrationTest) EstablishTrustline(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @Shaptic will add later this in a different PR, but for now, since we don't use it, let's remove it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, this was used in the breaking claiming tests.

truster *keypair.Full, asset txnbuild.Asset,
) (proto.Transaction, error) {
request := sdk.AccountRequest{AccountID: truster.Address()}
account, err := i.Client().AccountDetail(request)
panicIf(err)

return i.SubmitOperations(&account, truster, &txnbuild.ChangeTrust{
Line: asset,
Limit: "2000",
})
}

// Submits a signed transaction from an account with standard options.
//
// Namely, we set the standard fee, time bounds, etc. to "non-production"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//lint:file-ignore U1001 Ignore all unused code, staticcheck doesn't understand testify/suite
package txnbuild

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//lint:file-ignore U1001 Ignore all unused code, staticcheck doesn't understand testify/suite
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general we don't care about this internal txnbuild copy - so i removed a bunch of unused files and file-ignore in the new ones. We'll use them as we add more integration tests, but it doesn't really matter since eventually we'll remove these files in favor of the actual txnbuild

package txnbuild

import (
Expand Down
39 changes: 0 additions & 39 deletions services/horizon/internal/txnbuild/cmd/demo/cmd/init.go

This file was deleted.

40 changes: 0 additions & 40 deletions services/horizon/internal/txnbuild/cmd/demo/cmd/reset.go

This file was deleted.

83 changes: 0 additions & 83 deletions services/horizon/internal/txnbuild/cmd/demo/cmd/root.go

This file was deleted.

40 changes: 0 additions & 40 deletions services/horizon/internal/txnbuild/cmd/demo/cmd/txerror.go

This file was deleted.

10 changes: 0 additions & 10 deletions services/horizon/internal/txnbuild/cmd/demo/main.go

This file was deleted.

Loading