Skip to content

Commit

Permalink
Merge pull request #114 from Zilliqa/109_bump_major_version
Browse files Browse the repository at this point in the history
109 bump major version
  • Loading branch information
rrw-zilliqa authored Jan 20, 2023
2 parents d457f1b + 5c40fec commit 369a05d
Show file tree
Hide file tree
Showing 54 changed files with 137 additions and 119 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ LABEL maintainer="Richard Watts <[email protected]>"
WORKDIR /app
COPY ./ .
RUN apk add build-base
RUN go test -c -o ./test github.com/Zilliqa/gozilliqa-sdk/provider
RUN go test -c -o ./test github.com/Zilliqa/gozilliqa-sdk/v3/provider
RUN CI=true go tool test2json -t ./test -test.v
26 changes: 21 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,32 @@ The golang version of zilliqa blockchain library

#### Requirements

golang environment:
golang environment:

* [download golang](https://golang.org/dl/)
* [installation instructions](https://golang.org/doc/install)

#### Installation

The sdk is using `go mod` to manager it's dependent libraries, so if you do want to hack the source code of this repository, make sure you have the minimal `golang` version that support `go mod` and enable it.
This sdk uses `go mod` to manage its dependent libraries.

Install the dependent libraries:
To install dependencies:

```go
go get ./...
```

sdk it self cannot been built into a binary cause it does't have any `main` function, you can directly add it to your own project as a library. Also, we recommend that you can run the `golang uint test` or go through
the section `quick start` first to get a basic understanding before you start to use this sdk.
To build:

```go
go build ./...
```

To run the unit tests (which require access to the Zilliqa testnet):

```go
go test ./...
```

#### Supports

Expand Down Expand Up @@ -438,3 +447,10 @@ func TestContract_Call(t *testing.T) {
assert.True(t, tx.Status == core.Confirmed)
}
```

#### A note on versions

This module was originally referenced using pseudo-versions and releases up to v2.4.0 were published as github releases without backward compatibility.
Sadly, go modules require version `n` (`n>=2`) modules to have a `/v<n>` tag in their paths, and so we now do.
Since this is a breaking change, we've elected to bump the major version to 3, which means that in fact the go module path is now `/v3`.
Hopefully the version churn will now stop.
6 changes: 3 additions & 3 deletions account/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ package account
import (
"fmt"

"github.com/Zilliqa/gozilliqa-sdk/crypto"
"github.com/Zilliqa/gozilliqa-sdk/keytools"
"github.com/Zilliqa/gozilliqa-sdk/util"
"github.com/Zilliqa/gozilliqa-sdk/v3/crypto"
"github.com/Zilliqa/gozilliqa-sdk/v3/keytools"
"github.com/Zilliqa/gozilliqa-sdk/v3/util"
"github.com/btcsuite/btcd/btcutil/hdkeychain"
"github.com/btcsuite/btcd/chaincfg"
"github.com/tyler-smith/go-bip39"
Expand Down
2 changes: 1 addition & 1 deletion account/account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package account

import (
"github.com/Zilliqa/gozilliqa-sdk/util"
"github.com/Zilliqa/gozilliqa-sdk/v3/util"
"github.com/stretchr/testify/assert"
"testing"
)
Expand Down
16 changes: 8 additions & 8 deletions account/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ package account
import (
"errors"
"fmt"
"github.com/Zilliqa/gozilliqa-sdk/bech32"
"github.com/Zilliqa/gozilliqa-sdk/crypto"
"github.com/Zilliqa/gozilliqa-sdk/keytools"
"github.com/Zilliqa/gozilliqa-sdk/provider"
go_schnorr "github.com/Zilliqa/gozilliqa-sdk/schnorr"
"github.com/Zilliqa/gozilliqa-sdk/transaction"
"github.com/Zilliqa/gozilliqa-sdk/util"
"github.com/Zilliqa/gozilliqa-sdk/validator"
"github.com/Zilliqa/gozilliqa-sdk/v3/bech32"
"github.com/Zilliqa/gozilliqa-sdk/v3/crypto"
"github.com/Zilliqa/gozilliqa-sdk/v3/keytools"
"github.com/Zilliqa/gozilliqa-sdk/v3/provider"
go_schnorr "github.com/Zilliqa/gozilliqa-sdk/v3/schnorr"
"github.com/Zilliqa/gozilliqa-sdk/v3/transaction"
"github.com/Zilliqa/gozilliqa-sdk/v3/util"
"github.com/Zilliqa/gozilliqa-sdk/v3/validator"
"math/big"
"strconv"
"strings"
Expand Down
8 changes: 4 additions & 4 deletions account/wallet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import (
"strconv"
"testing"

"github.com/Zilliqa/gozilliqa-sdk/core"
provider2 "github.com/Zilliqa/gozilliqa-sdk/provider"
"github.com/Zilliqa/gozilliqa-sdk/transaction"
"github.com/Zilliqa/gozilliqa-sdk/util"
"github.com/Zilliqa/gozilliqa-sdk/v3/core"
provider2 "github.com/Zilliqa/gozilliqa-sdk/v3/provider"
"github.com/Zilliqa/gozilliqa-sdk/v3/transaction"
"github.com/Zilliqa/gozilliqa-sdk/v3/util"
"github.com/stretchr/testify/assert"
)

Expand Down
4 changes: 2 additions & 2 deletions bech32/bech32.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"fmt"
"strings"

"github.com/Zilliqa/gozilliqa-sdk/util"
"github.com/Zilliqa/gozilliqa-sdk/validator"
"github.com/Zilliqa/gozilliqa-sdk/v3/util"
"github.com/Zilliqa/gozilliqa-sdk/v3/validator"
)

const charset = "qpzry9x8gf2tvdw0s3jn54khce6mua7l"
Expand Down
10 changes: 5 additions & 5 deletions contract/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ package contract

import (
"errors"
"github.com/Zilliqa/gozilliqa-sdk/account"
"github.com/Zilliqa/gozilliqa-sdk/core"
"github.com/Zilliqa/gozilliqa-sdk/provider"
"github.com/Zilliqa/gozilliqa-sdk/transaction"
"github.com/Zilliqa/gozilliqa-sdk/util"
"github.com/Zilliqa/gozilliqa-sdk/v3/account"
"github.com/Zilliqa/gozilliqa-sdk/v3/core"
"github.com/Zilliqa/gozilliqa-sdk/v3/provider"
"github.com/Zilliqa/gozilliqa-sdk/v3/transaction"
"github.com/Zilliqa/gozilliqa-sdk/v3/util"
"strconv"
"strings"
)
Expand Down
6 changes: 3 additions & 3 deletions contract/contract_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ package contract
import (
"crypto/sha256"
"fmt"
"github.com/Zilliqa/gozilliqa-sdk/keytools"
"github.com/Zilliqa/gozilliqa-sdk/transaction"
"github.com/Zilliqa/gozilliqa-sdk/util"
"github.com/Zilliqa/gozilliqa-sdk/v3/keytools"
"github.com/Zilliqa/gozilliqa-sdk/v3/transaction"
"github.com/Zilliqa/gozilliqa-sdk/v3/util"
"strconv"
)

Expand Down
4 changes: 2 additions & 2 deletions contract/contract_factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
package contract

import (
"github.com/Zilliqa/gozilliqa-sdk/core"
"github.com/Zilliqa/gozilliqa-sdk/transaction"
"github.com/Zilliqa/gozilliqa-sdk/v3/core"
"github.com/Zilliqa/gozilliqa-sdk/v3/transaction"
"github.com/stretchr/testify/assert"
"testing"
)
Expand Down
10 changes: 5 additions & 5 deletions contract/contract_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ package contract

import (
"fmt"
"github.com/Zilliqa/gozilliqa-sdk/core"
"github.com/Zilliqa/gozilliqa-sdk/v3/core"
"github.com/stretchr/testify/assert"
"io/ioutil"
"os"
"strconv"
"testing"

"github.com/Zilliqa/gozilliqa-sdk/account"
"github.com/Zilliqa/gozilliqa-sdk/keytools"
provider2 "github.com/Zilliqa/gozilliqa-sdk/provider"
"github.com/Zilliqa/gozilliqa-sdk/util"
"github.com/Zilliqa/gozilliqa-sdk/v3/account"
"github.com/Zilliqa/gozilliqa-sdk/v3/keytools"
provider2 "github.com/Zilliqa/gozilliqa-sdk/v3/provider"
"github.com/Zilliqa/gozilliqa-sdk/v3/util"
)

func TestContract_DeployTo(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion contract/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
package contract

import "github.com/Zilliqa/gozilliqa-sdk/core"
import "github.com/Zilliqa/gozilliqa-sdk/v3/core"

type Data struct {
Tag string `json:"_tag"`
Expand Down
2 changes: 1 addition & 1 deletion core/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package core

import (
protobuf "github.com/Zilliqa/gozilliqa-sdk/protobuf"
protobuf "github.com/Zilliqa/gozilliqa-sdk/v3/protobuf"
"github.com/golang/protobuf/proto"
)

Expand Down
2 changes: 1 addition & 1 deletion core/account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package core

import (
"github.com/Zilliqa/gozilliqa-sdk/util"
"github.com/Zilliqa/gozilliqa-sdk/v3/util"
"testing"
)

Expand Down
2 changes: 1 addition & 1 deletion core/blockbase.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
package core

import "github.com/Zilliqa/gozilliqa-sdk/protobuf"
import "github.com/Zilliqa/gozilliqa-sdk/v3/protobuf"

type BlockBase struct {
BlockHash [32]byte
Expand Down
2 changes: 1 addition & 1 deletion core/blockheaderbase.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
package core

import "github.com/Zilliqa/gozilliqa-sdk/protobuf"
import "github.com/Zilliqa/gozilliqa-sdk/v3/protobuf"

type BlockHeaderBase struct {
Version uint32
Expand Down
4 changes: 2 additions & 2 deletions core/dsblock.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
package core

import (
"github.com/Zilliqa/gozilliqa-sdk/protobuf"
"github.com/Zilliqa/gozilliqa-sdk/util"
"github.com/Zilliqa/gozilliqa-sdk/v3/protobuf"
"github.com/Zilliqa/gozilliqa-sdk/v3/util"
"github.com/golang/protobuf/proto"
"strconv"
)
Expand Down
4 changes: 2 additions & 2 deletions core/dsblock_header.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
package core

import (
"github.com/Zilliqa/gozilliqa-sdk/protobuf"
"github.com/Zilliqa/gozilliqa-sdk/util"
"github.com/Zilliqa/gozilliqa-sdk/v3/protobuf"
"github.com/Zilliqa/gozilliqa-sdk/v3/util"
"github.com/golang/protobuf/proto"
"math/big"
"strconv"
Expand Down
4 changes: 2 additions & 2 deletions core/dsblock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ package core

import (
"encoding/json"
"github.com/Zilliqa/gozilliqa-sdk/multisig"
"github.com/Zilliqa/gozilliqa-sdk/util"
"github.com/Zilliqa/gozilliqa-sdk/v3/multisig"
"github.com/Zilliqa/gozilliqa-sdk/v3/util"
"io/ioutil"
"strings"
"testing"
Expand Down
2 changes: 1 addition & 1 deletion core/ecpoint_serialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package core

import (
"crypto/elliptic"
"github.com/Zilliqa/gozilliqa-sdk/keytools"
"github.com/Zilliqa/gozilliqa-sdk/v3/keytools"
"math/big"
)

Expand Down
2 changes: 1 addition & 1 deletion core/peer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package core

import (
"github.com/Zilliqa/gozilliqa-sdk/util"
"github.com/Zilliqa/gozilliqa-sdk/v3/util"
"math/big"
"testing"
)
Expand Down
2 changes: 1 addition & 1 deletion core/signature_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package core

import (
"github.com/Zilliqa/gozilliqa-sdk/util"
"github.com/Zilliqa/gozilliqa-sdk/v3/util"
"math/big"
"strings"
"testing"
Expand Down
2 changes: 1 addition & 1 deletion core/swinfo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package core

import (
"github.com/Zilliqa/gozilliqa-sdk/util"
"github.com/Zilliqa/gozilliqa-sdk/v3/util"
"testing"
)

Expand Down
2 changes: 1 addition & 1 deletion core/txblock.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package core

import (
"github.com/Zilliqa/gozilliqa-sdk/util"
"github.com/Zilliqa/gozilliqa-sdk/v3/util"
"strconv"
)

Expand Down
4 changes: 2 additions & 2 deletions core/txblock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ package core

import (
"encoding/json"
"github.com/Zilliqa/gozilliqa-sdk/multisig"
"github.com/Zilliqa/gozilliqa-sdk/util"
"github.com/Zilliqa/gozilliqa-sdk/v3/multisig"
"github.com/Zilliqa/gozilliqa-sdk/v3/util"
"io/ioutil"
"strings"
"testing"
Expand Down
4 changes: 2 additions & 2 deletions core/txblockheader.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
package core

import (
"github.com/Zilliqa/gozilliqa-sdk/protobuf"
"github.com/Zilliqa/gozilliqa-sdk/util"
"github.com/Zilliqa/gozilliqa-sdk/v3/protobuf"
"github.com/Zilliqa/gozilliqa-sdk/v3/util"
"github.com/golang/protobuf/proto"
"math/big"
"strconv"
Expand Down
16 changes: 8 additions & 8 deletions crosschain/polynetwork/cross_chain_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ package polynetwork
import (
"errors"
"fmt"
"github.com/Zilliqa/gozilliqa-sdk/account"
"github.com/Zilliqa/gozilliqa-sdk/bech32"
"github.com/Zilliqa/gozilliqa-sdk/contract"
"github.com/Zilliqa/gozilliqa-sdk/core"
"github.com/Zilliqa/gozilliqa-sdk/provider"
"github.com/Zilliqa/gozilliqa-sdk/transaction"
"github.com/Zilliqa/gozilliqa-sdk/util"
"github.com/Zilliqa/gozilliqa-sdk/validator"
"github.com/Zilliqa/gozilliqa-sdk/v3/account"
"github.com/Zilliqa/gozilliqa-sdk/v3/bech32"
"github.com/Zilliqa/gozilliqa-sdk/v3/contract"
"github.com/Zilliqa/gozilliqa-sdk/v3/core"
"github.com/Zilliqa/gozilliqa-sdk/v3/provider"
"github.com/Zilliqa/gozilliqa-sdk/v3/transaction"
"github.com/Zilliqa/gozilliqa-sdk/v3/util"
"github.com/Zilliqa/gozilliqa-sdk/v3/validator"
"strconv"
)

Expand Down
14 changes: 7 additions & 7 deletions crosschain/polynetwork/lock_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ package polynetwork
import (
"errors"
"fmt"
"github.com/Zilliqa/gozilliqa-sdk/account"
"github.com/Zilliqa/gozilliqa-sdk/bech32"
"github.com/Zilliqa/gozilliqa-sdk/contract"
"github.com/Zilliqa/gozilliqa-sdk/core"
"github.com/Zilliqa/gozilliqa-sdk/provider"
"github.com/Zilliqa/gozilliqa-sdk/transaction"
"github.com/Zilliqa/gozilliqa-sdk/util"
"github.com/Zilliqa/gozilliqa-sdk/v3/account"
"github.com/Zilliqa/gozilliqa-sdk/v3/bech32"
"github.com/Zilliqa/gozilliqa-sdk/v3/contract"
"github.com/Zilliqa/gozilliqa-sdk/v3/core"
"github.com/Zilliqa/gozilliqa-sdk/v3/provider"
"github.com/Zilliqa/gozilliqa-sdk/v3/transaction"
"github.com/Zilliqa/gozilliqa-sdk/v3/util"
"strconv"
)

Expand Down
2 changes: 1 addition & 1 deletion crosschain/polynetwork/proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package polynetwork

import (
"github.com/Zilliqa/gozilliqa-sdk/util"
"github.com/Zilliqa/gozilliqa-sdk/v3/util"
"strings"
)

Expand Down
4 changes: 2 additions & 2 deletions crypto/keystore.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"errors"
"strings"

"github.com/Zilliqa/gozilliqa-sdk/keytools"
util2 "github.com/Zilliqa/gozilliqa-sdk/util"
"github.com/Zilliqa/gozilliqa-sdk/v3/keytools"
util2 "github.com/Zilliqa/gozilliqa-sdk/v3/util"
"github.com/google/uuid"
)

Expand Down
Loading

0 comments on commit 369a05d

Please sign in to comment.