Skip to content

Commit

Permalink
fix: ibc app-transfer v3 grpc-gateway path
Browse files Browse the repository at this point in the history
revert: register testnet init evm proposal
  • Loading branch information
zakir committed Nov 8, 2022
1 parent ac90a21 commit cbba9a3
Show file tree
Hide file tree
Showing 9 changed files with 2,816 additions and 51 deletions.
3 changes: 3 additions & 0 deletions app/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import (
cryptocodec "github.com/evmos/ethermint/crypto/codec"
"github.com/evmos/ethermint/crypto/ethsecp256k1"
ethermint "github.com/evmos/ethermint/types"

fxlegacy "github.com/functionx/fx-core/v2/types/legacy"
)

// EncodingConfig specifies the concrete encoding types to use for a given app.
Expand All @@ -28,6 +30,7 @@ func MakeEncodingConfig() EncodingConfig {
encodingConfig := makeEncodingConfig()
ModuleBasics.RegisterLegacyAminoCodec(encodingConfig.Amino)
ModuleBasics.RegisterInterfaces(encodingConfig.InterfaceRegistry)
fxlegacy.RegisterInterfaces(encodingConfig.InterfaceRegistry)
return encodingConfig
}

Expand Down
2 changes: 2 additions & 0 deletions develop/run_fxcore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ if [[ "$1" == "init" ]]; then
# Initialize private validator, p2p, genesis, and application configuration files
fxcored init local --chain-id fxcore

