Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor with common-sdk integration #21

Open
wants to merge 4 commits into
base: staging
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions core/block/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ package block
import (
"fmt"

"github.com/0chain/gosdk/core/common"
"github.com/0chain/gosdk/core/encryption"
"github.com/0chain/gosdk/core/transaction"
"github.com/0chain/gosdk_common/core/common"
"github.com/0chain/gosdk_common/core/encryption"
"github.com/0chain/gosdk_common/core/transaction"
)

type Key []byte
Expand Down
2 changes: 1 addition & 1 deletion core/conf/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strings"

thrown "github.com/0chain/errors"
"github.com/0chain/gosdk/core/sys"
"github.com/0chain/gosdk_common/core/sys"
"github.com/spf13/viper"
)

Expand Down
2 changes: 1 addition & 1 deletion core/conf/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package conf
import (
"testing"

"github.com/0chain/gosdk/core/conf/mocks"
"github.com/0chain/gosdk_common/core/conf/mocks"
"github.com/stretchr/testify/require"
)

Expand Down
2 changes: 1 addition & 1 deletion core/conf/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"

thrown "github.com/0chain/errors"
"github.com/0chain/gosdk/core/sys"
"github.com/0chain/gosdk_common/core/sys"
"github.com/spf13/viper"
)

Expand Down
8 changes: 4 additions & 4 deletions core/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import (
"time"

"github.com/0chain/errors"
"github.com/0chain/gosdk/core/block"
"github.com/0chain/gosdk/core/encryption"
"github.com/0chain/gosdk/core/util"
"github.com/0chain/gosdk/zboxcore/logger"
"github.com/0chain/gosdk_common/core/block"
"github.com/0chain/gosdk_common/core/encryption"
"github.com/0chain/gosdk_common/core/util"
"github.com/0chain/gosdk_common/zboxcore/logger"
"github.com/ethereum/go-ethereum/common/math"
)

Expand Down
2 changes: 1 addition & 1 deletion core/resty/resty.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"sync"
"time"

"github.com/0chain/gosdk/core/sys"
"github.com/0chain/gosdk_common/core/sys"
)

func clone(m map[string]string) map[string]string {
Expand Down
2 changes: 1 addition & 1 deletion core/resty/resty_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"testing"
"time"

"github.com/0chain/gosdk/core/resty/mocks"
"github.com/0chain/gosdk_common/core/resty/mocks"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
)
Expand Down
2 changes: 1 addition & 1 deletion core/sys/fs_mem.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"syscall/js"
"time"

"github.com/0chain/gosdk/core/common"
"github.com/0chain/gosdk_common/core/common"
"github.com/0chain/gosdk/wasmsdk/jsbridge"
"github.com/valyala/bytebufferpool"
)
Expand Down
2 changes: 1 addition & 1 deletion core/sys/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"os"
"time"

"github.com/0chain/gosdk/core/common"
"github.com/0chain/gosdk_common/core/common"
"github.com/valyala/bytebufferpool"
)

Expand Down
2 changes: 1 addition & 1 deletion core/tokenrate/bancor.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strconv"
"strings"

"github.com/0chain/gosdk/core/resty"
"github.com/0chain/gosdk_common/core/resty"
)

type bancorQuoteQuery struct {
Expand Down
2 changes: 1 addition & 1 deletion core/tokenrate/coingecko.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"net/http"
"strconv"

"github.com/0chain/gosdk/core/resty"
"github.com/0chain/gosdk_common/core/resty"
)

type coingeckoQuoteQuery struct {
Expand Down
2 changes: 1 addition & 1 deletion core/tokenrate/coinmarketcap.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strconv"
"strings"

"github.com/0chain/gosdk/core/resty"
"github.com/0chain/gosdk_common/core/resty"
)

type coinmarketcapQuoteQuery struct {
Expand Down
4 changes: 2 additions & 2 deletions core/tokenrate/tokenrate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"

"github.com/0chain/gosdk/core/resty"
"github.com/0chain/gosdk/zboxcore/mocks"
"github.com/0chain/gosdk_common/core/resty"
"github.com/0chain/gosdk_common/zboxcore/mocks"
)

