From 266068a53cdf9e06acacf982d63653c03133a634 Mon Sep 17 00:00:00 2001 From: jm Date: Tue, 15 Jan 2019 00:48:13 +0800 Subject: core: vm: refactor file structure For support other vm types, this pr modified the core/vm file structures. --- cmd/evm/runner.go | 4 ++-- cmd/evm/staterunner.go | 2 +- cmd/govtool/main.go | 8 ++++---- cmd/utils/flags.go | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'cmd') diff --git a/cmd/evm/runner.go b/cmd/evm/runner.go index 114b9fd60..48782b496 100644 --- a/cmd/evm/runner.go +++ b/cmd/evm/runner.go @@ -32,8 +32,8 @@ import ( "github.com/dexon-foundation/dexon/common" "github.com/dexon-foundation/dexon/core" "github.com/dexon-foundation/dexon/core/state" - "github.com/dexon-foundation/dexon/core/vm" - "github.com/dexon-foundation/dexon/core/vm/runtime" + vm "github.com/dexon-foundation/dexon/core/vm/evm" + "github.com/dexon-foundation/dexon/core/vm/evm/runtime" "github.com/dexon-foundation/dexon/ethdb" "github.com/dexon-foundation/dexon/log" "github.com/dexon-foundation/dexon/params" diff --git a/cmd/evm/staterunner.go b/cmd/evm/staterunner.go index b76dc3ca4..ee96a539c 100644 --- a/cmd/evm/staterunner.go +++ b/cmd/evm/staterunner.go @@ -24,7 +24,7 @@ import ( "os" "github.com/dexon-foundation/dexon/core/state" - "github.com/dexon-foundation/dexon/core/vm" + vm "github.com/dexon-foundation/dexon/core/vm/evm" "github.com/dexon-foundation/dexon/log" "github.com/dexon-foundation/dexon/tests" diff --git a/cmd/govtool/main.go b/cmd/govtool/main.go index 1425b9faf..3bd5897a2 100644 --- a/cmd/govtool/main.go +++ b/cmd/govtool/main.go @@ -9,7 +9,7 @@ import ( coreTypes "github.com/dexon-foundation/dexon-consensus/core/types" dkgTypes "github.com/dexon-foundation/dexon-consensus/core/types/dkg" "github.com/dexon-foundation/dexon/cmd/utils" - "github.com/dexon-foundation/dexon/core/vm" + "github.com/dexon-foundation/dexon/core/vm/evm" "github.com/dexon-foundation/dexon/rlp" "gopkg.in/urfave/cli.v1" ) @@ -42,7 +42,7 @@ func decodeInput(ctx *cli.Context) error { } // Parse input. - method, exists := vm.GovernanceABI.Sig2Method[string(input[:4])] + method, exists := evm.GovernanceABI.Sig2Method[string(input[:4])] if !exists { utils.Fatalf("invalid method") } @@ -110,7 +110,7 @@ func decodeInput(ctx *cli.Context) error { utils.Fatalf("%s", err) } switch args.Type.Uint64() { - case vm.FineTypeForkVote: + case evm.FineTypeForkVote: vote1 := new(coreTypes.Vote) if err := rlp.DecodeBytes(args.Arg1, vote1); err != nil { utils.Fatalf("%s", err) @@ -121,7 +121,7 @@ func decodeInput(ctx *cli.Context) error { } fmt.Printf("Vote1: %+v\n", vote1) fmt.Printf("Vote2: %+v\n", vote2) - case vm.FineTypeForkBlock: + case evm.FineTypeForkBlock: block1 := new(coreTypes.Block) if err := rlp.DecodeBytes(args.Arg1, block1); err != nil { utils.Fatalf("%s", err) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 6ac26d1fe..03540a33c 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -37,7 +37,7 @@ import ( "github.com/dexon-foundation/dexon/consensus/ethash" "github.com/dexon-foundation/dexon/core" "github.com/dexon-foundation/dexon/core/state" - "github.com/dexon-foundation/dexon/core/vm" + vm "github.com/dexon-foundation/dexon/core/vm/evm" "github.com/dexon-foundation/dexon/crypto" "github.com/dexon-foundation/dexon/dashboard" "github.com/dexon-foundation/dexon/dex" -- cgit v1.2.3