Skip to content

Commit

Permalink
V2 module (#623)
Browse files Browse the repository at this point in the history
* update import path to v2

* update import path in source
  • Loading branch information
libotony authored Dec 20, 2023
1 parent 2fdb17f commit 417b722
Show file tree
Hide file tree
Showing 212 changed files with 729 additions and 729 deletions.
2 changes: 1 addition & 1 deletion abi/abi.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"errors"

ethabi "github.com/ethereum/go-ethereum/accounts/abi"
"github.com/vechain/thor/thor"
"github.com/vechain/thor/v2/thor"
)

// ABI holds information about methods and events of contract.
Expand Down
6 changes: 3 additions & 3 deletions abi/abi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (

"github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/assert"
"github.com/vechain/thor/abi"
"github.com/vechain/thor/builtin/gen"
"github.com/vechain/thor/thor"
"github.com/vechain/thor/v2/abi"
"github.com/vechain/thor/v2/builtin/gen"
"github.com/vechain/thor/v2/thor"
)

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

import (
ethabi "github.com/ethereum/go-ethereum/accounts/abi"
"github.com/vechain/thor/thor"
"github.com/vechain/thor/v2/thor"
)

// Event see abi.Event in go-ethereum.
Expand Down
14 changes: 7 additions & 7 deletions api/accounts/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ import (
"github.com/ethereum/go-ethereum/common/math"
"github.com/gorilla/mux"
"github.com/pkg/errors"
"github.com/vechain/thor/api/utils"
"github.com/vechain/thor/chain"
"github.com/vechain/thor/runtime"
"github.com/vechain/thor/state"
"github.com/vechain/thor/thor"
"github.com/vechain/thor/tx"
"github.com/vechain/thor/xenv"
"github.com/vechain/thor/v2/api/utils"
"github.com/vechain/thor/v2/chain"
"github.com/vechain/thor/v2/runtime"
"github.com/vechain/thor/v2/state"
"github.com/vechain/thor/v2/thor"
"github.com/vechain/thor/v2/tx"
"github.com/vechain/thor/v2/xenv"
)

