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

Replace tendermint with lazyledger-core #13

Merged
merged 13 commits into from
Jan 21, 2021
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ sure you are aware of any relevant breaking changes.
* (types) [\#5533](https://github.com/cosmos/cosmos-sdk/pull/5533) Refactored `AppModuleBasic` and `AppModuleGenesis`
to now accept a `codec.JSONMarshaler` for modular serialization of genesis state.
* (types/rest) [\#5779](https://github.com/cosmos/cosmos-sdk/pull/5779) Drop unused Parse{Int64OrReturnBadRequest,QueryParamBool}() functions.
* [\#2](https://github.com/lazyledger/cosmos-sdk/issues/2) Add new abci method `PreprocessTxs` and remove `SetOption`.
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for even taking care of tracking changes 👍🏼 Should we keep our changes in a separate file instead?

* __Modules__
* (modules) [\#7243](https://github.com/cosmos/cosmos-sdk/pull/7243) Rename `RegisterCodec` to `RegisterLegacyAminoCodec` and `codec.New()` is now renamed to `codec.NewLegacyAmino()`
* (modules) [\#6564](https://github.com/cosmos/cosmos-sdk/pull/6564) Constant `DefaultParamspace` is removed from all modules, use ModuleName instead.
Expand Down Expand Up @@ -192,8 +193,8 @@ sure you are aware of any relevant breaking changes.
* (x/slashing) [\#6212](https://github.com/cosmos/cosmos-sdk/pull/6212) Remove `Get*` prefixes from key construction functions
* (server) [\#6079](https://github.com/cosmos/cosmos-sdk/pull/6079) Remove `UpgradeOldPrivValFile` (deprecated in Tendermint Core v0.28).
* [\#5719](https://github.com/cosmos/cosmos-sdk/pull/5719) Bump Go requirement to 1.14+


### State Machine Breaking

* __General__
Expand Down
22 changes: 14 additions & 8 deletions baseapp/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"time"

"github.com/gogo/protobuf/proto"
abci "github.com/tendermint/tendermint/abci/types"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
abci "github.com/lazyledger/lazyledger-core/abci/types"
tmproto "github.com/lazyledger/lazyledger-core/proto/tendermint/types"
"google.golang.org/grpc/codes"
grpcstatus "google.golang.org/grpc/status"

Expand Down Expand Up @@ -114,12 +114,6 @@ func (app *BaseApp) Info(req abci.RequestInfo) abci.ResponseInfo {
}
}

// SetOption implements the ABCI interface.
func (app *BaseApp) SetOption(req abci.RequestSetOption) (res abci.ResponseSetOption) {
// TODO: Implement!
return
}

// FilterPeerByAddrPort filters peers by address/port.
func (app *BaseApp) FilterPeerByAddrPort(info string) abci.ResponseQuery {
if app.addrPeerFilter != nil {
Expand Down Expand Up @@ -382,6 +376,18 @@ func (app *BaseApp) snapshot(height int64) {
}
}

// PreprocessTxs fullfills the lazyledger-core version of the ACBI interface,
// also proposed here https://github.com/tendermint/spec/issues/194. It allows
// for arbitrary processing steps before transaction data is included in the block.
// todo(evan): update documentation after implemented
func (app *BaseApp) PreprocessTxs(txs abci.RequestPreprocessTxs) abci.ResponsePreprocessTxs {
// TODO(evan): fully implement
Copy link
Member

Choose a reason for hiding this comment

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

You can link to the issue if you want: #5

// pass through txs w/o processing for now
return abci.ResponsePreprocessTxs{
Txs: txs.Txs,
}
}

// Query implements the ABCI interface. It delegates to CommitMultiStore if it
// implements Queryable.
func (app *BaseApp) Query(req abci.RequestQuery) (res abci.ResponseQuery) {
Expand Down
4 changes: 2 additions & 2 deletions baseapp/abci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"fmt"
"testing"

abci "github.com/lazyledger/lazyledger-core/abci/types"
tmprototypes "github.com/lazyledger/lazyledger-core/proto/tendermint/types"
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
tmprototypes "github.com/tendermint/tendermint/proto/tendermint/types"
dbm "github.com/tendermint/tm-db"

sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down
8 changes: 4 additions & 4 deletions baseapp/baseapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"strings"

"github.com/gogo/protobuf/proto"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/crypto/tmhash"
"github.com/tendermint/tendermint/libs/log"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
abci "github.com/lazyledger/lazyledger-core/abci/types"
"github.com/lazyledger/lazyledger-core/crypto/tmhash"
"github.com/lazyledger/lazyledger-core/libs/log"
tmproto "github.com/lazyledger/lazyledger-core/proto/tendermint/types"
dbm "github.com/tendermint/tm-db"

"github.com/cosmos/cosmos-sdk/codec/types"
Expand Down
26 changes: 23 additions & 3 deletions baseapp/baseapp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import (
"time"

"github.com/gogo/protobuf/jsonpb"
abci "github.com/lazyledger/lazyledger-core/abci/types"
"github.com/lazyledger/lazyledger-core/libs/log"
tmproto "github.com/lazyledger/lazyledger-core/proto/tendermint/types"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
dbm "github.com/tendermint/tm-db"

"github.com/cosmos/cosmos-sdk/codec"
Expand Down Expand Up @@ -2035,3 +2035,23 @@ func TestBaseApp_EndBlock(t *testing.T) {
require.Equal(t, int64(100), res.GetValidatorUpdates()[0].Power)
require.Equal(t, cp.Block.MaxGas, res.ConsensusParamUpdates.Block.MaxGas)
}

func TestBaseApp_PreprocessTxs(t *testing.T) {
// TODO(evan): fully implement baseapp and this test
name := t.Name()
db := dbm.NewMemDB()
logger := defaultLogger()
app := NewBaseApp(name, logger, db, nil)

app.InitChain(abci.RequestInitChain{})

mockTxs := abci.RequestPreprocessTxs{
Txs: [][]byte{
{
0, 1, 2, 3,
},
},
}
res := app.PreprocessTxs(mockTxs)
require.Equal(t, mockTxs.Txs, res.Txs)
}
2 changes: 1 addition & 1 deletion baseapp/grpcrouter.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"

gogogrpc "github.com/gogo/protobuf/grpc"
abci "github.com/tendermint/tendermint/abci/types"
abci "github.com/lazyledger/lazyledger-core/abci/types"
"google.golang.org/grpc"
"google.golang.org/grpc/encoding"
"google.golang.org/grpc/encoding/proto"
Expand Down
2 changes: 1 addition & 1 deletion baseapp/grpcrouter_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"

gogogrpc "github.com/gogo/protobuf/grpc"
abci "github.com/tendermint/tendermint/abci/types"
abci "github.com/lazyledger/lazyledger-core/abci/types"
"google.golang.org/grpc"

"github.com/cosmos/cosmos-sdk/codec/types"
Expand Down
2 changes: 1 addition & 1 deletion baseapp/grpcrouter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"os"
"testing"

"github.com/lazyledger/lazyledger-core/libs/log"
"github.com/stretchr/testify/require"
"github.com/tendermint/tendermint/libs/log"
dbm "github.com/tendermint/tm-db"

"github.com/cosmos/cosmos-sdk/baseapp"
Expand Down
6 changes: 3 additions & 3 deletions baseapp/msg_service_router_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"os"
"testing"

abci "github.com/lazyledger/lazyledger-core/abci/types"
"github.com/lazyledger/lazyledger-core/libs/log"
tmproto "github.com/lazyledger/lazyledger-core/proto/tendermint/types"
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
dbm "github.com/tendermint/tm-db"

"github.com/cosmos/cosmos-sdk/baseapp"
Expand Down
4 changes: 2 additions & 2 deletions baseapp/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"errors"
"fmt"

abci "github.com/tendermint/tendermint/abci/types"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
abci "github.com/lazyledger/lazyledger-core/abci/types"
tmproto "github.com/lazyledger/lazyledger-core/proto/tendermint/types"

sdk "github.com/cosmos/cosmos-sdk/types"
)
Expand Down
4 changes: 2 additions & 2 deletions baseapp/params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package baseapp_test
import (
"testing"

abci "github.com/lazyledger/lazyledger-core/abci/types"
tmproto "github.com/lazyledger/lazyledger-core/proto/tendermint/types"
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"

"github.com/cosmos/cosmos-sdk/baseapp"
)
Expand Down
2 changes: 1 addition & 1 deletion baseapp/queryrouter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/stretchr/testify/require"

abci "github.com/tendermint/tendermint/abci/types"
abci "github.com/lazyledger/lazyledger-core/abci/types"

sdk "github.com/cosmos/cosmos-sdk/types"
)
Expand Down
2 changes: 1 addition & 1 deletion baseapp/test_helpers.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package baseapp

import (
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
tmproto "github.com/lazyledger/lazyledger-core/proto/tendermint/types"

sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
Expand Down
4 changes: 2 additions & 2 deletions client/broadcast.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"
"strings"

"github.com/tendermint/tendermint/crypto/tmhash"
"github.com/tendermint/tendermint/mempool"
"github.com/lazyledger/lazyledger-core/crypto/tmhash"
"github.com/lazyledger/lazyledger-core/mempool"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

Expand Down
10 changes: 5 additions & 5 deletions client/broadcast_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import (
"fmt"
"testing"

"github.com/lazyledger/lazyledger-core/crypto/tmhash"
"github.com/lazyledger/lazyledger-core/mempool"
"github.com/lazyledger/lazyledger-core/rpc/client/mock"
ctypes "github.com/lazyledger/lazyledger-core/rpc/core/types"
tmtypes "github.com/lazyledger/lazyledger-core/types"
"github.com/stretchr/testify/require"
"github.com/tendermint/tendermint/crypto/tmhash"
"github.com/tendermint/tendermint/mempool"
"github.com/tendermint/tendermint/rpc/client/mock"
ctypes "github.com/tendermint/tendermint/rpc/core/types"
tmtypes "github.com/tendermint/tendermint/types"

"github.com/cosmos/cosmos-sdk/client/flags"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
Expand Down
4 changes: 2 additions & 2 deletions client/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"fmt"
"strings"

"github.com/lazyledger/lazyledger-core/libs/cli"
rpchttp "github.com/lazyledger/lazyledger-core/rpc/client/http"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/tendermint/tendermint/libs/cli"
rpchttp "github.com/tendermint/tendermint/rpc/client/http"

"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
Expand Down
2 changes: 1 addition & 1 deletion client/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"gopkg.in/yaml.v2"

"github.com/gogo/protobuf/proto"
rpcclient "github.com/lazyledger/lazyledger-core/rpc/client"
"github.com/pkg/errors"
rpcclient "github.com/tendermint/tendermint/rpc/client"

"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
Expand Down
6 changes: 2 additions & 4 deletions client/docs/statik/statik.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"strconv"

tmcli "github.com/lazyledger/lazyledger-core/libs/cli"
"github.com/spf13/cobra"
tmcli "github.com/tendermint/tendermint/libs/cli"

"github.com/cosmos/cosmos-sdk/crypto/keyring"
)
Expand Down
2 changes: 1 addition & 1 deletion client/grpc/reflection/reflection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"testing"

tmproto "github.com/lazyledger/lazyledger-core/proto/tendermint/types"
"github.com/stretchr/testify/suite"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client/grpc/reflection"
Expand Down
2 changes: 1 addition & 1 deletion client/grpc/tmservice/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package tmservice
import (
"context"

ctypes "github.com/tendermint/tendermint/rpc/core/types"
ctypes "github.com/lazyledger/lazyledger-core/rpc/core/types"

"github.com/cosmos/cosmos-sdk/client"
)
Expand Down
4 changes: 2 additions & 2 deletions client/grpc/tmservice/query.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/grpc/tmservice/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package tmservice
import (
"context"

ctypes "github.com/tendermint/tendermint/rpc/core/types"
ctypes "github.com/lazyledger/lazyledger-core/rpc/core/types"

"github.com/cosmos/cosmos-sdk/client"
)
Expand Down
2 changes: 1 addition & 1 deletion client/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strconv"

gogogrpc "github.com/gogo/protobuf/grpc"
abci "github.com/tendermint/tendermint/abci/types"
abci "github.com/lazyledger/lazyledger-core/abci/types"
"google.golang.org/grpc"
"google.golang.org/grpc/encoding"
"google.golang.org/grpc/encoding/proto"
Expand Down
2 changes: 1 addition & 1 deletion client/keys/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"sort"

bip39 "github.com/cosmos/go-bip39"
"github.com/lazyledger/lazyledger-core/libs/cli"
"github.com/spf13/cobra"
"github.com/tendermint/tendermint/libs/cli"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
Expand Down
2 changes: 1 addition & 1 deletion client/keys/add_ledger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/stretchr/testify/require"

"github.com/tendermint/tendermint/libs/cli"
"github.com/lazyledger/lazyledger-core/libs/cli"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
Expand Down
2 changes: 1 addition & 1 deletion client/keys/add_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/stretchr/testify/require"

"github.com/tendermint/tendermint/libs/cli"
"github.com/lazyledger/lazyledger-core/libs/cli"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
Expand Down
2 changes: 1 addition & 1 deletion client/keys/list.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package keys

import (
"github.com/lazyledger/lazyledger-core/libs/cli"
"github.com/spf13/cobra"
"github.com/tendermint/tendermint/libs/cli"

"github.com/cosmos/cosmos-sdk/client"
)
Expand Down
2 changes: 1 addition & 1 deletion client/keys/migrate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"fmt"
"testing"

"github.com/lazyledger/lazyledger-core/libs/cli"
"github.com/otiai10/copy"
"github.com/stretchr/testify/assert"
"github.com/tendermint/tendermint/libs/cli"

"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
Expand Down
2 changes: 1 addition & 1 deletion client/keys/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"io"
"strings"

"github.com/lazyledger/lazyledger-core/libs/cli"
"github.com/spf13/cobra"
"github.com/tendermint/tendermint/libs/cli"
yaml "gopkg.in/yaml.v2"

sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down
2 changes: 1 addition & 1 deletion client/keys/root.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package keys

import (
"github.com/lazyledger/lazyledger-core/libs/cli"
"github.com/spf13/cobra"
"github.com/tendermint/tendermint/libs/cli"

"github.com/cosmos/cosmos-sdk/client/flags"
)
Expand Down
Loading