Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Lockwarr committed Oct 16, 2024
1 parent e1bd44c commit 4f97507
Show file tree
Hide file tree
Showing 66 changed files with 1,298 additions and 306 deletions.
28 changes: 14 additions & 14 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,20 @@ import (
vestingskeeper "github.com/Nolus-Protocol/nolus-core/x/vestings/keeper"
vestingstypes "github.com/Nolus-Protocol/nolus-core/x/vestings/types"

"github.com/neutron-org/neutron/v4/x/contractmanager"
contractmanagermodulekeeper "github.com/neutron-org/neutron/v4/x/contractmanager/keeper"
contractmanagermoduletypes "github.com/neutron-org/neutron/v4/x/contractmanager/types"
"github.com/neutron-org/neutron/v4/x/feerefunder"
feerefunderkeeper "github.com/neutron-org/neutron/v4/x/feerefunder/keeper"
feetypes "github.com/neutron-org/neutron/v4/x/feerefunder/types"
"github.com/neutron-org/neutron/v4/x/interchainqueries"
interchainquerieskeeper "github.com/neutron-org/neutron/v4/x/interchainqueries/keeper"
interchainqueriestypes "github.com/neutron-org/neutron/v4/x/interchainqueries/types"
"github.com/neutron-org/neutron/v4/x/interchaintxs"
interchaintxskeeper "github.com/neutron-org/neutron/v4/x/interchaintxs/keeper"
interchaintxstypes "github.com/neutron-org/neutron/v4/x/interchaintxs/types"
transferSudo "github.com/neutron-org/neutron/v4/x/transfer"
wrapkeeper "github.com/neutron-org/neutron/v4/x/transfer/keeper"
"github.com/Nolus-Protocol/nolus-core/x/contractmanager"
contractmanagermodulekeeper "github.com/Nolus-Protocol/nolus-core/x/contractmanager/keeper"
contractmanagermoduletypes "github.com/Nolus-Protocol/nolus-core/x/contractmanager/types"
"github.com/Nolus-Protocol/nolus-core/x/feerefunder"
feerefunderkeeper "github.com/Nolus-Protocol/nolus-core/x/feerefunder/keeper"
feetypes "github.com/Nolus-Protocol/nolus-core/x/feerefunder/types"
"github.com/Nolus-Protocol/nolus-core/x/interchainqueries"
interchainquerieskeeper "github.com/Nolus-Protocol/nolus-core/x/interchainqueries/keeper"
interchainqueriestypes "github.com/Nolus-Protocol/nolus-core/x/interchainqueries/types"
"github.com/Nolus-Protocol/nolus-core/x/interchaintxs"
interchaintxskeeper "github.com/Nolus-Protocol/nolus-core/x/interchaintxs/keeper"
interchaintxstypes "github.com/Nolus-Protocol/nolus-core/x/interchaintxs/types"
transferSudo "github.com/Nolus-Protocol/nolus-core/x/transfer"
wrapkeeper "github.com/Nolus-Protocol/nolus-core/x/transfer/keeper"
)

