Skip to content

Commit

Permalink
Fix static check tests. (#3005)
Browse files Browse the repository at this point in the history
* Ignore U1001 check in test files.

* Add test for ClaimableBalancesQueryURITemplate.

* Remove demo and example from internal txnbuild package.

* Fix static checks.
  • Loading branch information
abuiles authored Sep 15, 2020
1 parent 4c15c21 commit 8179679
Show file tree
Hide file tree
Showing 16 changed files with 14 additions and 863 deletions.
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(
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
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

0 comments on commit 8179679

Please sign in to comment.