func TestGetUSD(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion core/tokenrate/uniswap.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strconv"
"strings"

"github.com/0chain/gosdk/core/resty"
"github.com/0chain/gosdk_common/core/resty"
"github.com/machinebox/graphql"
)

Expand Down
6 changes: 3 additions & 3 deletions core/transaction/entity.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"time"

"github.com/0chain/errors"
"github.com/0chain/gosdk/core/common"
"github.com/0chain/gosdk/core/encryption"
"github.com/0chain/gosdk/core/util"
"github.com/0chain/gosdk_common/core/common"
"github.com/0chain/gosdk_common/core/encryption"
"github.com/0chain/gosdk_common/core/util"
lru "github.com/hashicorp/golang-lru"
)

Expand Down
2 changes: 1 addition & 1 deletion core/transaction/entity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package transaction
import (
"testing"

"github.com/0chain/gosdk/core/conf"
"github.com/0chain/gosdk_common/core/conf"
"github.com/stretchr/testify/assert"
)

Expand Down
6 changes: 3 additions & 3 deletions core/transaction/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (

"github.com/0chain/common/core/encryption"
"github.com/0chain/errors"
"github.com/0chain/gosdk/core/conf"
"github.com/0chain/gosdk/core/resty"
"github.com/0chain/gosdk/core/util"
"github.com/0chain/gosdk_common/core/conf"
"github.com/0chain/gosdk_common/core/resty"
"github.com/0chain/gosdk_common/core/util"
)

const retriesCount = 30
Expand Down
2 changes: 1 addition & 1 deletion core/util/merkle_tree_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package util
import (
"encoding/hex"

"github.com/0chain/gosdk/core/encryption"
"github.com/0chain/gosdk_common/core/encryption"
"github.com/minio/sha256-simd"
)

Expand Down
2 changes: 1 addition & 1 deletion core/util/secure_value.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/hex"
"strings"

"github.com/0chain/gosdk/core/encryption"
"github.com/0chain/gosdk_common/core/encryption"
)

// Hashable anything that can provide it's hash
Expand Down
2 changes: 1 addition & 1 deletion core/zcncrypto/bls0chain_herumi.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/0chain/errors"
"github.com/tyler-smith/go-bip39"

"github.com/0chain/gosdk/core/encryption"
"github.com/0chain/gosdk_common/core/encryption"
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion core/zcncrypto/bls0chain_herumi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/0chain/errors"
"github.com/stretchr/testify/require"

"github.com/0chain/gosdk/core/encryption"
"github.com/0chain/gosdk_common/core/encryption"
)

var verifyPublickey = `e8a6cfa7b3076ae7e04764ffdfe341632a136b52953dfafa6926361dd9a466196faecca6f696774bbd64b938ff765dbc837e8766a5e2d8996745b2b94e1beb9e`
Expand Down
2 changes: 1 addition & 1 deletion core/zcncrypto/ed255190chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/0chain/errors"

"github.com/0chain/gosdk/core/encryption"
"github.com/0chain/gosdk_common/core/encryption"
"github.com/tyler-smith/go-bip39"
"golang.org/x/crypto/ed25519"
)
Expand Down
2 changes: 1 addition & 1 deletion core/zcncrypto/signature_scheme.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"os"

"github.com/0chain/errors"
"github.com/0chain/gosdk/core/encryption"
"github.com/0chain/gosdk_common/core/encryption"
"github.com/tyler-smith/go-bip39"
)

Expand Down
2 changes: 1 addition & 1 deletion dev/blobber/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"net/http"

"github.com/0chain/gosdk/dev/blobber/model"
"github.com/0chain/gosdk_common/dev/blobber/model"
"github.com/gorilla/mux"
)

Expand Down
2 changes: 1 addition & 1 deletion dev/blobber/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package blobber
import (
"net/http"

"github.com/0chain/gosdk/dev/mock"
"github.com/0chain/gosdk_common/dev/mock"
"github.com/gorilla/mux"
)

Expand Down
4 changes: 2 additions & 2 deletions dev/blobber/model/ref.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"strconv"
"strings"

