Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: update protobuf #3

Merged
merged 3 commits into from
May 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish after push main
on:
push:
branches:
- main

jobs:
publish:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest

steps:
- name: "Checkout"
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: "Use NodeJS 14"
uses: actions/setup-node@v2
with:
node-version: '14'

- name: "Version and publish" # Interesting step
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [ ${{ github.base_ref }} = development ]; then
npx lerna version --conventional-commits --conventional-prerelease --preid beta --yes
else
npx lerna version --conventional-commits --conventional-graduate --yes
fi

npx lerna publish from-git --yes
37 changes: 37 additions & 0 deletions .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish after pr merged
on:
pull_request:
types: [closed]
branches:
- main

jobs:
publish:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest

steps:
- name: "Checkout"
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: "Use NodeJS 14"
uses: actions/setup-node@v2
with:
node-version: '14'

- name: "Version and publish" # Interesting step
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor}}@users.noreply.github.com"

if [ ${{ github.base_ref }} = development ]; then
npx lerna version --conventional-commits --conventional-prerelease --preid beta --yes
else
npx lerna version --conventional-commits --conventional-graduate --yes
fi

npx lerna publish from-git --yes
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This project forked from [https://github.com/tharsis/evmosjs](https://github.com/tharsis/evmosjs)

[![Total alerts](https://img.shields.io/lgtm/alerts/g/astraprotocol/evmosjs.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/astraprotocol/evmosjs/alerts/) [![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/astraprotocol/evmosjs.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/astraprotocol/evmosjs/context:javascript)
[![Total alerts](https://img.shields.io/lgtm/alerts/g/astraprotocol/astrajs.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/astraprotocol/astrajs/alerts/) [![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/astraprotocol/astrajs.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/astraprotocol/astrajs/context:javascript)

JS and TS libs for Evmos

Expand Down
12 changes: 12 additions & 0 deletions packages/proto/proto/cosmos/authz/v1beta1/authz.proto
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,15 @@ message Grant {
google.protobuf.Any authorization = 1 [(cosmos_proto.accepts_interface) = "Authorization"];
google.protobuf.Timestamp expiration = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
}

// GrantAuthorization extends a grant with both the addresses of the grantee and granter.
// It is used in genesis.proto and query.proto
//
// Since: cosmos-sdk 0.45.2
message GrantAuthorization {
string granter = 1;
string grantee = 2;

google.protobuf.Any authorization = 3 [(cosmos_proto.accepts_interface) = "Authorization"];
google.protobuf.Timestamp expiration = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
}
13 changes: 1 addition & 12 deletions packages/proto/proto/cosmos/authz/v1beta1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,12 @@
syntax = "proto3";
package cosmos.authz.v1beta1;

import "google/protobuf/timestamp.proto";
import "google/protobuf/any.proto";
import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";
import "cosmos/authz/v1beta1/authz.proto";

option go_package = "github.com/cosmos/cosmos-sdk/x/authz";

// GenesisState defines the authz module's genesis state.
message GenesisState {
repeated GrantAuthorization authorization = 1 [(gogoproto.nullable) = false];
}

// GrantAuthorization defines the GenesisState/GrantAuthorization type.
message GrantAuthorization {
string granter = 1;
string grantee = 2;

google.protobuf.Any authorization = 3 [(cosmos_proto.accepts_interface) = "Authorization"];
google.protobuf.Timestamp expiration = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true];
}
48 changes: 47 additions & 1 deletion packages/proto/proto/cosmos/authz/v1beta1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@ service Query {
rpc Grants(QueryGrantsRequest) returns (QueryGrantsResponse) {
option (google.api.http).get = "/cosmos/authz/v1beta1/grants";
}

// GranterGrants returns list of `GrantAuthorization`, granted by granter.
//
// Since: cosmos-sdk 0.45.2
rpc GranterGrants(QueryGranterGrantsRequest) returns (QueryGranterGrantsResponse) {
option (google.api.http).get = "/cosmos/authz/v1beta1/grants/granter/{granter}";
}

// GranteeGrants returns a list of `GrantAuthorization` by grantee.
//
// Since: cosmos-sdk 0.45.2
rpc GranteeGrants(QueryGranteeGrantsRequest) returns (QueryGranteeGrantsResponse) {
option (google.api.http).get = "/cosmos/authz/v1beta1/grants/grantee/{grantee}";
}
}

// QueryGrantsRequest is the request type for the Query/Grants RPC method.
Expand All @@ -29,7 +43,39 @@ message QueryGrantsRequest {
// QueryGrantsResponse is the response type for the Query/Authorizations RPC method.
message QueryGrantsResponse {
// authorizations is a list of grants granted for grantee by granter.
repeated cosmos.authz.v1beta1.Grant grants = 1;
repeated Grant grants = 1;
// pagination defines an pagination for the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

// QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method.
message QueryGranterGrantsRequest {
string granter = 1;

// pagination defines an pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 2;
}

// QueryGranterGrantsResponse is the response type for the Query/GranterGrants RPC method.
message QueryGranterGrantsResponse {
// grants is a list of grants granted by the granter.
repeated GrantAuthorization grants = 1;
// pagination defines an pagination for the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

// QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method.
message QueryGranteeGrantsRequest {
string grantee = 1;

// pagination defines an pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 2;
}

// QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method.
message QueryGranteeGrantsResponse {
// grants is a list of grants granted to the grantee.
repeated GrantAuthorization grants = 1;
// pagination defines an pagination for the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
30 changes: 30 additions & 0 deletions packages/proto/proto/cosmos/bank/v1beta1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ service Query {
option (google.api.http).get = "/cosmos/bank/v1beta1/balances/{address}";
}

// SpendableBalances queries the spenable balance of all coins for a single
// account.
rpc SpendableBalances(QuerySpendableBalancesRequest) returns (QuerySpendableBalancesResponse) {
option (google.api.http).get = "/cosmos/bank/v1beta1/spendable_balances/{address}";
}

// TotalSupply queries the total supply of all coins.
rpc TotalSupply(QueryTotalSupplyRequest) returns (QueryTotalSupplyResponse) {
option (google.api.http).get = "/cosmos/bank/v1beta1/supply";
Expand Down Expand Up @@ -88,6 +94,30 @@ message QueryAllBalancesResponse {
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

// QuerySpendableBalancesRequest defines the gRPC request structure for querying
// an account's spendable balances.
message QuerySpendableBalancesRequest {
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;

// address is the address to query spendable balances for.
string address = 1;

// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 2;
}

// QuerySpendableBalancesResponse defines the gRPC response structure for querying
// an account's spendable balances.
message QuerySpendableBalancesResponse {
// balances is the spendable balances of all the coins.
repeated cosmos.base.v1beta1.Coin balances = 1
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];

// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

// QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC
// method.
message QueryTotalSupplyRequest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,41 @@ message Snapshot {
// Metadata contains SDK-specific snapshot metadata.
message Metadata {
repeated bytes chunk_hashes = 1; // SHA-256 chunk hashes
}
}

// SnapshotItem is an item contained in a rootmulti.Store snapshot.
message SnapshotItem {
// item is the specific type of snapshot item.
oneof item {
SnapshotStoreItem store = 1;
SnapshotIAVLItem iavl = 2 [(gogoproto.customname) = "IAVL"];
SnapshotExtensionMeta extension = 3;
SnapshotExtensionPayload extension_payload = 4;
}
}

// SnapshotStoreItem contains metadata about a snapshotted store.
message SnapshotStoreItem {
string name = 1;
}

// SnapshotIAVLItem is an exported IAVL node.
message SnapshotIAVLItem {
bytes key = 1;
bytes value = 2;
// version is block height
int64 version = 3;
// height is depth of the tree.
int32 height = 4;
}

// SnapshotExtensionMeta contains metadata about an external snapshotter.
message SnapshotExtensionMeta {
string name = 1;
uint32 format = 2;
}

// SnapshotExtensionPayload contains payloads of an external snapshotter.
message SnapshotExtensionPayload {
bytes payload = 1;
}
12 changes: 12 additions & 0 deletions packages/proto/proto/cosmos/tx/signing/v1beta1/signing.proto
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@ enum SignMode {
// SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses
// Amino JSON and will be removed in the future
SIGN_MODE_LEGACY_AMINO_JSON = 127;

// SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos
// SDK. Ref: https://eips.ethereum.org/EIPS/eip-191
//
// Currently, SIGN_MODE_EIP_191 is registered as a SignMode enum variant,
// but is not implemented on the SDK by default. To enable EIP-191, you need
// to pass a custom `TxConfig` that has an implementation of
// `SignModeHandler` for EIP-191. The SDK may decide to fully support
// EIP-191 in the future.
//
// Since: cosmos-sdk 0.45.2
SIGN_MODE_EIP_191 = 191;
}

// SignatureDescriptors wraps multiple SignatureDescriptor's.
Expand Down
6 changes: 3 additions & 3 deletions packages/proto/proto/ethermint/feemarket/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ option go_package = "github.com/tharsis/ethermint/x/feemarket/types";
service Query {
// Params queries the parameters of x/feemarket module.
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/feemarket/evm/v1/params";
option (google.api.http).get = "/ethermint/feemarket/v1/params";
}

// BaseFee queries the base fee of the parent block of the current block.
rpc BaseFee(QueryBaseFeeRequest) returns (QueryBaseFeeResponse) {
option (google.api.http).get = "/feemarket/evm/v1/base_fee";
option (google.api.http).get = "/ethermint/feemarket/v1/base_fee";
}

// BlockGas queries the gas used at a given block height
rpc BlockGas(QueryBlockGasRequest) returns (QueryBlockGasResponse) {
option (google.api.http).get = "/feemarket/evm/v1/block_gas";
option (google.api.http).get = "/ethermint/feemarket/v1/block_gas";
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/proto/proto/evmos/claims/v1/claims.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package evmos.claims.v1;

import "gogoproto/gogo.proto";

option go_package = "github.com/tharsis/evmos/v3/x/claims/types";
option go_package = "github.com/tharsis/evmos/v4/x/claims/types";

// Action defines the list of available actions to claim the airdrop tokens.
enum Action {
Expand Down
2 changes: 1 addition & 1 deletion packages/proto/proto/evmos/claims/v1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "evmos/claims/v1/claims.proto";

option go_package = "github.com/tharsis/evmos/v3/x/claims/types";
option go_package = "github.com/tharsis/evmos/v4/x/claims/types";

// GenesisState define the claims module's genesis state.
message GenesisState {
Expand Down
2 changes: 1 addition & 1 deletion packages/proto/proto/evmos/claims/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import "cosmos/base/v1beta1/coin.proto";
import "evmos/claims/v1/claims.proto";
import "evmos/claims/v1/genesis.proto";

option go_package = "github.com/tharsis/evmos/v3/x/claims/types";
option go_package = "github.com/tharsis/evmos/v4/x/claims/types";

// Query defines the gRPC querier service.
service Query {
Expand Down
2 changes: 1 addition & 1 deletion packages/proto/proto/evmos/epochs/v1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "gogoproto/gogo.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";

option go_package = "github.com/tharsis/evmos/v3/x/epochs/types";
option go_package = "github.com/tharsis/evmos/v4/x/epochs/types";

message EpochInfo {
string identifier = 1;
Expand Down
2 changes: 1 addition & 1 deletion packages/proto/proto/evmos/epochs/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "google/api/annotations.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
import "evmos/epochs/v1/genesis.proto";

option go_package = "github.com/tharsis/evmos/v3/x/epochs/types";
option go_package = "github.com/tharsis/evmos/v4/x/epochs/types";

// Query defines the gRPC querier service.
service Query {
Expand Down
Loading