Skip to content

Commit

Permalink
add changelog and generate files
Browse files Browse the repository at this point in the history
  • Loading branch information
kingpinXD committed Apr 24, 2024
1 parent 3f56c13 commit 48d1e88
Show file tree
Hide file tree
Showing 6 changed files with 171 additions and 8 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
* [1989](https://github.com/zeta-chain/node/pull/1989) - simplify `IsSendOutTxProcessed` method and add unit tests
* [2013](https://github.com/zeta-chain/node/pull/2013) - rename `GasPriceVoter` message to `VoteGasPrice`
* [2059](https://github.com/zeta-chain/node/pull/2059) - Remove unused params from all functions in zetanode
* [2071](https://github.com/zeta-chain/node/pull/2071) - Modify chains struct to add all chain related information

### Features

Expand Down
42 changes: 42 additions & 0 deletions docs/openapi/openapi.swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53592,6 +53592,18 @@ definitions:
chain_id:
type: string
format: int64
network:
$ref: '#/definitions/chainsNetwork'
network_type:
$ref: '#/definitions/chainsNetworkType'
vm:
$ref: '#/definitions/chainsVm'
consensus:
$ref: '#/definitions/chainsConsensus'
is_external:
type: boolean
is_header_supported:
type: boolean
chainsChainName:
type: string
enum:
Expand All @@ -53613,6 +53625,30 @@ definitions:
- btc_regtest
- amoy_testnet
default: empty
chainsConsensus:
type: string
enum:
- Ethereum
- Tendermint
- Bitcoin
default: Ethereum
chainsNetwork:
type: string
enum:
- ETH
- ZETA
- BTC
- POLYGON
- BSC
default: ETH
chainsNetworkType:
type: string
enum:
- MAINNET
- TESTNET
- PRIVNET
- DEVNET
default: MAINNET
chainsReceiveStatus:
type: string
enum:
Expand All @@ -53621,6 +53657,12 @@ definitions:
- Failed
default: Created
title: '- Created: some observer sees inbound tx'
chainsVm:
type: string
enum:
- NO_VM
- EVM
default: NO_VM
coinCoinType:
type: string
enum:
Expand Down
6 changes: 3 additions & 3 deletions pkg/chains/chains.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,13 @@ func DefaultChainsList() []*Chain {

// ChainListByNetworkType returns a list of chains by network type
func ChainListByNetworkType(networkType NetworkType) []*Chain {
var mainNetList []*Chain
var chainList []*Chain
for _, chain := range DefaultChainsList() {
if chain.NetworkType == networkType {
mainNetList = append(mainNetList, chain)
chainList = append(chainList, chain)
}
}
return mainNetList
return chainList
}

// ChainListByNetwork returns a list of chains by network
Expand Down
6 changes: 3 additions & 3 deletions testutil/network/genesis_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ func SetupZetaGenesisState(t *testing.T, genesisState map[string]json.RawMessage
}

if setupChainNonces {
privatenetChain := chains.ChainListByNetworkType(chains.NetworkType_PRIVNET)
chainNonceList := make([]observertypes.ChainNonces, len(privatenetChain))
for i, chain := range privatenetChain {
privatenetChains := chains.ChainListByNetworkType(chains.NetworkType_PRIVNET)
chainNonceList := make([]observertypes.ChainNonces, len(privatenetChains))
for i, chain := range privatenetChains {
chainNonceList[i] = observertypes.ChainNonces{
Index: chain.ChainName.String(),
ChainId: chain.ChainId,
Expand Down
120 changes: 120 additions & 0 deletions typescript/pkg/chains/chains_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,96 @@ export declare enum ChainName {
amoy_testnet = 16,
}

/**
* @generated from enum chains.Network
*/
export declare enum Network {
/**
* @generated from enum value: ETH = 0;
*/
ETH = 0,

/**
* @generated from enum value: ZETA = 1;
*/
ZETA = 1,

/**
* @generated from enum value: BTC = 2;
*/
BTC = 2,

/**
* @generated from enum value: POLYGON = 3;
*/
POLYGON = 3,

/**
* @generated from enum value: BSC = 4;
*/
BSC = 4,
}

/**
* @generated from enum chains.NetworkType
*/
export declare enum NetworkType {
/**
* @generated from enum value: MAINNET = 0;
*/
MAINNET = 0,

/**
* @generated from enum value: TESTNET = 1;
*/
TESTNET = 1,

/**
* @generated from enum value: PRIVNET = 2;
*/
PRIVNET = 2,

/**
* @generated from enum value: DEVNET = 3;
*/
DEVNET = 3,
}

/**
* @generated from enum chains.Vm
*/
export declare enum Vm {
/**
* @generated from enum value: NO_VM = 0;
*/
NO_VM = 0,

/**
* @generated from enum value: EVM = 1;
*/
EVM = 1,
}

/**
* @generated from enum chains.Consensus
*/
export declare enum Consensus {
/**
* @generated from enum value: Ethereum = 0;
*/
Ethereum = 0,

/**
* @generated from enum value: Tendermint = 1;
*/
Tendermint = 1,

/**
* @generated from enum value: Bitcoin = 2;
*/
Bitcoin = 2,
}

/**
* @generated from message chains.Chain
*/
Expand All @@ -132,6 +222,36 @@ export declare class Chain extends Message<Chain> {
*/
chainId: bigint;

/**
* @generated from field: chains.Network network = 3;
*/
network: Network;

/**
* @generated from field: chains.NetworkType network_type = 4;
*/
networkType: NetworkType;

/**
* @generated from field: chains.Vm vm = 5;
*/
vm: Vm;

/**
* @generated from field: chains.Consensus consensus = 6;
*/
consensus: Consensus;

/**
* @generated from field: bool is_external = 7;
*/
isExternal: boolean;

/**
* @generated from field: bool is_header_supported = 8;
*/
isHeaderSupported: boolean;

constructor(data?: PartialMessage<Chain>);

static readonly runtime: typeof proto3;
Expand Down
4 changes: 2 additions & 2 deletions x/observer/migrations/v8/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ type observerKeeper interface {
SetParams(ctx sdk.Context, params types.Params)
}

// MigrateStore performs in-place store migrations from v6 to v7
// MigrateStore performs in-place store migrations from v7 to v8
func MigrateStore(ctx sdk.Context, observerKeeper observerKeeper) error {
ctx.Logger().Info("Migrating observer store from v6 to v7")
ctx.Logger().Info("Migrating observer store from v7 to v8")
params := observerKeeper.GetParamsIfExists(ctx)
for _, ob := range params.ObserverParams {
chain := chains.GetChainFromChainID(ob.Chain.ChainId)
Expand Down

0 comments on commit 48d1e88

Please sign in to comment.