Skip to content

Commit

Permalink
update/change_module_path_after_major_update (#106)
Browse files Browse the repository at this point in the history
Change module path after major update
  • Loading branch information
ZhmakAS authored Jul 24, 2024
1 parent f75d256 commit 477d7e0
Show file tree
Hide file tree
Showing 152 changed files with 281 additions and 273 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"fmt"
"net/http"

"github.com/make-software/casper-go-sdk/casper"
"github.com/make-software/casper-go-sdk/v2/casper"
)

func main() {
Expand Down Expand Up @@ -54,7 +54,7 @@ import (
"context"
"log"

"github.com/make-software/casper-go-sdk/sse"
"github.com/make-software/casper-go-sdk/v2/sse"
)

func main() {
Expand Down Expand Up @@ -95,8 +95,8 @@ import (
"math/big"
"net/http"

"github.com/make-software/casper-go-sdk/casper"
"github.com/make-software/casper-go-sdk/types/clvalue"
"github.com/make-software/casper-go-sdk/v2/casper"
"github.com/make-software/casper-go-sdk/v2/types/clvalue"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions casper/key.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package casper

import (
"github.com/make-software/casper-go-sdk/types/key"
"github.com/make-software/casper-go-sdk/types/keypair"
"github.com/make-software/casper-go-sdk/v2/types/key"
"github.com/make-software/casper-go-sdk/v2/types/keypair"
)

type (
Expand Down
2 changes: 1 addition & 1 deletion casper/rpc.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package casper

import (
"github.com/make-software/casper-go-sdk/rpc"
"github.com/make-software/casper-go-sdk/v2/rpc"
)

type (
Expand Down
70 changes: 39 additions & 31 deletions casper/types.go
Original file line number Diff line number Diff line change
@@ -1,40 +1,48 @@
package casper

import (
"github.com/make-software/casper-go-sdk/types"
"github.com/make-software/casper-go-sdk/types/clvalue"
"github.com/make-software/casper-go-sdk/types/clvalue/cltype"
"github.com/make-software/casper-go-sdk/v2/types"
"github.com/make-software/casper-go-sdk/v2/types/clvalue"
"github.com/make-software/casper-go-sdk/v2/types/clvalue/cltype"
)

type (
AuctionState = types.AuctionState
Args = types.Args
ValidatorBid = types.ValidatorBid
Bid = types.Bid
BlockV1 = types.BlockV1
BlockHeaderV1 = types.BlockHeaderV1
BlockBodyV1 = types.BlockBodyV1
BlockV2 = types.BlockV2
BlockHeaderV2 = types.BlockHeaderV2
BlockBodyV2 = types.BlockBodyV2
ContractPackage = types.ContractPackage
ContractVersion = types.ContractVersion
Contract = types.Contract
Deploy = types.Deploy
DeployHeader = types.DeployHeader
DeployApproval = types.Approval
EntryPointV1 = types.EntryPointV1
EntryPointV2 = types.EntryPointV2
ExecutionResult = types.ExecutionResult
NamedKeys = types.NamedKeys
NamedKey = types.NamedKey
TransformKey = types.TransformKey
Transform = types.Transform
Argument = types.Argument
Account = types.Account
Reward = types.EraReward
WriteTransfer = types.WriteTransfer
UnbondingPurse = types.UnbondingPurse
AuctionState = types.AuctionState
Args = types.Args
ValidatorBid = types.ValidatorBid
Bid = types.Bid
Block = types.Block
BlockV1 = types.BlockV1
BlockHeaderV1 = types.BlockHeaderV1
BlockBodyV1 = types.BlockBodyV1
BlockV2 = types.BlockV2
BlockHeaderV2 = types.BlockHeaderV2
BlockBodyV2 = types.BlockBodyV2
ContractPackage = types.ContractPackage
ContractVersion = types.ContractVersion
Contract = types.Contract
Transaction = types.Transaction
TransactionV1 = types.TransactionV1
TransactionHeader = types.TransactionHeader
TransactionV1Header = types.TransactionV1Header
TransactionBody = types.TransactionBody
TransactionV1Body = types.TransactionV1Body
Deploy = types.Deploy
DeployHeader = types.DeployHeader
DeployApproval = types.Approval
EntryPointV1 = types.EntryPointV1
EntryPointV2 = types.EntryPointV2
ExecutionResult = types.ExecutionResult
NamedKeys = types.NamedKeys
NamedKey = types.NamedKey
TransformKey = types.TransformKey
Transform = types.Transform
TransformV2 = types.TransformV2
Argument = types.Argument
Account = types.Account
Reward = types.EraReward
WriteTransfer = types.WriteTransfer
UnbondingPurse = types.UnbondingPurse
)

type (
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/make-software/casper-go-sdk
module github.com/make-software/casper-go-sdk/v2

go 1.21

Expand Down
4 changes: 2 additions & 2 deletions rpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ package rpc
import (
"context"

"github.com/make-software/casper-go-sdk/types"
"github.com/make-software/casper-go-sdk/types/keypair"
"github.com/make-software/casper-go-sdk/v2/types"
"github.com/make-software/casper-go-sdk/v2/types/keypair"
)

// ClientPOS contains methods pertain to the Proof-of-Stake functionality of a Casper network.
Expand Down
8 changes: 4 additions & 4 deletions rpc/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"context"
"strconv"

"github.com/make-software/casper-go-sdk/types"
"github.com/make-software/casper-go-sdk/types/key"
"github.com/make-software/casper-go-sdk/types/keypair"
"github.com/make-software/casper-go-sdk/v2/types"
"github.com/make-software/casper-go-sdk/v2/types/key"
"github.com/make-software/casper-go-sdk/v2/types/keypair"
)

var ApiVersion = "2.0"
Expand All @@ -16,7 +16,7 @@ type CtxRequestID string
const RequestIDKey CtxRequestID = "RequestID"

func WithRequestId(ctx context.Context, requestID int) context.Context {
return context.WithValue(ctx, RequestIDKey, strconv.Itoa(requestID))
return context.WithValue(ctx, RequestIDKey, requestID)
}

func GetReqIdCtx(ctx context.Context) string {
Expand Down
8 changes: 4 additions & 4 deletions rpc/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"errors"
"strings"

"github.com/make-software/casper-go-sdk/types"
"github.com/make-software/casper-go-sdk/types/clvalue"
"github.com/make-software/casper-go-sdk/types/key"
"github.com/make-software/casper-go-sdk/types/keypair"
"github.com/make-software/casper-go-sdk/v2/types"
"github.com/make-software/casper-go-sdk/v2/types/clvalue"
"github.com/make-software/casper-go-sdk/v2/types/key"
"github.com/make-software/casper-go-sdk/v2/types/keypair"
)

// RpcResponse is a wrapper struct for an RPC Response. For a successful response the Result property
Expand Down
6 changes: 3 additions & 3 deletions rpc/rpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"errors"
"fmt"

"github.com/make-software/casper-go-sdk/types"
"github.com/make-software/casper-go-sdk/types/key"
"github.com/make-software/casper-go-sdk/types/keypair"
"github.com/make-software/casper-go-sdk/v2/types"
"github.com/make-software/casper-go-sdk/v2/types/key"
"github.com/make-software/casper-go-sdk/v2/types/keypair"
)

var ErrResultUnmarshal = errors.New("failed to unmarshal rpc result")
Expand Down
2 changes: 1 addition & 1 deletion rpc/speculative_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"encoding/json"
"fmt"

"github.com/make-software/casper-go-sdk/types"
"github.com/make-software/casper-go-sdk/v2/types"
)

type SpeculativeClient struct {
Expand Down
6 changes: 3 additions & 3 deletions sse/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"errors"
"time"

"github.com/make-software/casper-go-sdk/types"
"github.com/make-software/casper-go-sdk/types/key"
"github.com/make-software/casper-go-sdk/types/keypair"
"github.com/make-software/casper-go-sdk/v2/types"
"github.com/make-software/casper-go-sdk/v2/types/key"
"github.com/make-software/casper-go-sdk/v2/types/keypair"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion tests/helper/client_logger_decorator.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"encoding/json"
"log"

"github.com/make-software/casper-go-sdk/rpc"
"github.com/make-software/casper-go-sdk/v2/rpc"
)

type clientLoggerDecorator struct {
Expand Down
2 changes: 1 addition & 1 deletion tests/helper/client_retries_decorator.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"net/http"
"time"

"github.com/make-software/casper-go-sdk/rpc"
"github.com/make-software/casper-go-sdk/v2/rpc"
)

type clientRetriesDecorator struct {
Expand Down
2 changes: 1 addition & 1 deletion tests/helper/rpc_clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"testing"
"time"

"github.com/make-software/casper-go-sdk/rpc"
"github.com/make-software/casper-go-sdk/v2/rpc"
)

var delayedTestNetHandlerState rpc.Handler
Expand Down
2 changes: 1 addition & 1 deletion tests/key/account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/stretchr/testify/assert"

"github.com/make-software/casper-go-sdk/casper"
"github.com/make-software/casper-go-sdk/v2/casper"
)

func Test_Account_Constructor(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion tests/key/contract_package_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/stretchr/testify/assert"

"github.com/make-software/casper-go-sdk/casper"
"github.com/make-software/casper-go-sdk/v2/casper"
)

func Test_ContractPackage_Constructor(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion tests/key/contract_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/stretchr/testify/assert"

"github.com/make-software/casper-go-sdk/casper"
"github.com/make-software/casper-go-sdk/v2/casper"
)

func Test_Contract_Constructor(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion tests/key/key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/stretchr/testify/assert"

"github.com/make-software/casper-go-sdk/casper"
"github.com/make-software/casper-go-sdk/v2/casper"
)

func Test_Key_Constructor_fromString(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion tests/key/transfer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/stretchr/testify/assert"

"github.com/make-software/casper-go-sdk/casper"
"github.com/make-software/casper-go-sdk/v2/casper"
)

func Test_Transfer_Constructor(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions tests/rpc/client_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/make-software/casper-go-sdk/casper"
"github.com/make-software/casper-go-sdk/rpc"
"github.com/make-software/casper-go-sdk/tests/helper"
"github.com/make-software/casper-go-sdk/types"
"github.com/make-software/casper-go-sdk/v2/casper"
"github.com/make-software/casper-go-sdk/v2/rpc"
"github.com/make-software/casper-go-sdk/v2/tests/helper"
"github.com/make-software/casper-go-sdk/v2/types"
)

func Test_ConfigurableClient_GetDeploy(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions tests/rpc/integration/put_deploy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/make-software/casper-go-sdk/casper"
"github.com/make-software/casper-go-sdk/rpc"
"github.com/make-software/casper-go-sdk/types"
"github.com/make-software/casper-go-sdk/types/clvalue"
"github.com/make-software/casper-go-sdk/v2/casper"
"github.com/make-software/casper-go-sdk/v2/rpc"
"github.com/make-software/casper-go-sdk/v2/types"
"github.com/make-software/casper-go-sdk/v2/types/clvalue"
)

func Test_PutDeploy(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions tests/rpc/integration/put_transaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/make-software/casper-go-sdk/casper"
"github.com/make-software/casper-go-sdk/rpc"
"github.com/make-software/casper-go-sdk/types"
"github.com/make-software/casper-go-sdk/types/clvalue"
"github.com/make-software/casper-go-sdk/v2/casper"
"github.com/make-software/casper-go-sdk/v2/rpc"
"github.com/make-software/casper-go-sdk/v2/types"
"github.com/make-software/casper-go-sdk/v2/types/clvalue"
)

func Test_PutTransaction(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions tests/rpc/integration/rpc_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/make-software/casper-go-sdk/casper"
"github.com/make-software/casper-go-sdk/rpc"
"github.com/make-software/casper-go-sdk/types/key"
"github.com/make-software/casper-go-sdk/v2/casper"
"github.com/make-software/casper-go-sdk/v2/rpc"
"github.com/make-software/casper-go-sdk/v2/types/key"
)

func GetRpcClient() rpc.Client {
Expand Down
2 changes: 1 addition & 1 deletion tests/rpc/rep_request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/make-software/casper-go-sdk/rpc"
"github.com/make-software/casper-go-sdk/v2/rpc"
)

func Test_UnmarshalRpcRequest_withIDAsStringVal(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions tests/rpc/rpc_client_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/make-software/casper-go-sdk/casper"
"github.com/make-software/casper-go-sdk/rpc"
"github.com/make-software/casper-go-sdk/v2/casper"
"github.com/make-software/casper-go-sdk/v2/rpc"
)

func Test_QueryBalance_byPublicKey(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions tests/rpc/rpc_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/make-software/casper-go-sdk/casper"
"github.com/make-software/casper-go-sdk/rpc"
"github.com/make-software/casper-go-sdk/types"
"github.com/make-software/casper-go-sdk/v2/casper"
"github.com/make-software/casper-go-sdk/v2/rpc"
"github.com/make-software/casper-go-sdk/v2/types"
)

func SetupServer(t *testing.T, filePath string) *httptest.Server {
Expand Down
2 changes: 1 addition & 1 deletion tests/sse/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/make-software/casper-go-sdk/sse"
"github.com/make-software/casper-go-sdk/v2/sse"
)

func Test_HttpConnection_request(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion tests/sse/events_parsing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/make-software/casper-go-sdk/sse"
"github.com/make-software/casper-go-sdk/v2/sse"
)

func Test_RawEvent_ParseAsDeployAcceptedEvent(t *testing.T) {
Expand Down
Loading

0 comments on commit 477d7e0

Please sign in to comment.