Skip to content
Snippets Groups Projects
Commit 90bc8318 authored by Silas Davis's avatar Silas Davis Committed by GitHub
Browse files

Merge pull request #157 from benjaminbollen/issue152_disable_mock_web_api_tests

Issue152 disable mock web api tests
parents e8915ed1 f9e57ced
No related branches found
No related tags found
No related merge requests found
...@@ -29,8 +29,6 @@ import ( ...@@ -29,8 +29,6 @@ import (
version "github.com/eris-ltd/eris-db/version" version "github.com/eris-ltd/eris-db/version"
) )
const VERSION = version.VERSION
// Global Do struct // Global Do struct
var do *definitions.Do var do *definitions.Do
...@@ -44,7 +42,7 @@ your needs. ...@@ -44,7 +42,7 @@ your needs.
Made with <3 by Eris Industries. Made with <3 by Eris Industries.
Complete documentation is available at https://docs.erisindustries.com Complete documentation is available at https://docs.erisindustries.com
` + "\nVERSION:\n " + VERSION, ` + "\nVERSION:\n " + version.VERSION,
PersistentPreRun: func(cmd *cobra.Command, args []string) { PersistentPreRun: func(cmd *cobra.Command, args []string) {
log.SetLevel(log.WarnLevel) log.SetLevel(log.WarnLevel)
...@@ -94,12 +92,6 @@ func defaultDebug() bool { ...@@ -94,12 +92,6 @@ func defaultDebug() bool {
return setDefaultBool("ERIS_DB_DEBUG", false) return setDefaultBool("ERIS_DB_DEBUG", false)
} }
// defaultOutput is set to true unless the ERIS_DB_OUTPUT environment
// variable is set to a parsable boolean.
func defaultOutput() bool {
return setDefaultBool("ERIS_DB_OUTPUT", true)
}
// setDefaultBool returns the provided default value if the environment variab;e // setDefaultBool returns the provided default value if the environment variab;e
// is not set or not parsable as a bool. // is not set or not parsable as a bool.
func setDefaultBool(environmentVariable string, defaultValue bool) bool { func setDefaultBool(environmentVariable string, defaultValue bool) bool {
......
...@@ -17,46 +17,9 @@ ...@@ -17,46 +17,9 @@
package main package main
import ( import (
"github.com/eris-ltd/eris-db/cmd" commands "github.com/eris-ltd/eris-db/cmd"
) )
func main() { func main() {
commands.Execute() commands.Execute()
} }
// package main
//
// import (
// "fmt"
// edb "github.com/eris-ltd/eris-db/erisdb"
// "os"
// )
//
// // TODO the input stuff.
// func main() {
// args := os.Args[1:]
// var baseDir string
// var inProc bool
// if len(args) > 0 {
// baseDir = args[0]
// if len(args) > 1 {
// if args[1] == "inproc" {
// inProc = true
// }
// }
// } else {
// baseDir = os.Getenv("HOME") + "/.erisdb"
// }
//
// proc, errSt := edb.ServeErisDB(baseDir, inProc)
// if errSt != nil {
// panic(errSt.Error())
// }
// errSe := proc.Start()
// if errSe != nil {
// panic(errSe.Error())
// }
// // TODO For now.
// fmt.Println("DONTMINDME55891")
// <-proc.StopEventChannel()
// }
File moved
package mock package mock
import ( import (
account "github.com/eris-ltd/eris-db/account" "fmt"
core_types "github.com/eris-ltd/eris-db/core/types"
definitions "github.com/eris-ltd/eris-db/definitions" account "github.com/eris-ltd/eris-db/account"
event "github.com/eris-ltd/eris-db/event" core_types "github.com/eris-ltd/eris-db/core/types"
definitions "github.com/eris-ltd/eris-db/definitions"
event "github.com/eris-ltd/eris-db/event"
manager_types "github.com/eris-ltd/eris-db/manager/types" manager_types "github.com/eris-ltd/eris-db/manager/types"
td "github.com/eris-ltd/eris-db/test/testdata/testdata" td "github.com/eris-ltd/eris-db/test/testdata/testdata"
types "github.com/eris-ltd/eris-db/txs" types "github.com/eris-ltd/eris-db/txs"
...@@ -89,6 +92,10 @@ func (this *MockPipe) SetConsensusEngine(_ definitions.ConsensusEngine) error { ...@@ -89,6 +92,10 @@ func (this *MockPipe) SetConsensusEngine(_ definitions.ConsensusEngine) error {
return nil return nil
} }
func (this *MockPipe) GetTendermintPipe() (definitions.TendermintPipe, error) {
return nil, fmt.Errorf("Tendermint pipe is not supported by mocked pipe.")
}
// Components // Components
// Accounts // Accounts
......
package pipe
File moved
package testdata package testdata
import ( import (
wire "github.com/tendermint/go-wire"
account "github.com/eris-ltd/eris-db/account" account "github.com/eris-ltd/eris-db/account"
core_types "github.com/eris-ltd/eris-db/core/types" core_types "github.com/eris-ltd/eris-db/core/types"
...@@ -697,15 +696,10 @@ type ( ...@@ -697,15 +696,10 @@ type (
) )
func LoadTestData() *TestData { func LoadTestData() *TestData {
var err error codec := rpc_v0.NewTCodec()
//codec := core_types.NewTCodec() testData := &TestData{}
testData := TestData{} if err := codec.DecodeBytes(testData, []byte(testDataJson)); err != nil {
testDataI := wire.ReadJSON(testData, []byte(testDataJson), &err)
/*err := codec.DecodeBytes(testData, []byte(testDataJson))
*/
if err != nil {
panic(err) panic(err)
} }
testData = testDataI.(TestData) return testData
return &testData
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment