-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
251 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
docs/cli/zetacored/zetacored_query_authority_show-chain-info.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# query authority show-chain-info | ||
|
||
show the chain info | ||
|
||
``` | ||
zetacored query authority show-chain-info [flags] | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
--grpc-addr string the gRPC endpoint to use for this chain | ||
--grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS | ||
--height int Use a specific height to query state at (this can error if the node is pruning state) | ||
-h, --help help for show-chain-info | ||
--node string [host]:[port] to Tendermint RPC interface for this chain | ||
-o, --output string Output format (text|json) | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
--chain-id string The network chain ID | ||
--home string directory for config and data | ||
--log_format string The logging format (json|plain) | ||
--log_level string The logging level (trace|debug|info|warn|error|fatal|panic) | ||
--log_no_color Disable colored logs | ||
--trace print out full stack trace on errors | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [zetacored query authority](zetacored_query_authority.md) - Querying commands for the authority module | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"chains": [ | ||
{ | ||
"chain_id": 42, | ||
"chain_name": 0, | ||
"network": 0, | ||
"network_type": 0, | ||
"vm": 0, | ||
"consensus": 0, | ||
"is_external": false, | ||
"cctx_gateway": 0 | ||
}, | ||
{ | ||
"chain_id": 84, | ||
"chain_name": 1, | ||
"network": 1, | ||
"network_type": 1, | ||
"vm": 1, | ||
"consensus": 1, | ||
"is_external": true, | ||
"cctx_gateway": 1 | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"items": [ | ||
{ | ||
"address": "zeta1nl7550unvzyswx5ts9m338ufmfydjsz2g0xt74", | ||
"policy_type": 0 | ||
}, | ||
{ | ||
"address": "zeta1n0rn6sne54hv7w2uu93fl48ncyqz97d3kty6sh", | ||
"policy_type": 1 | ||
}, | ||
{ | ||
"address": "zeta1srsq755t654agc0grpxj4y3w0znktrpr9tcdgk", | ||
"policy_type": 2 | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package cli_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
|
||
"github.com/zeta-chain/zetacore/pkg/chains" | ||
"github.com/zeta-chain/zetacore/pkg/testdata" | ||
"github.com/zeta-chain/zetacore/x/authority/client/cli" | ||
) | ||
|
||
func TestReadChainInfoFromFile(t *testing.T) { | ||
fs := testdata.TypesFiles | ||
|
||
chainInfo, err := cli.ReadChainInfoFromFile(fs, "types/chain_info.json") | ||
require.NoError(t, err) | ||
|
||
require.Len(t, chainInfo.Chains, 2) | ||
require.EqualValues(t, chains.Chain{ | ||
ChainId: 42, | ||
ChainName: chains.ChainName_empty, | ||
Network: chains.Network_eth, | ||
NetworkType: chains.NetworkType_mainnet, | ||
Vm: chains.Vm_no_vm, | ||
Consensus: chains.Consensus_ethereum, | ||
IsExternal: false, | ||
CctxGateway: chains.CCTXGateway_zevm, | ||
}, chainInfo.Chains[0]) | ||
require.EqualValues(t, chains.Chain{ | ||
ChainId: 84, | ||
ChainName: chains.ChainName_eth_mainnet, | ||
Network: chains.Network_zeta, | ||
NetworkType: chains.NetworkType_testnet, | ||
Vm: chains.Vm_evm, | ||
Consensus: chains.Consensus_tendermint, | ||
IsExternal: true, | ||
CctxGateway: chains.CCTXGateway_observers, | ||
}, chainInfo.Chains[1]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package cli_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
|
||
"github.com/zeta-chain/zetacore/pkg/testdata" | ||
"github.com/zeta-chain/zetacore/x/authority/client/cli" | ||
authoritytypes "github.com/zeta-chain/zetacore/x/authority/types" | ||
) | ||
|
||
func TestReadPoliciesFromFile(t *testing.T) { | ||
fs := testdata.TypesFiles | ||
|
||
policies, err := cli.ReadPoliciesFromFile(fs, "types/policies.json") | ||
require.NoError(t, err) | ||
|
||
require.Len(t, policies.Items, 3) | ||
require.EqualValues(t, &authoritytypes.Policy{ | ||
PolicyType: authoritytypes.PolicyType_groupEmergency, | ||
Address: "zeta1nl7550unvzyswx5ts9m338ufmfydjsz2g0xt74", | ||
}, policies.Items[0]) | ||
require.EqualValues(t, &authoritytypes.Policy{ | ||
PolicyType: authoritytypes.PolicyType_groupOperational, | ||
Address: "zeta1n0rn6sne54hv7w2uu93fl48ncyqz97d3kty6sh", | ||
}, policies.Items[1]) | ||
require.EqualValues(t, &authoritytypes.Policy{ | ||
PolicyType: authoritytypes.PolicyType_groupAdmin, | ||
Address: "zeta1srsq755t654agc0grpxj4y3w0znktrpr9tcdgk", | ||
}, policies.Items[2]) | ||
} |