Skip to content

Commit

Permalink
Fix: update major version (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
fjchen7 authored Sep 27, 2022
1 parent 73393a9 commit f4ef02c
Show file tree
Hide file tree
Showing 61 changed files with 185 additions and 170 deletions.
6 changes: 3 additions & 3 deletions address/address.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package address
import (
"errors"
"fmt"
"github.com/nervosnetwork/ckb-sdk-go/crypto/bech32"
"github.com/nervosnetwork/ckb-sdk-go/types"
"github.com/nervosnetwork/ckb-sdk-go/v2/crypto/bech32"
"github.com/nervosnetwork/ckb-sdk-go/v2/types"
)

type Address struct {
Expand Down Expand Up @@ -226,4 +226,4 @@ func fromHrp(hrp string) (types.Network, error) {
default:
return 0, errors.New("unknown hrp")
}
}
}
4 changes: 2 additions & 2 deletions address/address_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package address

import (
"github.com/ethereum/go-ethereum/common"
"github.com/nervosnetwork/ckb-sdk-go/types"
"github.com/nervosnetwork/ckb-sdk-go/v2/types"
"github.com/stretchr/testify/assert"
"testing"
)
Expand Down Expand Up @@ -145,4 +145,4 @@ func TestInvalidDecode(t *testing.T) {
assert.NotNil(t, err)
_, err = Decode("ckb1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqj0k2lzuhgvrgacvnhnzl8")
assert.NotNil(t, err)
}
}
12 changes: 6 additions & 6 deletions address/address_tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"errors"
"fmt"
"github.com/ethereum/go-ethereum/common"
"github.com/nervosnetwork/ckb-sdk-go/crypto/blake2b"
"github.com/nervosnetwork/ckb-sdk-go/crypto/secp256k1"
"github.com/nervosnetwork/ckb-sdk-go/transaction/signer"
"github.com/nervosnetwork/ckb-sdk-go/types"
"github.com/nervosnetwork/ckb-sdk-go/utils"
"github.com/nervosnetwork/ckb-sdk-go/v2/crypto/blake2b"
"github.com/nervosnetwork/ckb-sdk-go/v2/crypto/secp256k1"
"github.com/nervosnetwork/ckb-sdk-go/v2/transaction/signer"
"github.com/nervosnetwork/ckb-sdk-go/v2/types"
"github.com/nervosnetwork/ckb-sdk-go/v2/utils"
)

func GenerateScriptSecp256K1Blake160SignhashAll(key *secp256k1.Secp256k1Key) *types.Script {
Expand Down Expand Up @@ -108,4 +108,4 @@ func GenerateSecp256k1Blake160MultisigScript(requireN, threshold int, publicKeys
HashType: types.HashTypeType,
Args: args,
}, multisigScript.Encode(), nil
}
}
8 changes: 4 additions & 4 deletions address/address_tools_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package address
import (
"encoding/hex"
"github.com/ethereum/go-ethereum/common"
"github.com/nervosnetwork/ckb-sdk-go/crypto/blake2b"
"github.com/nervosnetwork/ckb-sdk-go/crypto/secp256k1"
"github.com/nervosnetwork/ckb-sdk-go/types"
"github.com/nervosnetwork/ckb-sdk-go/v2/crypto/blake2b"
"github.com/nervosnetwork/ckb-sdk-go/v2/crypto/secp256k1"
"github.com/nervosnetwork/ckb-sdk-go/v2/types"
"github.com/stretchr/testify/assert"
"testing"
)
Expand Down Expand Up @@ -111,4 +111,4 @@ func TestGenerateSecp256k1MultisigScriptByHash(t *testing.T) {
t.Error(err)
}
assert.Equal(t, "ckt1qpw9q60tppt7l3j7r09qcp7lxnp3vcanvgha8pmvsa3jplykxn32sq0sfnkgf0ph76pkzwld9ujzex4pkeuwnlsdc5tqu", encoded)
}
}
12 changes: 6 additions & 6 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ package api

import (
"context"
"github.com/nervosnetwork/ckb-sdk-go/transaction"
"github.com/nervosnetwork/ckb-sdk-go/v2/transaction"

"github.com/ethereum/go-ethereum/rpc"
"github.com/nervosnetwork/ckb-sdk-go/indexer"
"github.com/nervosnetwork/ckb-sdk-go/mercury"
"github.com/nervosnetwork/ckb-sdk-go/mercury/model"
C "github.com/nervosnetwork/ckb-sdk-go/rpc"
"github.com/nervosnetwork/ckb-sdk-go/types"
"github.com/nervosnetwork/ckb-sdk-go/v2/indexer"
"github.com/nervosnetwork/ckb-sdk-go/v2/mercury"
"github.com/nervosnetwork/ckb-sdk-go/v2/mercury/model"
C "github.com/nervosnetwork/ckb-sdk-go/v2/rpc"
"github.com/nervosnetwork/ckb-sdk-go/v2/types"
)

