Skip to content

Commit

Permalink
Merge branch 'fix/update-slinky' into fix/slinky-state
Browse files Browse the repository at this point in the history
  • Loading branch information
aljo242 committed May 13, 2024
2 parents 5101073 + e7ce8e7 commit b0942a1
Show file tree
Hide file tree
Showing 16 changed files with 246 additions and 195 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ release/
data
.mutagen.yml
vendor/
.testchains
1 change: 0 additions & 1 deletion .tool-versions

This file was deleted.

4 changes: 2 additions & 2 deletions Dockerfile.builder
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
# Cosmwasm - Download correct libwasmvm version
RUN WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm | cut -d ' ' -f 2) && \
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/libwasmvm_muslc.$(uname -m).a \
-O /lib/libwasmvm_muslc.a && \
-O /lib/libwasmvm_muslc.$(uname -m).a && \
# verify checksum
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/checksums.txt -O /tmp/checksums.txt && \
sha256sum /lib/libwasmvm_muslc.a | grep $(cat /tmp/checksums.txt | grep libwasmvm_muslc.$(uname -m) | cut -d ' ' -f 1)
sha256sum /lib/libwasmvm_muslc.$(uname -m).a | grep $(cat /tmp/checksums.txt | grep libwasmvm_muslc.$(uname -m) | cut -d ' ' -f 1)

# Copy the remaining files
COPY . .
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ distclean: clean


test: test-unit
@rm -rf ./.testchains

test-all: check test-race test-cover

test-unit:
Expand Down
7 changes: 5 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ func New(
// NOTE: we need staking feature here even if there is no staking module anymore because cosmwasm-std in the CosmWasm SDK requires this feature
// NOTE: cosmwasm_1_2 feature enables GovMsg::VoteWeighted, which doesn't work with Neutron, because it uses its own custom governance,
// however, cosmwasm_1_2 also enables WasmMsg::Instantiate2, which works as one could expect
supportedFeatures := "iterator,stargate,staking,neutron,cosmwasm_1_1,cosmwasm_1_2,cosmwasm_1_3,cosmwasm_1_4"
supportedFeatures := []string{"iterator", "stargate", "staking", "neutron", "cosmwasm_1_1", "cosmwasm_1_2", "cosmwasm_1_3", "cosmwasm_1_4", "cosmwasm_2_0"}

// register the proposal types
adminRouterLegacy := govv1beta1.NewRouter()
Expand Down Expand Up @@ -795,7 +795,10 @@ func New(
), wasmOpts...)

queryPlugins := wasmkeeper.WithQueryPlugins(
&wasmkeeper.QueryPlugins{Stargate: wasmkeeper.AcceptListStargateQuerier(wasmbinding.AcceptedStargateQueries(), app.GRPCQueryRouter(), appCodec)})
&wasmkeeper.QueryPlugins{
Stargate: wasmkeeper.AcceptListStargateQuerier(wasmbinding.AcceptedStargateQueries(), app.GRPCQueryRouter(), appCodec),
Grpc: wasmkeeper.AcceptListGrpcQuerier(wasmbinding.AcceptedStargateQueries(), app.GRPCQueryRouter(), appCodec),
})
wasmOpts = append(wasmOpts, queryPlugins)