"github.com/0chain/gosdk/core/encryption"
"github.com/0chain/gosdk/core/pathutil"
"github.com/0chain/gosdk_common/core/encryption"
"github.com/0chain/gosdk_common/core/pathutil"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions dev/blobber/model/write_marker.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package model

import (
"github.com/0chain/gosdk/core/common"
"github.com/0chain/gosdk/zboxcore/marker"
"github.com/0chain/gosdk_common/core/common"
"github.com/0chain/gosdk_common/zboxcore/marker"
)

type WriteMarker struct {
Expand Down
2 changes: 1 addition & 1 deletion dev/blobber/ref.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package blobber
import (
"sync"

"github.com/0chain/gosdk/dev/blobber/model"
"github.com/0chain/gosdk_common/dev/blobber/model"
)

var referencePathResults = make(map[string]*model.ReferencePathResult)
Expand Down
4 changes: 2 additions & 2 deletions dev/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ package dev
import (
"net/http/httptest"

"github.com/0chain/gosdk/dev/blobber"
"github.com/0chain/gosdk/dev/mock"
"github.com/0chain/gosdk_common/dev/blobber"
"github.com/0chain/gosdk_common/dev/mock"
"github.com/gorilla/mux"
)

Expand Down
25 changes: 12 additions & 13 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/0chain/gosdk
go 1.22.5

require (
github.com/0chain/common v0.0.6-0.20230127095721-8df4d1d72565
github.com/0chain/common v1.18.3
github.com/0chain/errors v1.0.3
github.com/Luzifer/go-openssl/v3 v3.1.0
github.com/btcsuite/btcd v0.23.4
Expand All @@ -28,14 +28,14 @@ require (
github.com/pkg/errors v0.9.1
github.com/shopspring/decimal v1.3.1
github.com/spf13/viper v1.15.0
github.com/stretchr/testify v1.8.4
github.com/stretchr/testify v1.9.0
github.com/tyler-smith/go-bip39 v1.1.0
github.com/uptrace/bunrouter v1.0.20
go.dedis.ch/kyber/v3 v3.1.0
go.uber.org/zap v1.24.0
golang.org/x/crypto v0.17.0
golang.org/x/crypto v0.21.0
golang.org/x/image v0.14.0
golang.org/x/sync v0.5.0
golang.org/x/sync v0.7.0
google.golang.org/grpc v1.53.0
gopkg.in/cheggaaa/pb.v1 v1.0.28
gopkg.in/natefinch/lumberjack.v2 v2.2.1
Expand All @@ -44,6 +44,7 @@ require (
)

require (
github.com/0chain/gosdk_common v0.0.0-20250108074831-524b0ec9b7cd
github.com/hack-pad/go-webworkers v0.1.0
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d
github.com/minio/sha256-simd v1.0.1
Expand All @@ -68,15 +69,15 @@ require (
github.com/felixge/httpsnoop v1.0.3 // indirect
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-stack/stack v1.8.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.3.0 // indirect
github.com/golang/glog v1.0.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/google/flatbuffers v22.9.29+incompatible // indirect
github.com/gorilla/websocket v1.5.0 // indirect
Expand All @@ -87,9 +88,7 @@ require (
github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c // indirect
github.com/huin/goupnp v1.0.3 // indirect
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/matryer/is v1.4.1 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
Expand All @@ -110,21 +109,21 @@ require (
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/status-im/keycard-go v0.2.0 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
github.com/tinylib/msgp v1.1.6 // indirect
github.com/tklauser/go-sysconf v0.3.11 // indirect
github.com/tklauser/numcpus v0.6.0 // indirect
github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa // indirect
github.com/valyala/fasthttp v1.51.0 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
go.dedis.ch/fixbuf v1.0.3 // indirect
go.opencensus.io v0.24.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
)
Expand All @@ -138,7 +137,7 @@ require (
github.com/yusufpapurcu/wmi v1.2.2 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/time v0.3.0 // indirect
google.golang.org/genproto v0.0.0-20230216225411-c8e22ba71e44 // indirect
)
Expand Down
Loading
Loading