type CkbApi interface {
Expand Down
10 changes: 5 additions & 5 deletions collector/builder/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package builder

import (
"errors"
"github.com/nervosnetwork/ckb-sdk-go/address"
"github.com/nervosnetwork/ckb-sdk-go/collector"
"github.com/nervosnetwork/ckb-sdk-go/collector/handler"
"github.com/nervosnetwork/ckb-sdk-go/transaction"
"github.com/nervosnetwork/ckb-sdk-go/types"
"github.com/nervosnetwork/ckb-sdk-go/v2/address"
"github.com/nervosnetwork/ckb-sdk-go/v2/collector"
"github.com/nervosnetwork/ckb-sdk-go/v2/collector/handler"
"github.com/nervosnetwork/ckb-sdk-go/v2/transaction"
"github.com/nervosnetwork/ckb-sdk-go/v2/types"
"reflect"
"strconv"
)
Expand Down
2 changes: 1 addition & 1 deletion collector/builder/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package builder

import (
"github.com/ethereum/go-ethereum/common"
"github.com/nervosnetwork/ckb-sdk-go/types"
"github.com/nervosnetwork/ckb-sdk-go/v2/types"
"github.com/stretchr/testify/assert"
"testing"
)
Expand Down
10 changes: 5 additions & 5 deletions collector/builder/ckb.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package builder

import (
"errors"
"github.com/nervosnetwork/ckb-sdk-go/address"
"github.com/nervosnetwork/ckb-sdk-go/collector"
"github.com/nervosnetwork/ckb-sdk-go/collector/handler"
"github.com/nervosnetwork/ckb-sdk-go/transaction"
"github.com/nervosnetwork/ckb-sdk-go/types"
"github.com/nervosnetwork/ckb-sdk-go/v2/address"
"github.com/nervosnetwork/ckb-sdk-go/v2/collector"
"github.com/nervosnetwork/ckb-sdk-go/v2/collector/handler"
"github.com/nervosnetwork/ckb-sdk-go/v2/transaction"
"github.com/nervosnetwork/ckb-sdk-go/v2/types"
)

type CkbTransactionBuilder struct {
Expand Down
10 changes: 5 additions & 5 deletions collector/builder/dao.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
"context"
"encoding/binary"
"errors"
"github.com/nervosnetwork/ckb-sdk-go/address"
"github.com/nervosnetwork/ckb-sdk-go/collector"
"github.com/nervosnetwork/ckb-sdk-go/collector/handler"
"github.com/nervosnetwork/ckb-sdk-go/rpc"
"github.com/nervosnetwork/ckb-sdk-go/types"
"github.com/nervosnetwork/ckb-sdk-go/v2/address"
"github.com/nervosnetwork/ckb-sdk-go/v2/collector"
"github.com/nervosnetwork/ckb-sdk-go/v2/collector/handler"
"github.com/nervosnetwork/ckb-sdk-go/v2/rpc"
"github.com/nervosnetwork/ckb-sdk-go/v2/types"
"math/big"
)

Expand Down
10 changes: 5 additions & 5 deletions collector/builder/sudt.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package builder

import (
"errors"
"github.com/nervosnetwork/ckb-sdk-go/address"
"github.com/nervosnetwork/ckb-sdk-go/collector"
"github.com/nervosnetwork/ckb-sdk-go/transaction"
"github.com/nervosnetwork/ckb-sdk-go/types"
"github.com/nervosnetwork/ckb-sdk-go/utils"
"github.com/nervosnetwork/ckb-sdk-go/v2/address"
"github.com/nervosnetwork/ckb-sdk-go/v2/collector"
"github.com/nervosnetwork/ckb-sdk-go/v2/transaction"
"github.com/nervosnetwork/ckb-sdk-go/v2/types"
"github.com/nervosnetwork/ckb-sdk-go/v2/utils"
"math/big"
"reflect"
)
Expand Down
9 changes: 4 additions & 5 deletions collector/builder/sudt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package builder

import (
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/nervosnetwork/ckb-sdk-go/address"
"github.com/nervosnetwork/ckb-sdk-go/types"
"github.com/nervosnetwork/ckb-sdk-go/utils"
"github.com/nervosnetwork/ckb-sdk-go/v2/address"
"github.com/nervosnetwork/ckb-sdk-go/v2/types"
"github.com/nervosnetwork/ckb-sdk-go/v2/utils"
"github.com/stretchr/testify/assert"
"math/big"
"testing"
Expand Down Expand Up @@ -73,8 +73,7 @@ func TestSudtTransactionBuilderBalance(t *testing.T) {
t.Error(err)
}

if _, err = b.AddSudtOutputByAddress("ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqdamwzrffgc54ef48493nfd2sd0h4cjnxg4850up", big.NewInt(1))
err != nil {
if _, err = b.AddSudtOutputByAddress("ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqdamwzrffgc54ef48493nfd2sd0h4cjnxg4850up", big.NewInt(1)); err != nil {
t.Error(err)
}
b.FeeRate = 1000
Expand Down
18 changes: 9 additions & 9 deletions collector/example/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import (
"context"
"fmt"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/nervosnetwork/ckb-sdk-go/address"
"github.com/nervosnetwork/ckb-sdk-go/collector"
builder2 "github.com/nervosnetwork/ckb-sdk-go/collector/builder"
"github.com/nervosnetwork/ckb-sdk-go/collector/handler"
"github.com/nervosnetwork/ckb-sdk-go/indexer"
"github.com/nervosnetwork/ckb-sdk-go/rpc"
"github.com/nervosnetwork/ckb-sdk-go/transaction"
"github.com/nervosnetwork/ckb-sdk-go/transaction/signer"
"github.com/nervosnetwork/ckb-sdk-go/types"
"github.com/nervosnetwork/ckb-sdk-go/v2/address"
"github.com/nervosnetwork/ckb-sdk-go/v2/collector"
builder2 "github.com/nervosnetwork/ckb-sdk-go/v2/collector/builder"
"github.com/nervosnetwork/ckb-sdk-go/v2/collector/handler"
"github.com/nervosnetwork/ckb-sdk-go/v2/indexer"
"github.com/nervosnetwork/ckb-sdk-go/v2/rpc"
"github.com/nervosnetwork/ckb-sdk-go/v2/transaction"
"github.com/nervosnetwork/ckb-sdk-go/v2/transaction/signer"
"github.com/nervosnetwork/ckb-sdk-go/v2/types"
"math/big"
)

Expand Down
8 changes: 4 additions & 4 deletions collector/handler/ckb.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package handler

import (
"github.com/nervosnetwork/ckb-sdk-go/collector"
"github.com/nervosnetwork/ckb-sdk-go/transaction"
"github.com/nervosnetwork/ckb-sdk-go/transaction/signer"
"github.com/nervosnetwork/ckb-sdk-go/types"
"github.com/nervosnetwork/ckb-sdk-go/v2/collector"
"github.com/nervosnetwork/ckb-sdk-go/v2/transaction"
"github.com/nervosnetwork/ckb-sdk-go/v2/transaction/signer"
"github.com/nervosnetwork/ckb-sdk-go/v2/types"
"reflect"
)

Expand Down
8 changes: 4 additions & 4 deletions collector/handler/dao.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"bytes"
"context"
"errors"
"github.com/nervosnetwork/ckb-sdk-go/collector"
"github.com/nervosnetwork/ckb-sdk-go/rpc"
"github.com/nervosnetwork/ckb-sdk-go/transaction"
"github.com/nervosnetwork/ckb-sdk-go/types"
"github.com/nervosnetwork/ckb-sdk-go/v2/collector"
"github.com/nervosnetwork/ckb-sdk-go/v2/rpc"
"github.com/nervosnetwork/ckb-sdk-go/v2/transaction"
"github.com/nervosnetwork/ckb-sdk-go/v2/types"
"reflect"
)

Expand Down
6 changes: 3 additions & 3 deletions collector/handler/sudt.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package handler

import (
"github.com/nervosnetwork/ckb-sdk-go/collector"
"github.com/nervosnetwork/ckb-sdk-go/transaction"
"github.com/nervosnetwork/ckb-sdk-go/types"
"github.com/nervosnetwork/ckb-sdk-go/v2/collector"
"github.com/nervosnetwork/ckb-sdk-go/v2/transaction"
"github.com/nervosnetwork/ckb-sdk-go/v2/types"
"reflect"
)

Expand Down
4 changes: 2 additions & 2 deletions collector/interface.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package collector

import (
"github.com/nervosnetwork/ckb-sdk-go/transaction"
"github.com/nervosnetwork/ckb-sdk-go/types"
"github.com/nervosnetwork/ckb-sdk-go/v2/transaction"
"github.com/nervosnetwork/ckb-sdk-go/v2/types"
)

type TransactionBuilder interface {
Expand Down
6 changes: 3 additions & 3 deletions collector/iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package collector

import (
"context"
"github.com/nervosnetwork/ckb-sdk-go/address"
"github.com/nervosnetwork/ckb-sdk-go/indexer"
"github.com/nervosnetwork/ckb-sdk-go/types"
"github.com/nervosnetwork/ckb-sdk-go/v2/address"
"github.com/nervosnetwork/ckb-sdk-go/v2/indexer"
"github.com/nervosnetwork/ckb-sdk-go/v2/types"
)

type CellIterator interface {
Expand Down
4 changes: 2 additions & 2 deletions collector/iterator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package collector

import (
"github.com/ethereum/go-ethereum/common"
"github.com/nervosnetwork/ckb-sdk-go/indexer"
"github.com/nervosnetwork/ckb-sdk-go/types"
"github.com/nervosnetwork/ckb-sdk-go/v2/indexer"
"github.com/nervosnetwork/ckb-sdk-go/v2/types"
"github.com/stretchr/testify/assert"
"testing"
)
Expand Down
6 changes: 3 additions & 3 deletions collector/live_cell_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package collector

import (
"context"
"github.com/nervosnetwork/ckb-sdk-go/indexer"
"github.com/nervosnetwork/ckb-sdk-go/rpc"
"github.com/nervosnetwork/ckb-sdk-go/types"
"github.com/nervosnetwork/ckb-sdk-go/v2/indexer"
"github.com/nervosnetwork/ckb-sdk-go/v2/rpc"
"github.com/nervosnetwork/ckb-sdk-go/v2/types"
"github.com/pkg/errors"
)

Expand Down
4 changes: 2 additions & 2 deletions crypto/key.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package crypto

import (
"github.com/nervosnetwork/ckb-sdk-go/types"
"github.com/nervosnetwork/ckb-sdk-go/utils"
"github.com/nervosnetwork/ckb-sdk-go/v2/types"
"github.com/nervosnetwork/ckb-sdk-go/v2/utils"
)

// Key key pair
Expand Down
8 changes: 4 additions & 4 deletions crypto/secp256k1/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import (
"github.com/ethereum/go-ethereum/crypto/secp256k1"
"math/big"

"github.com/nervosnetwork/ckb-sdk-go/crypto"
"github.com/nervosnetwork/ckb-sdk-go/crypto/blake2b"
"github.com/nervosnetwork/ckb-sdk-go/types"
"github.com/nervosnetwork/ckb-sdk-go/utils"
"github.com/nervosnetwork/ckb-sdk-go/v2/crypto"
"github.com/nervosnetwork/ckb-sdk-go/v2/crypto/blake2b"
"github.com/nervosnetwork/ckb-sdk-go/v2/types"
"github.com/nervosnetwork/ckb-sdk-go/v2/utils"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions dao/deposit.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package dao
import (
"errors"

"github.com/nervosnetwork/ckb-sdk-go/types"
"github.com/nervosnetwork/ckb-sdk-go/utils"
"github.com/nervosnetwork/ckb-sdk-go/v2/types"
"github.com/nervosnetwork/ckb-sdk-go/v2/utils"
)

type Deposit struct {
Expand Down
4 changes: 2 additions & 2 deletions dao/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"encoding/binary"
"errors"
"github.com/nervosnetwork/ckb-sdk-go/rpc"
"github.com/nervosnetwork/ckb-sdk-go/types"
"github.com/nervosnetwork/ckb-sdk-go/v2/rpc"
"github.com/nervosnetwork/ckb-sdk-go/v2/types"
"math/big"
)

Expand Down
4 changes: 2 additions & 2 deletions dao/helper_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package dao

import (
"github.com/nervosnetwork/ckb-sdk-go/rpc"
"github.com/nervosnetwork/ckb-sdk-go/types"
"github.com/nervosnetwork/ckb-sdk-go/v2/rpc"
"github.com/nervosnetwork/ckb-sdk-go/v2/types"
"github.com/stretchr/testify/assert"
"testing"
)
Expand Down
6 changes: 3 additions & 3 deletions dao/withdraw.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"errors"
"fmt"

"github.com/nervosnetwork/ckb-sdk-go/rpc"
"github.com/nervosnetwork/ckb-sdk-go/types"
"github.com/nervosnetwork/ckb-sdk-go/utils"
"github.com/nervosnetwork/ckb-sdk-go/v2/rpc"
"github.com/nervosnetwork/ckb-sdk-go/v2/types"
"github.com/nervosnetwork/ckb-sdk-go/v2/utils"
)

type WithdrawPhase1 struct {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/nervosnetwork/ckb-sdk-go
module github.com/nervosnetwork/ckb-sdk-go/v2

go 1.17

Expand Down
Loading

0 comments on commit f4ef02c

Please sign in to comment.