app.WasmKeeper = wasmkeeper.NewKeeper(
Expand Down
7 changes: 5 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ require (
cosmossdk.io/x/upgrade v0.1.1
github.com/CosmWasm/wasmd v0.50.0
github.com/CosmWasm/wasmvm v1.5.2
github.com/CosmWasm/wasmvm/v2 v2.0.0
github.com/cometbft/cometbft v0.38.7
github.com/cosmos/admin-module v0.0.0-20220204080909-475a98e03f31
github.com/cosmos/cosmos-db v1.0.2
Expand Down Expand Up @@ -169,7 +170,7 @@ require (
github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.53.0 // indirect
github.com/prometheus/common v0.52.2 // indirect
github.com/prometheus/procfs v0.13.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
Expand Down Expand Up @@ -217,11 +218,13 @@ require (

replace (
github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0
github.com/CosmWasm/wasmd => github.com/neutron-org/wasmd v0.45.1-0.20240304172302-564e5d10417a
github.com/CosmWasm/wasmd => github.com/neutron-org/wasmd v0.45.1-0.20240501180153-d9bebe629e05
github.com/cosmos/admin-module => github.com/neutron-org/admin-module v1.0.2-0.20240402143659-7dcb4a8c2056
github.com/cosmos/cosmos-sdk => github.com/neutron-org/cosmos-sdk v0.50.0-beta.0.0.20240226131019-8efae68de5cc
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
github.com/prometheus/client_golang => github.com/prometheus/client_golang v1.18.0
github.com/prometheus/client_model => github.com/prometheus/client_model v0.6.0
github.com/prometheus/common => github.com/prometheus/common v0.47.0
github.com/prometheus/procfs => github.com/prometheus/procfs v0.12.0
github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
)
19 changes: 7 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/CosmWasm/wasmvm v1.5.2 h1:+pKB1Mz9GZVt1vadxB+EDdD1FOz3dMNjIKq/58/lrag=
github.com/CosmWasm/wasmvm v1.5.2/go.mod h1:Q0bSEtlktzh7W2hhEaifrFp1Erx11ckQZmjq8FLCyys=
github.com/CosmWasm/wasmvm/v2 v2.0.0 h1:IqNCI2G0mvs7K6ej17/I28805rVqnu+Y1cWDqIdwb08=
github.com/CosmWasm/wasmvm/v2 v2.0.0/go.mod h1:su9lg5qLr7adV95eOfzjZWkGiky8WNaNIHDr7Fpu7Ck=
github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4=
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ=
Expand Down Expand Up @@ -1205,8 +1207,8 @@ github.com/neutron-org/admin-module v1.0.2-0.20240402143659-7dcb4a8c2056 h1:mb3f
github.com/neutron-org/admin-module v1.0.2-0.20240402143659-7dcb4a8c2056/go.mod h1:di9iYm/L6fwGZXig6kNw8jCkCLfNdHo46UMcFgIbJUo=
github.com/neutron-org/cosmos-sdk v0.50.0-beta.0.0.20240226131019-8efae68de5cc h1:8Ci9jiKFhKQ1WdiMcwD/+Egygu+hr2XgzDA0Ngb4vnw=
github.com/neutron-org/cosmos-sdk v0.50.0-beta.0.0.20240226131019-8efae68de5cc/go.mod h1:UbShFs6P8Ly29xxJvkNGaNaL/UGj5a686NRtb1Cqra0=
github.com/neutron-org/wasmd v0.45.1-0.20240304172302-564e5d10417a h1:uH2grrTCu2xMIdlzoPUAhZ1HVM4jgay3oFxw07gXmIc=
github.com/neutron-org/wasmd v0.45.1-0.20240304172302-564e5d10417a/go.mod h1:MeEiOLBR9HoKCB/sR7jw22Puxf34/znekoRQvZIAZzg=
github.com/neutron-org/wasmd v0.45.1-0.20240501180153-d9bebe629e05 h1:HTf3tdocEy9MDElIe9wePm/P9A74cE/3gyIgnWvOGEc=
github.com/neutron-org/wasmd v0.45.1-0.20240501180153-d9bebe629e05/go.mod h1:7TSaj5HoolghujuVWeExqmcUKgpcYWEySGLSODbnnwY=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
Expand Down Expand Up @@ -1261,18 +1263,12 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk=
github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w=
github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI=
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY=
github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos=
github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8=
github.com/prometheus/common v0.47.0 h1:p5Cz0FNHo7SnWOmWmoRozVcjEp0bIVU8cV7OShpjL1k=
github.com/prometheus/common v0.47.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc=
github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o=
github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g=
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM=
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4=
Expand Down Expand Up @@ -1654,7 +1650,6 @@ golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand Down
1 change: 1 addition & 0 deletions proto/neutron/transfer/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ service Msg {
message MsgTransfer {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;
option (cosmos.msg.v1.signer) = "sender";

// the port on which the packet will be sent
string source_port = 1 [(gogoproto.moretags) = "yaml:\"source_port\""];
Expand Down
14 changes: 12 additions & 2 deletions testutil/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ import (
"encoding/json"
"fmt"
"os"
"path"
"testing"
"time"

tmrand "github.com/cometbft/cometbft/libs/rand"
"github.com/neutron-org/neutron/v4/utils"

"github.com/neutron-org/neutron/v4/app/config"

"cosmossdk.io/log"
Expand Down Expand Up @@ -280,6 +284,11 @@ func (suite *IBCConnectionTestSuite) SetupCCVChannels() {
}
}

func testHomeDir(chainID string) string {
projectRoot := utils.RootDir()
return path.Join(projectRoot, ".testchains", chainID)
}

// NewCoordinator initializes Coordinator with interchain security dummy provider and 2 neutron consumer chains
func NewProviderConsumerCoordinator(t *testing.T) *ibctesting.Coordinator {
coordinator := ibctesting.NewCoordinator(t, 0)
Expand All @@ -291,8 +300,8 @@ func NewProviderConsumerCoordinator(t *testing.T) *ibctesting.Coordinator {

_ = config.GetDefaultConfig()
sdk.SetAddrCacheEnabled(false)
ibctesting.DefaultTestingAppInit = SetupTestingApp(cmttypes.TM2PB.ValidatorUpdates(providerChain.Vals))
chainID = ibctesting.GetChainID(2)
ibctesting.DefaultTestingAppInit = SetupTestingApp(cmttypes.TM2PB.ValidatorUpdates(providerChain.Vals))
coordinator.Chains[chainID] = ibctesting.NewTestChainWithValSet(t, coordinator,
chainID, providerChain.Vals, providerChain.Signers)

Expand Down Expand Up @@ -409,13 +418,14 @@ func SetupTestingApp(initValUpdates []cometbfttypes.ValidatorUpdate) func() (ibc
return func() (ibctesting.TestingApp, map[string]json.RawMessage) {
encoding := app.MakeEncodingConfig()
db := db2.NewMemDB()
homePath := testHomeDir("testchain-" + tmrand.NewRand().Str(6))
testApp := app.New(
log.NewNopLogger(),
db,
nil,
false,
map[int64]bool{},
app.DefaultNodeHome,
homePath,
0,
encoding,
sims.EmptyAppOptions{},
Expand Down
12 changes: 11 additions & 1 deletion utils/generic_helper.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package utils

import "reflect"
import (
"path"
"reflect"
"runtime"
)

// MakeNew makes a new instance of generic T.
// if T is a pointer, makes a new instance of the underlying struct via reflection,
Expand All @@ -15,3 +19,9 @@ func MakeNew[T any]() T {

return *new(T) // v is not ptr, alloc with new
}

func RootDir() string {
_, b, _, _ := runtime.Caller(0) //nolint:dogsled
d := path.Join(path.Dir(b), "..")
return d
}
8 changes: 0 additions & 8 deletions wasmbinding/bindings/msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,6 @@ type SubmitTx struct {
Fee feetypes.Fee `json:"fee"`
}

// SubmitTxResponse holds response from SubmitTx.
type SubmitTxResponse struct {
// SequenceId is a channel's sequence_id for outgoing ibc packet. Unique per a channel.
SequenceId uint64 `json:"sequence_id"`
// Channel is a src channel on neutron side transaction was submitted from
Channel string `json:"channel"`
}

// RegisterInterchainAccount creates account on remote chain.
type RegisterInterchainAccount struct {
ConnectionId string `json:"connection_id"`
Expand Down
Loading

0 comments on commit b0942a1

Please sign in to comment.