type AppKeepers struct {
Expand Down
4 changes: 2 additions & 2 deletions proto/buf.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ deps:
- remote: buf.build
owner: cosmos
repository: cosmos-sdk
commit: 954f7b05f38440fc8250134b15adec47
digest: shake256:2ab4404fd04a7d1d52df0e2d0f2d477a3d83ffd88d876957bf3fedfd702c8e52833d65b3ce1d89a3c5adf2aab512616b0e4f51d8463f07eda9a8a3317ee3ac54
commit: 5a6ab7bc14314acaa912d5e53aef1c2f
digest: shake256:02c00c73493720055f9b57553a35b5550023a3c1914123b247956288a78fb913aff70e66552777ae14d759467e119079d484af081264a5dd607a94d9fbc8116b
- remote: buf.build
owner: cosmos
repository: gogo-proto
Expand Down
5 changes: 3 additions & 2 deletions proto/buf.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# cosmos-sdk pinned to v0.47.0 required for cosmos/gogoproto - https://github.com/cosmos/cosmos-sdk/blob/main/proto/README.md
# cosmos-sdk pinned to v0.50.0 required for cosmos/gogoproto - https://github.com/cosmos/cosmos-sdk/blob/main/proto/README.md
version: v1
name: buf.build/Nolus-Protocol/nolus-core
deps:
- buf.build/cosmos/cosmos-proto
- buf.build/cosmos/gogo-proto
- buf.build/cosmos/cosmos-sdk:v0.47.0
- buf.build/cosmos/cosmos-sdk:v0.50.0
- buf.build/googleapis/googleapis
- buf.build/cosmos/ibc
breaking:
Expand All @@ -21,6 +21,7 @@ lint:
- SERVICE_SUFFIX
- PACKAGE_VERSION_SUFFIX
- RPC_REQUEST_STANDARD_NAME
- PACKAGE_DIRECTORY_MATCH
ignore:
- tendermint

21 changes: 21 additions & 0 deletions proto/nolus/contractmanager/failure.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
syntax = "proto3";
package nolus.contractmanager;

import "ibc/core/channel/v1/channel.proto";

option go_package = "github.com/Nolus-Protocol/nolus-core/x/contractmanager/types";

// Failure message contains information about ACK failures and can be used to
// replay ACK in case of requirement.
// Note that Failure means that sudo handler to cosmwasm contract failed for
// some reason
message Failure {
// Address of the failed contract
string address = 1;
// Id of the failure under specific address
uint64 id = 2;
// Serialized MessageSudoCallback with Packet and Ack(if exists)
bytes sudo_payload = 3;
// Redacted error response of the sudo call. Full error is emitted as an event
string error = 4;
}
17 changes: 17 additions & 0 deletions proto/nolus/contractmanager/genesis.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
syntax = "proto3";
package nolus.contractmanager;

import "gogoproto/gogo.proto";
import "nolus/contractmanager/failure.proto";
import "nolus/contractmanager/params.proto";
// this line is used by starport scaffolding # genesis/proto/import

option go_package = "github.com/Nolus-Protocol/nolus-core/x/contractmanager/types";

// GenesisState defines the contractmanager module's genesis state.
message GenesisState {
Params params = 1 [(gogoproto.nullable) = false];
// List of the contract failures
repeated Failure failures_list = 2 [(gogoproto.nullable) = false];
// this line is used by starport scaffolding # genesis/proto/state
}
12 changes: 12 additions & 0 deletions proto/nolus/contractmanager/params.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
syntax = "proto3";
package nolus.contractmanager;

import "gogoproto/gogo.proto";

option go_package = "github.com/Nolus-Protocol/nolus-core/x/contractmanager/types";

// Params defines the parameters for the module.
message Params {
option (gogoproto.goproto_stringer) = false;
uint64 sudo_call_gas_limit = 1;
}
62 changes: 62 additions & 0 deletions proto/nolus/contractmanager/query.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
syntax = "proto3";
package nolus.contractmanager;

import "cosmos/base/query/v1beta1/pagination.proto";
import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "nolus/contractmanager/failure.proto";
import "nolus/contractmanager/params.proto";
// this line is used by starport scaffolding # 1

option go_package = "github.com/Nolus-Protocol/nolus-core/x/contractmanager/types";

// Query defines the gRPC querier service.
service Query {
// Parameters queries the parameters of the module.
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/nolus/contractmanager/params";
}

// Queries a Failure by contract address and failure ID.
rpc AddressFailure(QueryFailuresRequest) returns (QueryFailuresResponse) {
option (google.api.http).get = "/nolus/contractmanager/failures/{address}/{failure_id}";
}

// Queries Failures by contract address.
rpc AddressFailures(QueryFailuresRequest) returns (QueryFailuresResponse) {
option (google.api.http).get = "/nolus/contractmanager/failures/{address}";
}

// Queries a list of Failures occurred on the network.
rpc Failures(QueryFailuresRequest) returns (QueryFailuresResponse) {
option (google.api.http).get = "/nolus/contractmanager/failures";
}

// this line is used by starport scaffolding # 2
}

// QueryParamsRequest is request type for the Query/Params RPC method.
message QueryParamsRequest {}

// QueryParamsResponse is response type for the Query/Params RPC method.
message QueryParamsResponse {
// params holds all the parameters of this module.
Params params = 1 [(gogoproto.nullable) = false];
}

// QueryFailuresRequest is request type for the Query/Failures RPC method.
message QueryFailuresRequest {
// address of the contract which Sudo call failed.
string address = 1;
// ID of the failure for the given contract.
uint64 failure_id = 2;
cosmos.base.query.v1beta1.PageRequest pagination = 3;
}

// QueryFailuresResponse is response type for the Query/Failures RPC method.
message QueryFailuresResponse {
repeated Failure failures = 1 [(gogoproto.nullable) = false];
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

// this line is used by starport scaffolding # 3
45 changes: 45 additions & 0 deletions proto/nolus/contractmanager/tx.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
syntax = "proto3";
package nolus.contractmanager;

import "amino/amino.proto";
import "cosmos/msg/v1/msg.proto";
import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";
import "nolus/contractmanager/params.proto";

// this line is used by starport scaffolding # proto/tx/import

option go_package = "github.com/Nolus-Protocol/nolus-core/x/contractmanager/types";

// Msg defines the Msg service.
service Msg {
option (cosmos.msg.v1.service) = true;

rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);
// this line is used by starport scaffolding # proto/tx/rpc
}

