Skip to content

Commit

Permalink
fleshing out regeneration/refactor of app
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-forbes committed Sep 29, 2021
1 parent 18e69b5 commit 0a7a685
Show file tree
Hide file tree
Showing 24 changed files with 226 additions and 215 deletions.
17 changes: 14 additions & 3 deletions app/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import (
"sort"

"github.com/celestiaorg/celestia-app/x/payment/types"
abci "github.com/celestiaorg/celestia-core/abci/types"
core "github.com/celestiaorg/celestia-core/proto/tendermint/types"
sdk "github.com/cosmos/cosmos-sdk/types"
abci "github.com/tendermint/tendmint/abci/types"
"github.com/tendermint/tendmint/pkg/consts"
core "github.com/tendermint/tendmint/proto/tendermint/types"
)

// This file should contain all of the altered ABCI methods
Expand Down Expand Up @@ -88,7 +89,11 @@ func (app *App) PreprocessTxs(txs abci.RequestPreprocessTxs) abci.ResponsePrepro

func hasWirePayForMessage(tx sdk.Tx) bool {
for _, msg := range tx.GetMsgs() {
if msg.Type() == types.TypeMsgPayforMessage {
svcMsg, ok := msg.(sdk.ServiceMsg)
if !ok {
continue
}
if svcMsg.SerivceMethod == types.TypeMsgPayforMessage {
return true
}
}
Expand Down Expand Up @@ -142,3 +147,9 @@ func (app *App) processMsg(msg sdk.Msg) (core.Message, *types.TxSignedTransactio

return coreMsg, signedData, nil
}

// SquareSize returns the current square size. Currently, the square size is
// hardcoded. todo(evan): don't hardcode the square size
func (app *App) SquareSize() uint64 {
return consts.MaxSquareSize
}
6 changes: 3 additions & 3 deletions app/abci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ import (
"testing"

"github.com/celestiaorg/celestia-app/x/payment/types"
abci "github.com/celestiaorg/celestia-core/abci/types"
"github.com/celestiaorg/celestia-core/libs/log"
core "github.com/celestiaorg/celestia-core/proto/tendermint/types"
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
Expand All @@ -28,6 +25,9 @@ import (
"github.com/spf13/cast"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendmint/abci/types"
"github.com/tendermint/tendmint/libs/log"
core "github.com/tendermint/tendmint/proto/tendermint/types"
dbm "github.com/tendermint/tm-db"
)

Expand Down
Loading

0 comments on commit 0a7a685

Please sign in to comment.