Skip to content

Commit

Permalink
Merge branch 'develop' into feat-support-taproot
Browse files Browse the repository at this point in the history
  • Loading branch information
ws4charlie authored Apr 3, 2024
2 parents e0f0196 + fca927f commit 11bd7ea
Show file tree
Hide file tree
Showing 117 changed files with 5,788 additions and 1,861 deletions.
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
* [1879](https://github.com/zeta-chain/node/pull/1879) - full coverage for messages in types packages
* [1899](https://github.com/zeta-chain/node/pull/1899) - add empty test files so packages are included in coverage
* [1903](https://github.com/zeta-chain/node/pull/1903) - common package tests
* [1961](https://github.com/zeta-chain/node/pull/1961) - improve observer module coverage
* [1967](https://github.com/zeta-chain/node/pull/1967) - improve crosschain module coverage
* [1955](https://github.com/zeta-chain/node/pull/1955) - improve emissions module coverage

### Fixes
Expand Down
2 changes: 2 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ ignore:
- "x/**/types/types.go"
- "x/**/types/expected_keepers.go"
- "x/**/module.go"
- "x/**/events.go"
- "x/**/migrator.go"
- "x/**/module_simulation.go"
- "x/**/simulation/**/*"
- "**/*.proto"
Expand Down
1 change: 0 additions & 1 deletion docs/cli/zetacored/zetacored_query_crosschain.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ zetacored query crosschain [flags]
* [zetacored query crosschain list-in-tx-tracker](zetacored_query_crosschain_list-in-tx-tracker.md) - shows a list of in tx tracker by chainId
* [zetacored query crosschain list-out-tx-tracker](zetacored_query_crosschain_list-out-tx-tracker.md) - list all OutTxTracker
* [zetacored query crosschain list-pending-cctx](zetacored_query_crosschain_list-pending-cctx.md) - shows pending CCTX
* [zetacored query crosschain params](zetacored_query_crosschain_params.md) - shows the parameters of the module
* [zetacored query crosschain show-cctx](zetacored_query_crosschain_show-cctx.md) - shows a CCTX
* [zetacored query crosschain show-gas-price](zetacored_query_crosschain_show-gas-price.md) - shows a gasPrice
* [zetacored query crosschain show-in-tx-hash-to-cctx](zetacored_query_crosschain_show-in-tx-hash-to-cctx.md) - shows a inTxHashToCctx
Expand Down
33 changes: 0 additions & 33 deletions docs/cli/zetacored/zetacored_query_crosschain_params.md

This file was deleted.

28 changes: 0 additions & 28 deletions docs/openapi/openapi.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27173,21 +27173,6 @@ paths:
type: boolean
tags:
- Query
/zeta-chain/crosschain/params:
get:
summary: Parameters queries the parameters of the module.
operationId: Query_Params
responses:
"200":
description: A successful response.
schema:
$ref: '#/definitions/zetacorecrosschainQueryParamsResponse'
default:
description: An unexpected error response.
schema:
$ref: '#/definitions/googlerpcStatus'
tags:
- Query
/zeta-chain/crosschain/protocolFee:
get:
operationId: Query_ProtocolFee
Expand Down Expand Up @@ -54738,19 +54723,6 @@ definitions:
repeated Bar results = 1;
PageResponse page = 2;
}
zetacorecrosschainParams:
type: object
properties:
enabled:
type: boolean
description: Params defines the parameters for the module.
zetacorecrosschainQueryParamsResponse:
type: object
properties:
params:
$ref: '#/definitions/zetacorecrosschainParams'
description: params holds all the parameters of this module.
description: QueryParamsResponse is response type for the Query/Params RPC method.
zetacorecrosschainStatus:
type: object
properties:
Expand Down
18 changes: 8 additions & 10 deletions proto/crosschain/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,18 @@ import "crosschain/in_tx_hash_to_cctx.proto";
import "crosschain/in_tx_tracker.proto";
import "crosschain/last_block_height.proto";
import "crosschain/out_tx_tracker.proto";
import "crosschain/params.proto";
import "gogoproto/gogo.proto";

option go_package = "github.com/zeta-chain/zetacore/x/crosschain/types";

// GenesisState defines the metacore module's genesis state.
message GenesisState {
Params params = 1 [(gogoproto.nullable) = false];
repeated OutTxTracker outTxTrackerList = 2 [(gogoproto.nullable) = false];
repeated GasPrice gasPriceList = 5;
repeated CrossChainTx CrossChainTxs = 7;
repeated LastBlockHeight lastBlockHeightList = 8;
repeated InTxHashToCctx inTxHashToCctxList = 9 [(gogoproto.nullable) = false];
repeated InTxTracker in_tx_tracker_list = 11 [(gogoproto.nullable) = false];
ZetaAccounting zeta_accounting = 12 [(gogoproto.nullable) = false];
repeated string FinalizedInbounds = 16;
repeated OutTxTracker outTxTrackerList = 1 [(gogoproto.nullable) = false];
repeated GasPrice gasPriceList = 2;
repeated CrossChainTx CrossChainTxs = 3;
repeated LastBlockHeight lastBlockHeightList = 4;
repeated InTxHashToCctx inTxHashToCctxList = 5 [(gogoproto.nullable) = false];
repeated InTxTracker in_tx_tracker_list = 6 [(gogoproto.nullable) = false];
ZetaAccounting zeta_accounting = 7 [(gogoproto.nullable) = false];
repeated string FinalizedInbounds = 8;
}
12 changes: 0 additions & 12 deletions proto/crosschain/params.proto

This file was deleted.

15 changes: 0 additions & 15 deletions proto/crosschain/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,13 @@ import "crosschain/in_tx_hash_to_cctx.proto";
import "crosschain/in_tx_tracker.proto";
import "crosschain/last_block_height.proto";
import "crosschain/out_tx_tracker.proto";
import "crosschain/params.proto";
import "gogoproto/gogo.proto";
import "google/api/annotations.proto";

option go_package = "github.com/zeta-chain/zetacore/x/crosschain/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 = "/zeta-chain/crosschain/params";
}

// Queries a OutTxTracker by index.
rpc OutTxTracker(QueryGetOutTxTrackerRequest) returns (QueryGetOutTxTrackerResponse) {
option (google.api.http).get = "/zeta-chain/crosschain/outTxTracker/{chainID}/{nonce}";
Expand Down Expand Up @@ -120,15 +114,6 @@ message QueryZetaAccountingResponse {
string aborted_zeta_amount = 1;
}

// 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 QueryGetOutTxTrackerRequest {
int64 chainID = 1;
uint64 nonce = 2;
Expand Down
1 change: 1 addition & 0 deletions proto/observer/ballot.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ enum BallotStatus {
BallotInProgress = 2;
}

// https://github.com/zeta-chain/node/issues/939
message Ballot {
string index = 1;
string ballot_identifier = 2;
Expand Down
4 changes: 2 additions & 2 deletions testutil/keeper/crosschain.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,13 @@ func MockGetSupportedChainFromChainID(m *crosschainmocks.CrosschainObserverKeepe
Return(senderChain).Once()

}
func MockGetRevertGasLimitForERC20(m *crosschainmocks.CrosschainFungibleKeeper, asset string, senderChain chains.Chain) {
func MockGetRevertGasLimitForERC20(m *crosschainmocks.CrosschainFungibleKeeper, asset string, senderChain chains.Chain, returnVal int64) {
m.On("GetForeignCoinFromAsset", mock.Anything, asset, senderChain.ChainId).
Return(fungibletypes.ForeignCoins{
Zrc20ContractAddress: sample.EthAddress().String(),
}, true).Once()
m.On("QueryGasLimit", mock.Anything, mock.Anything).
Return(big.NewInt(100), nil).Once()
Return(big.NewInt(returnVal), nil).Once()

}
func MockPayGasAndUpdateCCTX(m *crosschainmocks.CrosschainFungibleKeeper, m2 *crosschainmocks.CrosschainObserverKeeper, ctx sdk.Context, k keeper.Keeper, senderChain chains.Chain, asset string) {
Expand Down
5 changes: 5 additions & 0 deletions testutil/keeper/mocks/observer/staking.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion testutil/network/genesis_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ func SetupZetaGenesisState(t *testing.T, genesisState map[string]json.RawMessage
}
}

crossChainGenesis.Params.Enabled = true
require.NoError(t, crossChainGenesis.Validate())
crossChainGenesisBz, err := codec.MarshalJSON(&crossChainGenesis)
require.NoError(t, err)
Expand Down
10 changes: 10 additions & 0 deletions testutil/sample/crosschain.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ func OutTxTracker(t *testing.T, index string) types.OutTxTracker {
}
}

func InTxTracker(t *testing.T, index string) types.InTxTracker {
r := newRandFromStringSeed(t, index)

return types.InTxTracker{
ChainId: r.Int63(),
CoinType: coin.CoinType_Zeta,
TxHash: Hash().Hex(),
}
}

func GasPrice(t *testing.T, index string) *types.GasPrice {
r := newRandFromStringSeed(t, index)

Expand Down
22 changes: 8 additions & 14 deletions typescript/crosschain/genesis_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
import { Message, proto3 } from "@bufbuild/protobuf";
import type { Params } from "./params_pb.js";
import type { OutTxTracker } from "./out_tx_tracker_pb.js";
import type { GasPrice } from "./gas_price_pb.js";
import type { CrossChainTx, ZetaAccounting } from "./cross_chain_tx_pb.js";
Expand All @@ -20,47 +19,42 @@ import type { InTxTracker } from "./in_tx_tracker_pb.js";
*/
export declare class GenesisState extends Message<GenesisState> {
/**
* @generated from field: zetachain.zetacore.crosschain.Params params = 1;
*/
params?: Params;

/**
* @generated from field: repeated zetachain.zetacore.crosschain.OutTxTracker outTxTrackerList = 2;
* @generated from field: repeated zetachain.zetacore.crosschain.OutTxTracker outTxTrackerList = 1;
*/
outTxTrackerList: OutTxTracker[];

/**
* @generated from field: repeated zetachain.zetacore.crosschain.GasPrice gasPriceList = 5;
* @generated from field: repeated zetachain.zetacore.crosschain.GasPrice gasPriceList = 2;
*/
gasPriceList: GasPrice[];

/**
* @generated from field: repeated zetachain.zetacore.crosschain.CrossChainTx CrossChainTxs = 7;
* @generated from field: repeated zetachain.zetacore.crosschain.CrossChainTx CrossChainTxs = 3;
*/
CrossChainTxs: CrossChainTx[];

/**
* @generated from field: repeated zetachain.zetacore.crosschain.LastBlockHeight lastBlockHeightList = 8;
* @generated from field: repeated zetachain.zetacore.crosschain.LastBlockHeight lastBlockHeightList = 4;
*/
lastBlockHeightList: LastBlockHeight[];

/**
* @generated from field: repeated zetachain.zetacore.crosschain.InTxHashToCctx inTxHashToCctxList = 9;
* @generated from field: repeated zetachain.zetacore.crosschain.InTxHashToCctx inTxHashToCctxList = 5;
*/
inTxHashToCctxList: InTxHashToCctx[];

/**
* @generated from field: repeated zetachain.zetacore.crosschain.InTxTracker in_tx_tracker_list = 11;
* @generated from field: repeated zetachain.zetacore.crosschain.InTxTracker in_tx_tracker_list = 6;
*/
inTxTrackerList: InTxTracker[];

/**
* @generated from field: zetachain.zetacore.crosschain.ZetaAccounting zeta_accounting = 12;
* @generated from field: zetachain.zetacore.crosschain.ZetaAccounting zeta_accounting = 7;
*/
zetaAccounting?: ZetaAccounting;

/**
* @generated from field: repeated string FinalizedInbounds = 16;
* @generated from field: repeated string FinalizedInbounds = 8;
*/
FinalizedInbounds: string[];

Expand Down
1 change: 0 additions & 1 deletion typescript/crosschain/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ export * from "./in_tx_hash_to_cctx_pb";
export * from "./in_tx_tracker_pb";
export * from "./last_block_height_pb";
export * from "./out_tx_tracker_pb";
export * from "./params_pb";
export * from "./query_pb";
export * from "./tx_pb";
34 changes: 0 additions & 34 deletions typescript/crosschain/params_pb.d.ts

This file was deleted.

Loading

0 comments on commit 11bd7ea

Please sign in to comment.