Skip to content

Commit

Permalink
wip: fix some lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
rootulp committed Jul 9, 2024
1 parent 9e0f501 commit c120fd2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 27 deletions.
2 changes: 1 addition & 1 deletion blob/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"errors"
"fmt"
"slices"
"sync"

"github.com/cosmos/cosmos-sdk/types"
Expand All @@ -13,6 +12,7 @@ import (
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
"go.opentelemetry.io/otel/trace"
"slices"

"github.com/celestiaorg/go-square/shares"

Expand Down
22 changes: 1 addition & 21 deletions state/core_access.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"github.com/cosmos/cosmos-sdk/crypto/keyring"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdktypes "github.com/cosmos/cosmos-sdk/types"
sdktx "github.com/cosmos/cosmos-sdk/types/tx"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/cosmos/cosmos-sdk/x/feegrant"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
Expand Down Expand Up @@ -202,7 +201,7 @@ func (ca *CoreAccessor) SubmitPayForBlob(
if gas == 0 {
blobSizes := make([]uint32, len(appblobs))
for i, blob := range appblobs {
blobSizes[i] = uint32(len(blob.Data))
blobSizes[i] = uint32(len(blob.GetData()))
}
gas = estimateGasForBlobs(blobSizes)
}
Expand Down Expand Up @@ -651,22 +650,3 @@ func unsetTx(txResponse *TxResponse) *TxResponse {
}
return txResponse
}

// broadcastTx uses the provided grpc connection to broadcast a signed and
// encoded transaction.
func broadcastTx(
ctx context.Context,
conn *grpc.ClientConn,
mode sdktx.BroadcastMode,
txBytes []byte,
) (*sdktx.BroadcastTxResponse, error) {
txClient := sdktx.NewServiceClient(conn)

return txClient.BroadcastTx(
ctx,
&sdktx.BroadcastTxRequest{
Mode: mode,
TxBytes: txBytes,
},
)
}
2 changes: 1 addition & 1 deletion state/core_access_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func TestSubmitPayForBlob(t *testing.T) {
name: "good blob with user provided gas and fees",
blobs: []*squareblob.Blob{blobbyTheBlob},
gasPrice: 0.005,
gasLim: apptypes.DefaultEstimateGas([]uint32{uint32(len(blobbyTheBlob.Data))}),
gasLim: apptypes.DefaultEstimateGas([]uint32{uint32(len(blobbyTheBlob.GetData()))}),
expErr: nil,
},
// TODO: add more test cases. The problem right now is that the celestia-app doesn't
Expand Down
7 changes: 3 additions & 4 deletions state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
coretypes "github.com/tendermint/tendermint/types"

// apptypes "github.com/celestiaorg/celestia-app/x/blob/types"
squaretypes "github.com/celestiaorg/go-square/blob"
apptypes "github.com/celestiaorg/celestia-app/v2/x/blob/types"
)

// Balance is an alias to the Coin type from Cosmos-SDK.
Expand All @@ -27,8 +26,8 @@ type Address struct {
sdk.Address
}

// Blob is an alias of Blob from go-square.
type Blob = squaretypes.Blob
// Blob is an alias of Blob from celestia-app.
type Blob = apptypes.Blob

Check failure on line 30 in state/state.go

View workflow job for this annotation

GitHub Actions / go-ci / Lint

undefined: apptypes.Blob) (typecheck)

Check failure on line 30 in state/state.go

View workflow job for this annotation

GitHub Actions / go-ci / Lint

undefined: apptypes.Blob) (typecheck)

Check failure on line 30 in state/state.go

View workflow job for this annotation

GitHub Actions / go-ci / Lint

undefined: apptypes.Blob) (typecheck)

Check failure on line 30 in state/state.go

View workflow job for this annotation

GitHub Actions / go-ci / Lint

undefined: apptypes.Blob) (typecheck)

Check failure on line 30 in state/state.go

View workflow job for this annotation

GitHub Actions / go-ci / Lint

undefined: apptypes.Blob) (typecheck)

// ValAddress is an alias to the ValAddress type from Cosmos-SDK.
type ValAddress = sdk.ValAddress
Expand Down

0 comments on commit c120fd2

Please sign in to comment.