Skip to content

Commit

Permalink
go fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
zelig committed Jun 26, 2014
1 parent 648c418 commit ae5ace1
Show file tree
Hide file tree
Showing 8 changed files with 226 additions and 226 deletions.
14 changes: 7 additions & 7 deletions ethereal/flags.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package main

import (
"bitbucket.org/kardianos/osext"
"flag"
"fmt"
"github.com/ethereum/eth-go/ethlog"
"os"
"os/user"
"path"
"github.com/ethereum/eth-go/ethlog"
"flag"
"bitbucket.org/kardianos/osext"
"os/user"
"path"
"path/filepath"
"runtime"
)
Expand Down Expand Up @@ -60,8 +60,8 @@ func defaultAssetPath() string {
}

func defaultDataDir() string {
usr, _ := user.Current()
return path.Join(usr.HomeDir, ".ethereal")
usr, _ := user.Current()
return path.Join(usr.HomeDir, ".ethereal")
}

var defaultConfigFile = path.Join(defaultDataDir(), "conf.ini")
Expand Down
32 changes: 16 additions & 16 deletions ethereal/main.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package main

import (
"github.com/ethereum/eth-go/ethlog"
"github.com/ethereum/go-ethereum/ethereal/ui"
"github.com/ethereum/go-ethereum/utils"
"github.com/ethereum/eth-go/ethlog"
"github.com/go-qml/qml"
"runtime"
"os"
"runtime"
)

func main() {
Expand All @@ -32,11 +32,11 @@ func main() {
ethereum := utils.NewEthereum(UseUPnP, OutboundPort, MaxPeer)

// create, import, export keys
utils.KeyTasks(GenAddr, ImportKey, ExportKey, NonInteractive)
utils.KeyTasks(GenAddr, ImportKey, ExportKey, NonInteractive)

if ShowGenesis {
utils.ShowGenesis(ethereum)
}
if ShowGenesis {
utils.ShowGenesis(ethereum)
}

if StartRpc {
utils.StartRpc(ethereum, RpcPort)
Expand All @@ -45,17 +45,17 @@ func main() {
gui := ethui.New(ethereum, LogLevel)

utils.RegisterInterrupt(func(os.Signal) {
gui.Stop()
})
gui.Stop()
})
utils.StartEthereum(ethereum, UseSeed)
// gui blocks the main thread
gui.Start(AssetPath)
// we need to run the interrupt callbacks in case gui is closed
// this skips if we got here by actual interrupt stopping the GUI
// gui blocks the main thread
gui.Start(AssetPath)
// we need to run the interrupt callbacks in case gui is closed
// this skips if we got here by actual interrupt stopping the GUI
if !interrupted {
utils.RunInterruptCallbacks(os.Interrupt)
}
// this blocks the thread
ethereum.WaitForShutdown()
ethlog.Flush()
}
// this blocks the thread
ethereum.WaitForShutdown()
ethlog.Flush()
}
6 changes: 3 additions & 3 deletions ethereal/ui/gui.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"github.com/ethereum/eth-go"
"github.com/ethereum/eth-go/ethchain"
"github.com/ethereum/eth-go/ethdb"
"github.com/ethereum/eth-go/ethlog"
"github.com/ethereum/eth-go/ethpub"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/eth-go/ethlog"
"github.com/ethereum/go-ethereum/utils"
"github.com/go-qml/qml"
"math/big"
Expand All @@ -35,9 +35,9 @@ type Gui struct {

addr []byte

pub *ethpub.PEthereum
pub *ethpub.PEthereum
logLevel ethlog.LogLevel
open bool
open bool
}

// Create GUI, but doesn't start it
Expand Down
46 changes: 23 additions & 23 deletions ethereum/cmd.go
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
package main

import (
"github.com/ethereum/eth-go"
"github.com/ethereum/go-ethereum/utils"
"os"
"io/ioutil"
"github.com/ethereum/eth-go"
"github.com/ethereum/go-ethereum/utils"
"io/ioutil"
"os"
)

func InitJsConsole(ethereum *eth.Ethereum) {
repl := NewJSRepl(ethereum)
go repl.Start()
utils.RegisterInterrupt(func(os.Signal) {
repl.Stop()
})
repl := NewJSRepl(ethereum)
go repl.Start()
utils.RegisterInterrupt(func(os.Signal) {
repl.Stop()
})
}

func ExecJsFile (ethereum *eth.Ethereum, InputFile string) {
file, err := os.Open(InputFile)
if err != nil {
logger.Fatalln(err)
}
content, err := ioutil.ReadAll(file)
if err != nil {
logger.Fatalln(err)
}
re := NewJSRE(ethereum)
utils.RegisterInterrupt(func(os.Signal) {
re.Stop()
})
re.Run(string(content))
func ExecJsFile(ethereum *eth.Ethereum, InputFile string) {
file, err := os.Open(InputFile)
if err != nil {
logger.Fatalln(err)
}
content, err := ioutil.ReadAll(file)
if err != nil {
logger.Fatalln(err)
}
re := NewJSRE(ethereum)
utils.RegisterInterrupt(func(os.Signal) {
re.Stop()
})
re.Run(string(content))
}
10 changes: 5 additions & 5 deletions ethereum/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package main
import (
"flag"
"fmt"
"github.com/ethereum/eth-go/ethlog"
"os"
"os/user"
"path"
"github.com/ethereum/eth-go/ethlog"
"os/user"
"path"
)

var Identifier string
Expand Down Expand Up @@ -34,8 +34,8 @@ var StartJsConsole bool
var InputFile string

func defaultDataDir() string {
usr, _ := user.Current()
return path.Join(usr.HomeDir, ".ethereum")
usr, _ := user.Current()
return path.Join(usr.HomeDir, ".ethereum")
}

var defaultConfigFile = path.Join(defaultDataDir(), "conf.ini")
Expand Down
4 changes: 2 additions & 2 deletions ethereum/javascript_runtime.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package main
package main

import (
"fmt"
"github.com/ethereum/eth-go"
"github.com/ethereum/eth-go/ethchain"
"github.com/ethereum/eth-go/ethlog"
"github.com/ethereum/eth-go/ethpub"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/eth-go/ethlog"
"github.com/ethereum/go-ethereum/utils"
"github.com/obscuren/otto"
"io/ioutil"
Expand Down
14 changes: 7 additions & 7 deletions ethereum/main.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package main

import (
"github.com/ethereum/go-ethereum/utils"
"github.com/ethereum/eth-go/ethlog"
"github.com/ethereum/go-ethereum/utils"
"runtime"
)

Expand All @@ -24,11 +24,11 @@ func main() {
ethereum := utils.NewEthereum(UseUPnP, OutboundPort, MaxPeer)

// create, import, export keys
utils.KeyTasks(GenAddr, ImportKey, ExportKey, NonInteractive)
utils.KeyTasks(GenAddr, ImportKey, ExportKey, NonInteractive)

if ShowGenesis {
utils.ShowGenesis(ethereum)
}
if ShowGenesis {
utils.ShowGenesis(ethereum)
}

if StartMining {
utils.StartMining(ethereum)
Expand All @@ -48,6 +48,6 @@ func main() {
utils.StartEthereum(ethereum, UseSeed)

// this blocks the thread
ethereum.WaitForShutdown()
ethlog.Flush()
ethereum.WaitForShutdown()
ethlog.Flush()
}
Loading

0 comments on commit ae5ace1

Please sign in to comment.