Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/sprint-1.19' into debug/vc
Browse files Browse the repository at this point in the history
# Conflicts:
#	go.mod
#	go.sum
  • Loading branch information
Jayashsatolia403 committed Jan 17, 2025
2 parents 36ff9d1 + 1d1fd32 commit 4c79a96
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import (
"context"
"encoding/json"
"fmt"
"github.com/0chain/gosdk/core/client"
"github.com/0chain/gosdk/core/conf"
"io/ioutil"
"os"
"path/filepath"
"sync"

"github.com/0chain/gosdk/core/client"
"github.com/0chain/gosdk/core/conf"

"github.com/0chain/gosdk/core/zcncrypto"
"github.com/0chain/gosdk/zboxcore/sdk"
"github.com/0chain/gosdk/zcncore"
Expand Down Expand Up @@ -97,6 +98,7 @@ func initZCNCore() {
blockWorker := cfgConfig.GetString("block_worker")
chainID := cfgConfig.GetString("chain_id")
ethereumNodeURL := cfgConfig.GetString("ethereum_node_url")
zauthServer := cfgConfig.GetString("zauth_server")

cfg := conf.Config{
BlockWorker: blockWorker,
Expand All @@ -106,6 +108,7 @@ func initZCNCore() {
MinConfirmation: minCfm,
ConfirmationChainLength: CfmChainLength,
EthereumNode: ethereumNodeURL,
ZauthServer: zauthServer,
}

err := client.Init(context.Background(), cfg)
Expand Down Expand Up @@ -226,7 +229,6 @@ func createWallet() (string, error) {
}

func loadWallet() {

clientBytes, err := ioutil.ReadFile(cfgWallet)
if err != nil {
ExitWithError("Error reading the wallet", err)
Expand All @@ -243,12 +245,21 @@ func loadWallet() {
clientWallet = &wallet

wg := &sync.WaitGroup{}
err = zcncore.SetWalletInfo(clientConfig, signatureScheme, false)
err = zcncore.SetGeneralWalletInfo(clientConfig, signatureScheme)
if err == nil {
wg.Wait()
} else {
ExitWithError(err.Error())
}

if client.GetClient().IsSplit {
cfg, err := conf.GetClientConfig()
if err != nil {
ExitWithError(err.Error())
}

zcncore.RegisterZauthServer(cfg.ZauthServer)
}
}

func getTxnFee() uint64 {
Expand Down

0 comments on commit 4c79a96

Please sign in to comment.