type Accounts struct {
Expand Down
18 changes: 9 additions & 9 deletions api/accounts/accounts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ import (
"github.com/ethereum/go-ethereum/crypto"
"github.com/gorilla/mux"
"github.com/stretchr/testify/assert"
ABI "github.com/vechain/thor/abi"
"github.com/vechain/thor/api/accounts"
"github.com/vechain/thor/chain"
"github.com/vechain/thor/genesis"
"github.com/vechain/thor/muxdb"
"github.com/vechain/thor/packer"
"github.com/vechain/thor/state"
"github.com/vechain/thor/thor"
"github.com/vechain/thor/tx"
ABI "github.com/vechain/thor/v2/abi"
"github.com/vechain/thor/v2/api/accounts"
"github.com/vechain/thor/v2/chain"
"github.com/vechain/thor/v2/genesis"
"github.com/vechain/thor/v2/muxdb"
"github.com/vechain/thor/v2/packer"
"github.com/vechain/thor/v2/state"
"github.com/vechain/thor/v2/thor"
"github.com/vechain/thor/v2/tx"
)

var sol = ` pragma solidity ^0.4.18;
Expand Down
14 changes: 7 additions & 7 deletions api/accounts/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ package accounts
import (
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/common/math"
"github.com/vechain/thor/api/transactions"
"github.com/vechain/thor/runtime"
"github.com/vechain/thor/thor"
"github.com/vechain/thor/v2/api/transactions"
"github.com/vechain/thor/v2/runtime"
"github.com/vechain/thor/v2/thor"
)

//Account for marshal account
// Account for marshal account
type Account struct {
Balance math.HexOrDecimal256 `json:"balance"`
Energy math.HexOrDecimal256 `json:"energy"`
HasCode bool `json:"hasCode"`
}

//CallData represents contract-call body
// CallData represents contract-call body
type CallData struct {
Value *math.HexOrDecimal256 `json:"value"`
Data string `json:"data"`
Expand Down Expand Up @@ -89,10 +89,10 @@ type Clause struct {
Data string `json:"data"`
}

//Clauses array of clauses.
// Clauses array of clauses.
type Clauses []Clause

//BatchCallData executes a batch of codes
// BatchCallData executes a batch of codes
type BatchCallData struct {
Clauses Clauses `json:"clauses"`
Gas uint64 `json:"gas"`
Expand Down
28 changes: 14 additions & 14 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ import (

"github.com/gorilla/handlers"
"github.com/gorilla/mux"
"github.com/vechain/thor/api/accounts"
"github.com/vechain/thor/api/blocks"
"github.com/vechain/thor/api/debug"
"github.com/vechain/thor/api/doc"
"github.com/vechain/thor/api/events"
"github.com/vechain/thor/api/node"
"github.com/vechain/thor/api/subscriptions"
"github.com/vechain/thor/api/transactions"
"github.com/vechain/thor/api/transfers"
"github.com/vechain/thor/chain"
"github.com/vechain/thor/logdb"
"github.com/vechain/thor/state"
"github.com/vechain/thor/thor"
"github.com/vechain/thor/txpool"
"github.com/vechain/thor/v2/api/accounts"
"github.com/vechain/thor/v2/api/blocks"
"github.com/vechain/thor/v2/api/debug"
"github.com/vechain/thor/v2/api/doc"
"github.com/vechain/thor/v2/api/events"
"github.com/vechain/thor/v2/api/node"
"github.com/vechain/thor/v2/api/subscriptions"
"github.com/vechain/thor/v2/api/transactions"
"github.com/vechain/thor/v2/api/transfers"
"github.com/vechain/thor/v2/chain"
"github.com/vechain/thor/v2/logdb"
"github.com/vechain/thor/v2/state"
"github.com/vechain/thor/v2/thor"
"github.com/vechain/thor/v2/txpool"
)

// New return api router
Expand Down
8 changes: 4 additions & 4 deletions api/blocks/blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import (
"github.com/ethereum/go-ethereum/common/math"
"github.com/gorilla/mux"
"github.com/pkg/errors"
"github.com/vechain/thor/api/utils"
"github.com/vechain/thor/block"
"github.com/vechain/thor/chain"
"github.com/vechain/thor/thor"
"github.com/vechain/thor/v2/api/utils"
"github.com/vechain/thor/v2/block"
"github.com/vechain/thor/v2/chain"
"github.com/vechain/thor/v2/thor"
)

type Blocks struct {
Expand Down
18 changes: 9 additions & 9 deletions api/blocks/blocks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ import (
"github.com/ethereum/go-ethereum/crypto"
"github.com/gorilla/mux"
"github.com/stretchr/testify/assert"
"github.com/vechain/thor/block"
"github.com/vechain/thor/chain"
"github.com/vechain/thor/cmd/thor/solo"
"github.com/vechain/thor/genesis"
"github.com/vechain/thor/muxdb"
"github.com/vechain/thor/packer"
"github.com/vechain/thor/state"
"github.com/vechain/thor/thor"
"github.com/vechain/thor/tx"
"github.com/vechain/thor/v2/block"
"github.com/vechain/thor/v2/chain"
"github.com/vechain/thor/v2/cmd/thor/solo"
"github.com/vechain/thor/v2/genesis"
"github.com/vechain/thor/v2/muxdb"
"github.com/vechain/thor/v2/packer"
"github.com/vechain/thor/v2/state"
"github.com/vechain/thor/v2/thor"
"github.com/vechain/thor/v2/tx"
)

const (
Expand Down
6 changes: 3 additions & 3 deletions api/blocks/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ package blocks
import (
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/common/math"
"github.com/vechain/thor/chain"
"github.com/vechain/thor/thor"
"github.com/vechain/thor/tx"
"github.com/vechain/thor/v2/chain"
"github.com/vechain/thor/v2/thor"
"github.com/vechain/thor/v2/tx"
)

type BFTEngine interface {
Expand Down
28 changes: 14 additions & 14 deletions api/debug/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ import (
"github.com/ethereum/go-ethereum/rlp"
"github.com/gorilla/mux"
"github.com/pkg/errors"
"github.com/vechain/thor/api/utils"
"github.com/vechain/thor/chain"
"github.com/vechain/thor/consensus"
"github.com/vechain/thor/genesis"
"github.com/vechain/thor/muxdb"
"github.com/vechain/thor/runtime"
"github.com/vechain/thor/state"
"github.com/vechain/thor/thor"
"github.com/vechain/thor/tracers"
"github.com/vechain/thor/tracers/logger"
"github.com/vechain/thor/trie"
"github.com/vechain/thor/tx"
"github.com/vechain/thor/vm"
"github.com/vechain/thor/xenv"
"github.com/vechain/thor/v2/api/utils"
"github.com/vechain/thor/v2/chain"
"github.com/vechain/thor/v2/consensus"
"github.com/vechain/thor/v2/genesis"
"github.com/vechain/thor/v2/muxdb"
"github.com/vechain/thor/v2/runtime"
"github.com/vechain/thor/v2/state"
"github.com/vechain/thor/v2/thor"
"github.com/vechain/thor/v2/tracers"
"github.com/vechain/thor/v2/tracers/logger"
"github.com/vechain/thor/v2/trie"
"github.com/vechain/thor/v2/tx"
"github.com/vechain/thor/v2/vm"
"github.com/vechain/thor/v2/xenv"
)

var devNetGenesisID = genesis.NewDevnet().ID()
Expand Down
2 changes: 1 addition & 1 deletion api/debug/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"

"github.com/ethereum/go-ethereum/common/math"
"github.com/vechain/thor/thor"
"github.com/vechain/thor/v2/thor"
)

type TraceClauseOption struct {
Expand Down
8 changes: 4 additions & 4 deletions api/events/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (

"github.com/gorilla/mux"
"github.com/pkg/errors"
"github.com/vechain/thor/api/utils"
"github.com/vechain/thor/chain"
"github.com/vechain/thor/logdb"
"github.com/vechain/thor/v2/api/utils"
"github.com/vechain/thor/v2/chain"
"github.com/vechain/thor/v2/logdb"
)

type Events struct {
Expand All @@ -28,7 +28,7 @@ func New(repo *chain.Repository, db *logdb.LogDB) *Events {
}
}

//Filter query events with option
// Filter query events with option
func (e *Events) filter(ctx context.Context, ef *EventFilter) ([]*FilteredEvent, error) {
chain := e.repo.NewBestChain()
filter, err := convertEventFilter(chain, ef)
Expand Down
10 changes: 5 additions & 5 deletions api/events/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"math"

"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/vechain/thor/block"
"github.com/vechain/thor/chain"
"github.com/vechain/thor/logdb"
"github.com/vechain/thor/thor"
"github.com/vechain/thor/v2/block"
"github.com/vechain/thor/v2/chain"
"github.com/vechain/thor/v2/logdb"
"github.com/vechain/thor/v2/thor"
)

type LogMeta struct {
Expand Down Expand Up @@ -41,7 +41,7 @@ type FilteredEvent struct {
Meta LogMeta `json:"meta"`
}

//convert a logdb.Event into a json format Event
// convert a logdb.Event into a json format Event
func convertEvent(event *logdb.Event) *FilteredEvent {
fe := FilteredEvent{
Address: event.Address,
Expand Down
2 changes: 1 addition & 1 deletion api/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"net/http"

"github.com/gorilla/mux"
"github.com/vechain/thor/api/utils"
"github.com/vechain/thor/v2/api/utils"
)

type Node struct {
Expand Down
14 changes: 7 additions & 7 deletions api/node/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ import (

"github.com/gorilla/mux"
"github.com/stretchr/testify/assert"
"github.com/vechain/thor/api/node"
"github.com/vechain/thor/chain"
"github.com/vechain/thor/comm"
"github.com/vechain/thor/genesis"
"github.com/vechain/thor/muxdb"
"github.com/vechain/thor/state"
"github.com/vechain/thor/txpool"
"github.com/vechain/thor/v2/api/node"
"github.com/vechain/thor/v2/chain"
"github.com/vechain/thor/v2/comm"
"github.com/vechain/thor/v2/genesis"
"github.com/vechain/thor/v2/muxdb"
"github.com/vechain/thor/v2/state"
"github.com/vechain/thor/v2/txpool"
)

var ts *httptest.Server
Expand Down
4 changes: 2 additions & 2 deletions api/node/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
package node

import (
"github.com/vechain/thor/comm"
"github.com/vechain/thor/thor"
"github.com/vechain/thor/v2/comm"
"github.com/vechain/thor/v2/thor"
)

type Network interface {
Expand Down
6 changes: 3 additions & 3 deletions api/subscriptions/beat2_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"bytes"

"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/vechain/thor/chain"
"github.com/vechain/thor/thor"
"github.com/vechain/thor/thor/bloom"
"github.com/vechain/thor/v2/chain"
"github.com/vechain/thor/v2/thor"
"github.com/vechain/thor/v2/thor/bloom"
)

type beat2Reader struct {
Expand Down
6 changes: 3 additions & 3 deletions api/subscriptions/beat_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"bytes"

"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/vechain/thor/chain"
"github.com/vechain/thor/thor"
"github.com/vechain/thor/thor/bloom"
"github.com/vechain/thor/v2/chain"
"github.com/vechain/thor/v2/thor"
"github.com/vechain/thor/v2/thor/bloom"
)

type beatReader struct {
Expand Down
4 changes: 2 additions & 2 deletions api/subscriptions/block_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
package subscriptions

import (
"github.com/vechain/thor/chain"
"github.com/vechain/thor/thor"
"github.com/vechain/thor/v2/chain"
"github.com/vechain/thor/v2/thor"
)

type blockReader struct {
Expand Down
4 changes: 2 additions & 2 deletions api/subscriptions/event_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
package subscriptions

import (
"github.com/vechain/thor/chain"
"github.com/vechain/thor/thor"
"github.com/vechain/thor/v2/chain"
"github.com/vechain/thor/v2/thor"
)

type eventReader struct {
Expand Down
6 changes: 3 additions & 3 deletions api/subscriptions/pending_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"time"

"github.com/hashicorp/golang-lru/simplelru"
"github.com/vechain/thor/thor"
"github.com/vechain/thor/tx"
"github.com/vechain/thor/txpool"
"github.com/vechain/thor/v2/thor"
"github.com/vechain/thor/v2/tx"
"github.com/vechain/thor/v2/txpool"
)

type pendingTx struct {
Expand Down
Loading

0 comments on commit 417b722

Please sign in to comment.