fxcored config config.toml rpc.cors_allowed_origins "*"
# open prometheus
fxcored config config.toml instrumentation.prometheus true
# consensus
# fxcored config config.toml consensus.timeout_commit 1s
# open rest and swagger
fxcored config app.toml api.enable true
fxcored config app.toml api.enabled-unsafe-cors
fxcored config app.toml api.swagger true
# open telemetry
fxcored config app.toml telemetry.enabled true
Expand Down
42 changes: 38 additions & 4 deletions docs/proto/fx-proto-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@
- [QueryDenomTraceResponse](#fx.ibc.applications.transfer.v1.QueryDenomTraceResponse)
- [QueryDenomTracesRequest](#fx.ibc.applications.transfer.v1.QueryDenomTracesRequest)
- [QueryDenomTracesResponse](#fx.ibc.applications.transfer.v1.QueryDenomTracesResponse)
- [QueryEscrowAddressRequest](#fx.ibc.applications.transfer.v1.QueryEscrowAddressRequest)
- [QueryEscrowAddressResponse](#fx.ibc.applications.transfer.v1.QueryEscrowAddressResponse)
- [QueryParamsRequest](#fx.ibc.applications.transfer.v1.QueryParamsRequest)
- [QueryParamsResponse](#fx.ibc.applications.transfer.v1.QueryParamsResponse)

Expand Down Expand Up @@ -4313,6 +4315,37 @@ method.



<a name="fx.ibc.applications.transfer.v1.QueryEscrowAddressRequest"></a>

### QueryEscrowAddressRequest
QueryEscrowAddressRequest is the request type for the EscrowAddress RPC method.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `port_id` | [string](#string) | | unique port identifier |
| `channel_id` | [string](#string) | | unique channel identifier |






<a name="fx.ibc.applications.transfer.v1.QueryEscrowAddressResponse"></a>

### QueryEscrowAddressResponse
QueryEscrowAddressResponse is the response type of the EscrowAddress RPC method.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `escrow_address` | [string](#string) | | the escrow account address |






<a name="fx.ibc.applications.transfer.v1.QueryParamsRequest"></a>

### QueryParamsRequest
Expand Down Expand Up @@ -4351,10 +4384,11 @@ Query provides defines the gRPC querier service.

| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint |
| ----------- | ------------ | ------------- | ------------| ------- | -------- |
| `DenomTrace` | [QueryDenomTraceRequest](#fx.ibc.applications.transfer.v1.QueryDenomTraceRequest) | [QueryDenomTraceResponse](#fx.ibc.applications.transfer.v1.QueryDenomTraceResponse) | DenomTrace queries a denomination trace information. | GET|/ibc/applications/transfer/v1beta1/denom_traces/{hash}|
| `DenomTraces` | [QueryDenomTracesRequest](#fx.ibc.applications.transfer.v1.QueryDenomTracesRequest) | [QueryDenomTracesResponse](#fx.ibc.applications.transfer.v1.QueryDenomTracesResponse) | DenomTraces queries all denomination traces. | GET|/ibc/applications/transfer/v1beta1/denom_traces|
| `Params` | [QueryParamsRequest](#fx.ibc.applications.transfer.v1.QueryParamsRequest) | [QueryParamsResponse](#fx.ibc.applications.transfer.v1.QueryParamsResponse) | Params queries all parameters of the ibc-transfer module. | GET|/ibc/applications/transfer/v1beta1/params|
| `DenomHash` | [QueryDenomHashRequest](#fx.ibc.applications.transfer.v1.QueryDenomHashRequest) | [QueryDenomHashResponse](#fx.ibc.applications.transfer.v1.QueryDenomHashResponse) | DenomHash queries a denomination hash information. | GET|/ibc/applications/transfer/v1beta1/denom_hashes/{trace}|
| `DenomTrace` | [QueryDenomTraceRequest](#fx.ibc.applications.transfer.v1.QueryDenomTraceRequest) | [QueryDenomTraceResponse](#fx.ibc.applications.transfer.v1.QueryDenomTraceResponse) | DenomTrace queries a denomination trace information. | GET|/ibc/apps/transfer/v1/denom_traces/{hash}|
| `DenomTraces` | [QueryDenomTracesRequest](#fx.ibc.applications.transfer.v1.QueryDenomTracesRequest) | [QueryDenomTracesResponse](#fx.ibc.applications.transfer.v1.QueryDenomTracesResponse) | DenomTraces queries all denomination traces. | GET|/ibc/apps/transfer/v1/denom_traces|
| `Params` | [QueryParamsRequest](#fx.ibc.applications.transfer.v1.QueryParamsRequest) | [QueryParamsResponse](#fx.ibc.applications.transfer.v1.QueryParamsResponse) | Params queries all parameters of the ibc-transfer module. | GET|/ibc/apps/transfer/v1/params|
| `DenomHash` | [QueryDenomHashRequest](#fx.ibc.applications.transfer.v1.QueryDenomHashRequest) | [QueryDenomHashResponse](#fx.ibc.applications.transfer.v1.QueryDenomHashResponse) | DenomHash queries a denomination hash information. | GET|/ibc/apps/transfer/v1/denom_hashes/{trace}|
| `EscrowAddress` | [QueryEscrowAddressRequest](#fx.ibc.applications.transfer.v1.QueryEscrowAddressRequest) | [QueryEscrowAddressResponse](#fx.ibc.applications.transfer.v1.QueryEscrowAddressResponse) | EscrowAddress returns the escrow address for a particular port and channel id. | GET|/ibc/apps/transfer/v1/channels/{channel_id}/ports/{port_id}/escrow_address|

<!-- end services -->

Expand Down
28 changes: 24 additions & 4 deletions proto/fx/ibc/applications/transfer/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,30 @@ service Query {
// DenomTrace queries a denomination trace information.
rpc DenomTrace(QueryDenomTraceRequest) returns (QueryDenomTraceResponse) {
option (google.api.http).get =
"/ibc/applications/transfer/v1beta1/denom_traces/{hash}";
"/ibc/apps/transfer/v1/denom_traces/{hash}";
}

// DenomTraces queries all denomination traces.
rpc DenomTraces(QueryDenomTracesRequest) returns (QueryDenomTracesResponse) {
option (google.api.http).get =
"/ibc/applications/transfer/v1beta1/denom_traces";
"/ibc/apps/transfer/v1/denom_traces";
}

// Params queries all parameters of the ibc-transfer module.
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/ibc/applications/transfer/v1beta1/params";
option (google.api.http).get = "/ibc/apps/transfer/v1/params";
}

// DenomHash queries a denomination hash information.
rpc DenomHash(QueryDenomHashRequest) returns (QueryDenomHashResponse) {
option (google.api.http).get =
"/ibc/applications/transfer/v1beta1/denom_hashes/{trace}";
"/ibc/apps/transfer/v1/denom_hashes/{trace}";
}

// EscrowAddress returns the escrow address for a particular port and channel id.
rpc EscrowAddress(QueryEscrowAddressRequest) returns (QueryEscrowAddressResponse) {
option (google.api.http).get =
"/ibc/apps/transfer/v1/channels/{channel_id}/ports/{port_id}/escrow_address";
}
}

Expand Down Expand Up @@ -86,4 +92,18 @@ message QueryDenomHashRequest {
message QueryDenomHashResponse {
// hash (in hex format) of the denomination trace information.
string hash = 1;
}

// QueryEscrowAddressRequest is the request type for the EscrowAddress RPC method.
message QueryEscrowAddressRequest {
// unique port identifier
string port_id = 1;
// unique channel identifier
string channel_id = 2;
}

// QueryEscrowAddressResponse is the response type of the EscrowAddress RPC method.
message QueryEscrowAddressResponse {
// the escrow account address
string escrow_address = 1;
}
52 changes: 52 additions & 0 deletions types/legacy/init_evm_proposal.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package legacy

import (
"fmt"
"strings"

codectypes "github.com/cosmos/cosmos-sdk/codec/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
)

func RegisterInterfaces(registry codectypes.InterfaceRegistry) {
registry.RegisterImplementations((*govtypes.Content)(nil), &InitEvmParamsProposal{})
}

const ProposalTypeInitEvmParams = "InitEvmParams"

var _ govtypes.Content = &InitEvmParamsProposal{}

func init() {
govtypes.RegisterProposalType(ProposalTypeInitEvmParams)
}

func (m *InitEvmParamsProposal) GetTitle() string {
return m.Title
}

func (m *InitEvmParamsProposal) GetDescription() string {
return m.Description
}

func (m *InitEvmParamsProposal) ProposalRoute() string {
return "evm"
}

func (m *InitEvmParamsProposal) ProposalType() string {
return ProposalTypeInitEvmParams
}

func (m *InitEvmParamsProposal) ValidateBasic() error {
return nil
}

func (m *InitEvmParamsProposal) String() string {
var b strings.Builder
b.WriteString(fmt.Sprintf(`Init Evm Params Proposal:
Title: %s
Description: %s
EvmParams: %v
FeeMarketParams: %v
`, m.Title, m.Description, m.EvmParams, m.FeemarketParams))
return b.String()
}
Loading

0 comments on commit cbba9a3

Please sign in to comment.