Skip to content

Commit

Permalink
Merge branch 'develop' into upgrade/0.46.13
Browse files Browse the repository at this point in the history
  • Loading branch information
lumtis authored Aug 7, 2023
2 parents a31b1cc + 49fc568 commit 00b81cb
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Generated Go/OpenAPI to Match Protobuf
name: Generated Files are Updated
on:
pull_request:
branches:
Expand All @@ -17,14 +17,20 @@ jobs:
run: |
echo "$HOME/go/bin" >> $GITHUB_PATH
- name: Generate Go and OpenAPI
- name: Generate Go code from proto files
run: make proto

- name: Generate OpenAPI
run: make openapi

- name: Generate Module Documentation
run: make specs

- name: Check for changes
run: |
if git diff --exit-code --ignore-space-change --ignore-all-space --ignore-cr-at-eol; then
echo "Generated Go files are up-to-date."
else
echo "::error::Generated Go and/or OpenAPI files are not up-to-date. Please run 'make proto' locally and commit any changes."
echo "::error::Generated files are not up-to-date. Please run 'make generate' locally and commit any changes."
exit 1
fi
13 changes: 8 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -140,18 +140,21 @@ proto:
@find . -name '*.pb.go' -type f -delete
@echo "--> Generating new Go types from protocol buffer files"
@bash ./scripts/protoc-gen-go.sh
.PHONY: proto

openapi:
@echo "--> Generating OpenAPI specs"
@bash ./scripts/protoc-gen-openapi.sh

proto-format:
@bash ./scripts/proto-format.sh

.PHONY: proto
.PHONY: openapi

specs:
@echo "--> Generating module documentation"
@go run ./scripts/gen-spec.go
.PHONY: specs

generate: proto openapi specs
.PHONY: generate

###############################################################################
### Docker Images ###
###############################################################################
Expand Down
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ func New(
keys[fungibleModuleTypes.MemStoreKey],
app.GetSubspace(fungibleModuleTypes.ModuleName),
app.AccountKeeper,
*app.EvmKeeper,
app.EvmKeeper,
app.BankKeeper,
app.ZetaObserverKeeper,
)
Expand Down
2 changes: 1 addition & 1 deletion testutil/keeper/fungible.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func FungibleKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) {

bankkeeper := bankkeeper2.BaseKeeper{}
authkeeper := authkeeper2.AccountKeeper{}
evmKeeper := evmkeeper.Keeper{}
evmKeeper := &evmkeeper.Keeper{}
zetaObserverKeeper := zetaObserverModuleKeeper.Keeper{}
keeper := keeper.NewKeeper(
codec.NewProtoCodec(registry),
Expand Down
12 changes: 5 additions & 7 deletions x/fungible/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ package keeper
import (
"fmt"

storetypes "github.com/cosmos/cosmos-sdk/store/types"
"github.com/tendermint/tendermint/libs/log"

"github.com/cosmos/cosmos-sdk/codec"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
evmkeeper "github.com/evmos/ethermint/x/evm/keeper"
"github.com/tendermint/tendermint/libs/log"

"github.com/zeta-chain/zetacore/x/fungible/types"
)

Expand All @@ -20,7 +19,7 @@ type (
memKey storetypes.StoreKey
paramstore paramtypes.Subspace
authKeeper types.AccountKeeper
evmKeeper evmkeeper.Keeper
evmKeeper types.EVMKeeper
bankKeeper types.BankKeeper
zetaobserverKeeper types.ZetaObserverKeeper
}
Expand All @@ -32,7 +31,7 @@ func NewKeeper(
memKey storetypes.StoreKey,
ps paramtypes.Subspace,
authKeeper types.AccountKeeper,
evmKeeper evmkeeper.Keeper,
evmKeeper types.EVMKeeper,
bankKeeper types.BankKeeper,
zetacobservKeeper types.ZetaObserverKeeper,
) *Keeper {
Expand All @@ -42,7 +41,6 @@ func NewKeeper(
}

return &Keeper{

cdc: cdc,
storeKey: storeKey,
memKey: memKey,
Expand Down
24 changes: 23 additions & 1 deletion x/fungible/types/expected_keepers.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
package types

import (
"context"
"math/big"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/vm"
evmtypes "github.com/evmos/ethermint/x/evm/types"

"github.com/zeta-chain/zetacore/common"
zetaObserverTypes "github.com/zeta-chain/zetacore/x/observer/types"
)

// AccountKeeper defines the expected account keeper used for simulations (noalias)
type AccountKeeper interface {
GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI
// Methods imported from account should be defined here
GetSequence(ctx sdk.Context, addr sdk.AccAddress) (uint64, error)
GetModuleAccount(ctx sdk.Context, name string) types.ModuleAccountI
}
Expand Down Expand Up @@ -39,3 +45,19 @@ type ZetaObserverKeeper interface {
GetParams(ctx sdk.Context) (params zetaObserverTypes.Params)
GetCoreParamsByChainID(ctx sdk.Context, chainID int64) (params *zetaObserverTypes.CoreParams, found bool)
}

type EVMKeeper interface {
ChainID() *big.Int
GetBlockBloomTransient(ctx sdk.Context) *big.Int
GetLogSizeTransient(ctx sdk.Context) uint64
WithChainID(ctx sdk.Context)
SetBlockBloomTransient(ctx sdk.Context, bloom *big.Int)
SetLogSizeTransient(ctx sdk.Context, logSize uint64)
EstimateGas(c context.Context, req *evmtypes.EthCallRequest) (*evmtypes.EstimateGasResponse, error)
ApplyMessage(
ctx sdk.Context,
msg core.Message,
tracer vm.EVMLogger,
commit bool,
) (*evmtypes.MsgEthereumTxResponse, error)
}

0 comments on commit 00b81cb

Please sign in to comment.