// MsgUpdateParams is the MsgUpdateParams request type.
//
// Since: 0.47
message MsgUpdateParams {
option (amino.name) = "contractmanager/MsgUpdateParams";
option (cosmos.msg.v1.signer) = "authority";

// Authority is the address of the governance account.
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];

// params defines the x/contractmanager parameters to update.
//
// NOTE: All parameters must be supplied.
contractmanager.Params params = 2 [
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true
];
}

// MsgUpdateParamsResponse defines the response structure for executing a
// MsgUpdateParams message.
//
// Since: 0.47
message MsgUpdateParamsResponse {}
18 changes: 18 additions & 0 deletions proto/nolus/contractmanager/v1/failure.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
syntax = "proto3";
package nolus.contractmanager.v1;

option go_package = "github.com/Nolus-Protocol/nolus-core/x/contractmanager/types/v1";

// Deprecated. Used only for migration purposes.
message Failure {
// ChannelId
string channel_id = 1;
// Address of the failed contract
string address = 2;
// id of the failure under specific address
uint64 id = 3;
// ACK id to restore
uint64 ack_id = 4;
// Acknowledgement type
string ack_type = 5;
}
35 changes: 35 additions & 0 deletions proto/nolus/feerefunder/fee.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
syntax = "proto3";
package nolus.feerefunder;

import "cosmos/base/v1beta1/coin.proto";
import "gogoproto/gogo.proto";

option go_package = "github.com/Nolus-Protocol/nolus-core/x/feerefunder/types";

// Fee defines the ICS29 receive, acknowledgement and timeout fees
message Fee {
// the packet receive fee
repeated cosmos.base.v1beta1.Coin recv_fee = 1 [
(gogoproto.moretags) = "yaml:\"recv_fee\"",
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];
// the packet acknowledgement fee
repeated cosmos.base.v1beta1.Coin ack_fee = 2 [
(gogoproto.moretags) = "yaml:\"ack_fee\"",
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];
// the packet timeout fee
repeated cosmos.base.v1beta1.Coin timeout_fee = 3 [
(gogoproto.moretags) = "yaml:\"timeout_fee\"",
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];
}

message PacketID {
string channel_id = 1;
string port_id = 2;
uint64 sequence = 3;
}
22 changes: 22 additions & 0 deletions proto/nolus/feerefunder/genesis.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
syntax = "proto3";
package neutron.feerefunder;

import "gogoproto/gogo.proto";
import "neutron/feerefunder/fee.proto";
import "neutron/feerefunder/params.proto";
// this line is used by starport scaffolding # genesis/proto/import

option go_package = "github.com/Nolus-Protocol/nolus-core/x/feerefunder/types";

// GenesisState defines the fee module's genesis state.
message GenesisState {
Params params = 1 [(gogoproto.nullable) = false];
repeated FeeInfo fee_infos = 2 [(gogoproto.nullable) = false];
// this line is used by starport scaffolding # genesis/proto/state
}

message FeeInfo {
string payer = 1;
PacketID packet_id = 2 [(gogoproto.nullable) = false];
Fee fee = 3 [(gogoproto.nullable) = false];
}
14 changes: 14 additions & 0 deletions proto/nolus/feerefunder/params.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
syntax = "proto3";
package neutron.feerefunder;

import "gogoproto/gogo.proto";
import "neutron/feerefunder/fee.proto";

option go_package = "github.com/Nolus-Protocol/nolus-core/x/feerefunder/types";

// Params defines the parameters for the module.
message Params {
option (gogoproto.goproto_stringer) = false;

Fee min_fee = 1 [(gogoproto.nullable) = false];
}
44 changes: 44 additions & 0 deletions proto/nolus/feerefunder/query.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
syntax = "proto3";
package nolus.feerefunder;

import "cosmos/base/query/v1beta1/pagination.proto";
import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "nolus/feerefunder/genesis.proto";
import "nolus/feerefunder/params.proto";
// this line is used by starport scaffolding # 1

option go_package = "github.com/Nolus-Protocol/nolus-core/x/feerefunder/types";

// Query defines the gRPC querier service.
service Query {
// Parameters queries the parameters of the module.
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/nolus/feerefunder/params";
}
rpc FeeInfo(FeeInfoRequest) returns (FeeInfoResponse) {
option (google.api.http).get = "/nolus/feerefunder/info";
}
// this line is used by starport scaffolding # 2
}

// QueryParamsRequest is request type for the Query/Params RPC method.
message QueryParamsRequest {}

// QueryParamsResponse is response type for the Query/Params RPC method.
message QueryParamsResponse {
// params holds all the parameters of this module.
Params params = 1 [(gogoproto.nullable) = false];
}

message FeeInfoRequest {
string channel_id = 1;
string port_id = 2;
uint64 sequence = 3;
}

message FeeInfoResponse {
FeeInfo fee_info = 1;
}

// this line is used by starport scaffolding # 3
Loading

0 comments on commit 4f97507

Please sign in to comment.