Skip to content

Commit

Permalink
Kien/merge picad to sdk 50 (#25)
Browse files Browse the repository at this point in the history
* implement custom transfer method for keeper.

* add param to new keeper call.

* call the default keeper Transfer instead of recursion.

* fix lint

* introduced v6_5_2 upgrade channel

* update datatype for min cosmos fee in tx to sdk.Coin

* introduce v6_5_3

* updating ibc-go

* fixes

* rename uprgade

* revert

* Change prefix to pica (ComposableFi#447)

* delete proposal #6

* use develop branch for ci

* use another image

* test

* removing more broken proposals

* introduce goreleaser

* remove separate gha for building docker images

* rename registry owner

* clean comments

* use version with v

* add additional tags

* fix org

* update docker image

* added jq

* introduce ibc transfer custom module

* custom ibc transfer module ready to replace for testing.

* activate custom ibc module for cosmos chain. chain works.

* added ibc transfer module that is going to store all params for eth fees

* resolve conflict with a same name for MsgUpdateEpochParams from staking.

* add dependency to transfer keeper from ibc transfer middleware/params

* added repeated FeeItem into Params + MVP logic in transfer msg server

* finalized the Transfer method. send fee to fee. build. chain works.

* only useful params in genesis for ibc transfer module. Works

* golangci-lint run

* slashing fixes

* remove unused types in proto

* add docs and fix all requested changes by reviewers

* review fixes

* fix tests

* local setup

* allow devnet with custom key gov

* relay from master

* porting fix from v7

* refactoring.

* add runtime upgrade handler. for ibc fee feature.

* upgrade merged. BankKeeper + GovKeeper + IbcTransferMiddlewareKeeper

* Revert "Merge pull request ComposableFi#451 from ComposableFi/slashing_fix"

This reverts commit 1ad4293, reversing
changes made to 85e2bf9.

* revert banksy changes to resolve halted chain.

* Revert "allow devnet with custom key gov"

This reverts commit 2457d87.

* create a new chain upgrade handler for chain upgrade.

* chore: change centaurid -> picad and prefix name to pica

* chore: update name prefix

* refactor: remove old upgrade

* refactor: update prefix

* refactor: update prefix

* test: change govAuthorityAddress

* ci: rollback

* wip

* feat: add script upgrade_test

* chore: update script

* wip

* refactor: remove set prefix

* refactor: update test

* chore: rollback

* chore: ignore build folder

* perf: make blocktime run faster

* fix: use key with balances

* chore: ignore screen log

* refactor: using default flag for test

* test: increment and assert counter value to be equal 1

* chore: rollback

* chore: rollback script

* test: add script upgrade

* fix: correct upgrade height

* feat: add post scripts

* test: assertion for post scripts

* chore: stream unnecessary output to null

* feat: add test for the new address

* wip

* chore: log for test upgrade

* test: completed ibc transfer

* verify affection of alliance module

* test/ica_migration

* add migration test for mint, ratelimit, ibc-hooks, transfermiddleware module

* finalize script upgrade test

* pick denom for testing as stake

* remove unused fnc

* modify testup

* fix unused fnc

* merge variable

* chore: remove release.yml

* refactor: change v6.4.6 -> v6.4.7

* feaT: migrate contract info

* test: assert contract info && code info

* fix: change repo secret name

* refactor: change v6.4.7 -> v6.4.8

* revert change version

* rebase and change conflict version

* merge from develop2

* feat: add v6_6_0 handler

* remove old upgrade

* fix lint

* fix lint

* fix test

* update script

* update address and ibc-go

* fix lint

* fix lint

---------

Co-authored-by: kkast <[email protected]>
Co-authored-by: Kanstantsin Kastsevich <[email protected]>
Co-authored-by: rjonczy <[email protected]>
Co-authored-by: rustdev <[email protected]>
Co-authored-by: rust.dev <[email protected]>
Co-authored-by: dzmitry-lahoda <[email protected]>
Co-authored-by: tungle <[email protected]>
Co-authored-by: kienn6034 <[email protected]>

* add scripts (ComposableFi#492)

* delete proposal #6

* use develop branch for ci

* use another image

* test

* removing more broken proposals

* introduce goreleaser

* remove separate gha for building docker images

* rename registry owner

* clean comments

* use version with v

* add additional tags

* fix org

* update docker image

* added jq

* introduce ibc transfer custom module

* custom ibc transfer module ready to replace for testing.

* activate custom ibc module for cosmos chain. chain works.

* added ibc transfer module that is going to store all params for eth fees

* resolve conflict with a same name for MsgUpdateEpochParams from staking.

* add dependency to transfer keeper from ibc transfer middleware/params

* added repeated FeeItem into Params + MVP logic in transfer msg server

* finalized the Transfer method. send fee to fee. build. chain works.

* only useful params in genesis for ibc transfer module. Works

* golangci-lint run

* slashing fixes

* remove unused types in proto

* add docs and fix all requested changes by reviewers

* review fixes

* fix tests

* local setup

* allow devnet with custom key gov

* relay from master

* porting fix from v7

* refactoring.

* add runtime upgrade handler. for ibc fee feature.

* upgrade merged. BankKeeper + GovKeeper + IbcTransferMiddlewareKeeper

* Revert "Merge pull request ComposableFi#451 from ComposableFi/slashing_fix"

This reverts commit 1ad4293, reversing
changes made to 85e2bf9.

* revert banksy changes to resolve halted chain.

* Revert "allow devnet with custom key gov"

This reverts commit 2457d87.

* create a new chain upgrade handler for chain upgrade.

* chore: change centaurid -> picad and prefix name to pica

* chore: update name prefix

* refactor: remove old upgrade

* refactor: update prefix

* refactor: update prefix

* test: change govAuthorityAddress

* ci: rollback

* wip

* feat: add script upgrade_test

* chore: update script

* wip

* refactor: remove set prefix

* refactor: update test

* chore: rollback

* chore: ignore build folder

* perf: make blocktime run faster

* fix: use key with balances

* chore: ignore screen log

* refactor: using default flag for test

* test: increment and assert counter value to be equal 1

* chore: rollback

* chore: rollback script

* test: add script upgrade

* fix: correct upgrade height

* feat: add post scripts

* test: assertion for post scripts

* chore: stream unnecessary output to null

* feat: add test for the new address

* wip

* chore: log for test upgrade

* test: completed ibc transfer

* verify affection of alliance module

* test/ica_migration

* add migration test for mint, ratelimit, ibc-hooks, transfermiddleware module

* finalize script upgrade test

* pick denom for testing as stake

* remove unused fnc

* modify testup

* fix unused fnc

* merge variable

* chore: remove release.yml

* refactor: change v6.4.6 -> v6.4.7

* feaT: migrate contract info

* test: assert contract info && code info

* fix: change repo secret name

* refactor: change v6.4.7 -> v6.4.8

* revert change version

* rebase and change conflict version

* merge from develop2

* feat: add v6_6_0 handler

* remove old upgrade

* fix lint

* fix lint

* fix test

* update script

* update address and ibc-go

* fix lint

* fix lint

* feat: init deps

* Kien/e2e test migrate (#23)

* feat: run locanode and push wasm code

* feat: setup relayer

* feat: using ngit for repo with nix

* chore: update notes install deps

* feat: script to upgrade

* fix: upgrade scripts

* fix: init deps script

* fix/migration: wrong prefix relay addresS

* fix: migration transfermiddleware

* allow pica12smx2wdlyttvyzvzg54y2vnqwq2qjate0ww798 in local

* fix lint

---------

Co-authored-by: kkast <[email protected]>
Co-authored-by: Kanstantsin Kastsevich <[email protected]>
Co-authored-by: rjonczy <[email protected]>
Co-authored-by: rustdev <[email protected]>
Co-authored-by: rust.dev <[email protected]>
Co-authored-by: dzmitry-lahoda <[email protected]>
Co-authored-by: tungle <[email protected]>
Co-authored-by: kienn6034 <[email protected]>

* update gitignore

* update gitignore (ComposableFi#493)

* refactor: remove before release testnet

* update ibc-go version update ibc-go version

* fix releaser

* chore: bech32 migration script to sdk 50

* feat: sync sdk 50

* fix: scripts to deploy pica node

* feat: add todo

* fix: running pica node

* chore: update

* deps: correct version to psuh wasm code

* test: upgrade chain successfully

---------

Co-authored-by: rustdev <[email protected]>
Co-authored-by: rust.dev <[email protected]>
Co-authored-by: kkast <[email protected]>
Co-authored-by: Kanstantsin Kastsevich <[email protected]>
Co-authored-by: Hoa Nguyen <[email protected]>
Co-authored-by: rjonczy <[email protected]>
Co-authored-by: dzmitry-lahoda <[email protected]>
Co-authored-by: tungle <[email protected]>
  • Loading branch information
9 people authored Apr 25, 2024
1 parent 13f953e commit ef93f95
Show file tree
Hide file tree
Showing 56 changed files with 1,115 additions and 601 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/interchaintest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
password: ${{ secrets.GHCR_PAT }}
- name: Build and push
id: build_push_image
uses: docker/build-push-action@v3
Expand Down
10 changes: 7 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ dist/

# Test binary, built with `go test -c`
*.test

# Test data
data/*
# Output of the go coverage tool, specifically when used with LiteIDE
*.out

Expand All @@ -48,8 +49,11 @@ vendor
go.work
go.work.sum

_build/

_build
mytestnet/

screenlog.0
mytestnet
.idea
node_modules

10 changes: 5 additions & 5 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# .goreleaser.yml

project_name: centaurid
project_name: picad

env:
- CGO_ENABLED=1

builds:
- id: linux
main: ./cmd/centaurid
binary: centaurid
main: ./cmd/picad
binary: picad
hooks:
pre:
- cmd: bash scripts/release_pre_linux.sh
Expand All @@ -28,8 +28,8 @@ builds:
- -mod=readonly
- -trimpath
ldflags:
- -X github.com/cosmos/cosmos-sdk/version.Name=centauri
- -X github.com/cosmos/cosmos-sdk/version.AppName=centaurid
- -X github.com/cosmos/cosmos-sdk/version.Name=pica
- -X github.com/cosmos/cosmos-sdk/version.AppName=picad
- -X github.com/cosmos/cosmos-sdk/version.Version={{ .Version }}
- -X github.com/cosmos/cosmos-sdk/version.Commit={{ .Commit }}
- -X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger,muslc"
Expand Down
24 changes: 12 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN apk add --no-cache \
linux-headers

# Download go dependencies
WORKDIR /centauri
WORKDIR /pica
COPY go.mod go.sum ./
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
Expand All @@ -36,30 +36,30 @@ RUN set -eux; \
# Copy the remaining files
COPY . .

# Build centaurid binary
# Build picad binary
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
GOWORK=off go build \
-mod=readonly \
-tags "netgo,ledger,muslc" \
-ldflags \
"-X github.com/cosmos/cosmos-sdk/version.Name="centauri" \
-X github.com/cosmos/cosmos-sdk/version.AppName="centaurid" \
"-X github.com/cosmos/cosmos-sdk/version.Name="pica" \
-X github.com/cosmos/cosmos-sdk/version.AppName="picad" \
-X github.com/cosmos/cosmos-sdk/version.Version=${GIT_VERSION} \
-X github.com/cosmos/cosmos-sdk/version.Commit=${GIT_COMMIT} \
-X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger,muslc \
-w -s -linkmode=external -extldflags '-Wl,-z,muldefs -static'" \
-trimpath \
-o /centauri/build/centaurid \
/centauri/cmd/centaurid
-o /pica/build/picad \
/pica/cmd/picad


# --------------------------------------------------------
# toolkit
# --------------------------------------------------------

FROM busybox:1.35.0-uclibc as busybox
RUN addgroup --gid 1025 -S composable && adduser --uid 1025 -S composable -G composable
RUN addgroup --gid 1025 -S pica && adduser --uid 1025 -S pica -G pica


# --------------------------------------------------------
Expand All @@ -69,14 +69,14 @@ FROM ${RUNNER_IMAGE}

COPY --from=busybox:1.35.0-uclibc /bin/sh /bin/sh

COPY --from=builder /centauri/build/centaurid /bin/centaurid
COPY --from=builder /pica/build/picad /bin/picad

# Install composable user
COPY --from=busybox /etc/passwd /etc/passwd
COPY --from=busybox --chown=1025:1025 /home/composable /home/composable
COPY --from=busybox --chown=1025:1025 /home/pica /home/pica

WORKDIR /home/composable
USER composable
WORKDIR /home/pica
USER pica

# rest server
EXPOSE 1317
Expand All @@ -87,4 +87,4 @@ EXPOSE 26657
# grpc
EXPOSE 9090

ENTRYPOINT ["centaurid"]
ENTRYPOINT ["picad"]
18 changes: 9 additions & 9 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN apk add --no-cache \
linux-headers

# Download go dependencies
WORKDIR /centauri
WORKDIR /pica
COPY go.mod go.sum ./

# Cosmwasm - Download correct libwasmvm version
Expand All @@ -33,34 +33,34 @@ RUN set -eux; \
# Copy the remaining files
COPY . .

# Build centaurid binary
# Build picad binary
RUN GOWORK=off go build \
-mod=readonly \
-tags "netgo,ledger,muslc" \
-ldflags \
"-X github.com/cosmos/cosmos-sdk/version.Name="centauri" \
-X github.com/cosmos/cosmos-sdk/version.AppName="centaurid" \
"-X github.com/cosmos/cosmos-sdk/version.Name="pica" \
-X github.com/cosmos/cosmos-sdk/version.AppName="picad" \
-X github.com/cosmos/cosmos-sdk/version.Version=${GIT_VERSION} \
-X github.com/cosmos/cosmos-sdk/version.Commit=${GIT_COMMIT} \
-X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger,muslc \
-w -s -linkmode=external -extldflags '-Wl,-z,muldefs -static'" \
-trimpath \
-o /centauri/build/centaurid \
/centauri/cmd/centaurid
-o /pica/build/picad \
/pica/cmd/picad

# --------------------------------------------------------
# Runner
# --------------------------------------------------------

FROM ${RUNNER_IMAGE}

COPY --from=builder /centauri/build/centaurid /bin/centaurid
COPY --from=builder /pica/build/picad /bin/picad

ENV HOME /centauri
ENV HOME /pica

WORKDIR $HOME

COPY scripts/* /centauri/
COPY scripts/* /pica/
# rest server
EXPOSE 1317
# tendermint p2p
Expand Down
50 changes: 44 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ comma := ,
build_tags_comma_sep := $(subst $(whitespace),$(comma),$(build_tags))

# process linker flags
ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=centauri \
-X github.com/cosmos/cosmos-sdk/version.AppName=centaurid \
ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=pica \
-X github.com/cosmos/cosmos-sdk/version.AppName=picad \
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \
-X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)"
Expand All @@ -86,18 +86,18 @@ endif
all: install

install: go.sum
go install -mod=readonly $(BUILD_FLAGS) ./cmd/centaurid
go install -mod=readonly $(BUILD_FLAGS) ./cmd/picad

build:
go build $(BUILD_FLAGS) -o bin/centaurid ./cmd/centaurid
go build $(BUILD_FLAGS) -o bin/picad ./cmd/picad

docker-build-debug:
@DOCKER_BUILDKIT=1 docker build -t centauri:local -f Dockerfile .
@DOCKER_BUILDKIT=1 docker build -t centauri:debug -f Dockerfile .

lint:
@find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -name '*.pb.go' -not -name '*.gw.go' | xargs go run mvdan.cc/gofumpt -w .
@find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -name '*.pb.go' -not -name '*.gw.go' | xargs go run github.com/client9/misspell/cmd/misspell -w
@find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -name '*.pb.go' -not -name '*.gw.go' | xargs go run golang.org/x/tools/cmd/goimports -w -local github.com/notional-labs/centauri
@find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -name '*.pb.go' -not -name '*.gw.go' | xargs go run golang.org/x/tools/cmd/goimports -w -local github.com/notional-labs/pica
.PHONY: lint

###############################################################################
Expand Down Expand Up @@ -156,6 +156,21 @@ ictest-all: ictest-start-cosmos ictest-start-polkadot ictest-ibc
ictest-push-wasm:
cd tests/interchaintest && go test -race -v -run TestPushWasmClientCode .

# Init 2 cosmos chains and setup ibc between them
init-test-interchain: clean-testing-data install
./scripts/test-upgrade-cosmos-chains.sh

### Upgrade Test ###
test-upgrade: clean-testing-data
@echo "Starting upgrade test"
./scripts/test-upgrade.sh

clean-testing-data:
@echo "Killing binary and removing previous data"
-@pkill picad 2>/dev/null
-@pkill rly 2>/dev/null
-@rm -rf ./mytestnet

.PHONY: ictest-start-cosmos ictest-start-polkadot ictest-ibc ictest-push-wasm ictest-all

include contrib/make/release.mk
Expand All @@ -169,5 +184,28 @@ test-upgrade: clean-testing-data
clean-testing-data:
@echo "Killing binary and removing previous data"
-@pkill centaurid 2>/dev/null
-@pkill picad 2>/dev/null
-@rm -rf ./screenlog.0
-@rm -rf ./mytestnet

## Scripts for testing sdk 50
init-deps:
@echo "Installing dependencies"
bash ./scripts/upgrade/init-deps.sh

localnet-pica: clean-testing-data
@echo "Starting localnet"
bash ./scripts/upgrade/setup-old-picad-node.sh

localnet-picasso:
@echo "Starting localnet"
bash ./scripts/upgrade/setup-polkadot-node.sh

relayer-start:
@echo "Starting relayer"
bash ./scripts/upgrade/setup-relayer.sh

pica-upgrade:
@echo "Starting upgrade"
bash ./scripts/upgrade/upgrade.sh

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Centauri
# Pica
Cosmos blockchain with IBC-v7 and wasm client enable.

## Hardware Recommendation
Expand All @@ -13,7 +13,7 @@ Requires [Go 1.20](https://go.dev/doc/install) or higher.

```bash
make install
centaurid version
picad version
```
Then you can run a node with a single command.

Expand Down
5 changes: 2 additions & 3 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services"
authcodec "github.com/cosmos/cosmos-sdk/x/auth/codec"
"github.com/notional-labs/composable/v6/app/upgrades/v6_5_1"
"io"
"os"
"path/filepath"
Expand Down Expand Up @@ -153,7 +152,7 @@ var (
// https://github.com/CosmWasm/wasmd/blob/02a54d33ff2c064f3539ae12d75d027d9c665f05/x/wasm/internal/types/proposal.go#L28-L34
EnableSpecificProposals = ""

Upgrades = []upgrades.Upgrade{v6_5_1.Upgrade, v7_0_1.Upgrade}
Upgrades = []upgrades.Upgrade{v7_0_1.Upgrade}
Forks = []upgrades.Fork{}
)

Expand Down Expand Up @@ -814,4 +813,4 @@ func (app *ComposableApp) AutoCliOpts() autocli.AppOptions {
ValidatorAddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ValidatorAddrPrefix()),
ConsensusAddressCodec: authcodec.NewBech32Codec(sdk.GetConfig().GetBech32ConsensusAddrPrefix()),
}
}
}
22 changes: 13 additions & 9 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package keepers

import (
"fmt"
"github.com/cosmos/cosmos-sdk/x/params"
"math"
"path/filepath"
"strings"

"github.com/cosmos/cosmos-sdk/x/params"

circuitkeeper "cosmossdk.io/x/circuit/keeper"
circuittypes "cosmossdk.io/x/circuit/types"
icacontrollertypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types"
Expand Down Expand Up @@ -121,7 +122,7 @@ import (

const (
AccountAddressPrefix = "composable"
authorityAddress = "centauri10556m38z4x6pqalr9rl5ytf3cff8q46nk85k9m" // convert from: centauri10556m38z4x6pqalr9rl5ytf3cff8q46nk85k9m
authorityAddress = "pica10556m38z4x6pqalr9rl5ytf3cff8q46nf36090" // convert from: centauri10556m38z4x6pqalr9rl5ytf3cff8q46nk85k9m
)

type AppKeepers struct {
Expand Down Expand Up @@ -211,12 +212,11 @@ func (appKeepers *AppKeepers) InitNormalKeepers(

appKeepers.StakingMiddlewareKeeper = stakingmiddleware.NewKeeper(appCodec, appKeepers.keys[stakingmiddlewaretypes.StoreKey], govModAddress)
appKeepers.IbcTransferMiddlewareKeeper = ibctransfermiddleware.NewKeeper(appCodec, appKeepers.keys[ibctransfermiddlewaretypes.StoreKey], govModAddress,
[]string{"centauri1ay9y5uns9khw2kzaqr3r33v2pkuptfnnr93j5j",
"centauri14lz7gaw92valqjearnye4shex7zg2p05mlx9q0",
"centauri1r2zlh2xn85v8ljmwymnfrnsmdzjl7k6w6lytan",
"centauri10556m38z4x6pqalr9rl5ytf3cff8q46nk85k9m",
// "centauri1wkjvpgkuchq0r8425g4z4sf6n85zj5wtmqzjv9",
// "centauri1hj5fveer5cjtn4wd6wstzugjfdxzl0xpzxlwgs",
[]string{
"pica1ay9y5uns9khw2kzaqr3r33v2pkuptfnnunlt5x",
"pica14lz7gaw92valqjearnye4shex7zg2p05yfguqm",
"pica1r2zlh2xn85v8ljmwymnfrnsmdzjl7k6w9f2ja8",
"pica10556m38z4x6pqalr9rl5ytf3cff8q46nf36090",
})

appKeepers.StakingKeeper = customstaking.NewKeeper(
Expand Down Expand Up @@ -458,12 +458,16 @@ func (appKeepers *AppKeepers) InitNormalKeepers(

vm, err := wasmvm.NewVM(wasmDataDir, wasmSupportedFeatures, wasmMemoryLimitMb, wasmPrintDebug, wasmCacheSizeMb)

if err != nil {
panic(err)
}

// use same VM for wasm
appKeepers.Wasm08Keeper = wasm08Keeper.NewKeeperWithVM(
appCodec,
runtime.NewKVStoreService(appKeepers.keys[wasm08types.StoreKey]),
&appKeepers.IBCKeeper.ClientKeeper,
"centauri1hj5fveer5cjtn4wd6wstzugjfdxzl0xpzxlwgs",
authorityAddress,
vm,
bApp.GRPCQueryRouter(),
)
Expand Down
23 changes: 23 additions & 0 deletions app/mock.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package app

import (
"github.com/cometbft/cometbft/crypto"
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
"github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
)

// PV implements PrivValidator without any safety or persistence.
// Only use it for testing.
type PV struct {
PrivKey cryptotypes.PrivKey
}

func NewPV() PV {
return PV{ed25519.GenPrivKey()}
}

// GetPubKey implements PrivValidator interface
func (pv PV) GetPubKey() (crypto.PubKey, error) {
return cryptocodec.ToTmPubKeyInterface(pv.PrivKey.PubKey())
}
Loading

0 comments on commit ef93f95

Please sign in to comment.