Skip to content

Commit

Permalink
Merge branch 'develop' into deposit-spl
Browse files Browse the repository at this point in the history
  • Loading branch information
skosito authored Nov 7, 2024
2 parents 1b0afb0 + 1629523 commit 58e50e5
Show file tree
Hide file tree
Showing 21 changed files with 540 additions and 558 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
* [3091](https://github.com/zeta-chain/node/pull/3091) - improve build reproducability. `make release{,-build-only}` checksums should now be stable.
* [3124](https://github.com/zeta-chain/node/pull/3124) - deposit spl integration

### Refactor
* [3122](https://github.com/zeta-chain/node/pull/3122) - improve & refactor zetaclientd cli

### Tests
* [3075](https://github.com/zeta-chain/node/pull/3075) - ton: withdraw concurrent, deposit & revert.

Expand Down
12 changes: 0 additions & 12 deletions cmd/config.go

This file was deleted.

36 changes: 36 additions & 0 deletions cmd/cosmos.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Package cmd provides cosmos constants for ZetaClient.
package cmd

import (
"sync"

cosmos "github.com/cosmos/cosmos-sdk/types"
)

const (
Bech32PrefixAccAddr = "zeta"
Bech32PrefixAccPub = "zetapub"
Bech32PrefixValAddr = "zetav"
Bech32PrefixValPub = "zetavpub"
Bech32PrefixConsAddr = "zetac"
Bech32PrefixConsPub = "zetacpub"
DenomRegex = `[a-zA-Z][a-zA-Z0-9:\\/\\\-\\_\\.]{2,127}`
ZetaChainHDPath string = `m/44'/60'/0'/0/0`
)

var setupConfig sync.Once

// SetupCosmosConfig configures basic Cosmos parameters.
// This function is required because some parts of ZetaClient rely on these constants.
func SetupCosmosConfig() {
setupConfig.Do(setupCosmosConfig)
}

func setupCosmosConfig() {
config := cosmos.GetConfig()
config.SetBech32PrefixForAccount(Bech32PrefixAccAddr, Bech32PrefixAccPub)
config.SetBech32PrefixForValidator(Bech32PrefixValAddr, Bech32PrefixValPub)
config.SetBech32PrefixForConsensusNode(Bech32PrefixConsAddr, Bech32PrefixConsPub)
config.SetFullFundraiserPath(ZetaChainHDPath)
cosmos.SetCoinDenomRegex(func() string { return DenomRegex })
}
47 changes: 0 additions & 47 deletions cmd/zetaclientd/encrypt_tss.go

This file was deleted.

40 changes: 0 additions & 40 deletions cmd/zetaclientd/gen_pre_params.go

This file was deleted.

153 changes: 0 additions & 153 deletions cmd/zetaclientd/import_relayer_keys.go

This file was deleted.

39 changes: 13 additions & 26 deletions cmd/zetaclientd/debug.go → cmd/zetaclientd/inbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"context"
"fmt"
"os"
"strconv"
"strings"

Expand All @@ -26,36 +25,24 @@ import (
"github.com/zeta-chain/node/zetaclient/zetacore"
)

var debugArgs = debugArguments{}

type debugArguments struct {
zetaCoreHome string
zetaNode string
zetaChainID string
type inboundOptions struct {
Node string
ChainID string
}

func init() {
defaultHomeDir := os.ExpandEnv("$HOME/.zetacored")
var inboundOpts inboundOptions

cmd := DebugCmd()
cmd.Flags().StringVar(&debugArgs.zetaCoreHome, "core-home", defaultHomeDir, "zetacore home directory")
cmd.Flags().StringVar(&debugArgs.zetaNode, "node", "46.4.15.110", "public ip address")
cmd.Flags().StringVar(&debugArgs.zetaChainID, "chain-id", "athens_7001-1", "pre-params file path")
func setupInboundOptions() {
f, cfg := InboundCmd.PersistentFlags(), &inboundOpts

RootCmd.AddCommand(cmd)
f.StringVar(&cfg.Node, "node", "46.4.15.110", "zeta public ip address")
f.StringVar(&cfg.ChainID, "chain-id", "athens_7001-1", "zeta chain id")
}

func DebugCmd() *cobra.Command {
return &cobra.Command{
Use: "get-inbound-ballot [inboundHash] [chainID]",
Short: "provide txHash and chainID to get the ballot status for the txHash",
RunE: debugCmd,
}
}

func debugCmd(_ *cobra.Command, args []string) error {
func InboundGetBallot(_ *cobra.Command, args []string) error {
cobra.ExactArgs(2)
cfg, err := config.Load(debugArgs.zetaCoreHome)

cfg, err := config.Load(globalOpts.ZetacoreHome)
if err != nil {
return errors.Wrap(err, "failed to load config")
}
Expand All @@ -70,9 +57,9 @@ func debugCmd(_ *cobra.Command, args []string) error {
// create a new zetacore client
client, err := zetacore.NewClient(
&keys.Keys{OperatorAddress: sdk.MustAccAddressFromBech32(sample.AccAddress())},
debugArgs.zetaNode,
inboundOpts.Node,
"",
debugArgs.zetaChainID,
inboundOpts.ChainID,
zerolog.Nop(),
)
if err != nil {
Expand Down
Loading

0 comments on commit 58e50e5

Please sign in to comment.