Browse Source

import tendermint/test to init ~/.tendermint_test/*

pull/69/head
Jae Kwon 10 years ago
parent
commit
b8c735bd59
8 changed files with 24 additions and 39 deletions
  1. +0
    -24
      rpc/test/.tendermint/genesis.json
  2. +2
    -1
      rpc/test/client_rpc_test.go
  3. +2
    -1
      rpc/test/client_ws_test.go
  4. +13
    -0
      rpc/test/config.go
  5. +4
    -10
      rpc/test/helpers_test.go
  6. +0
    -1
      rpc/test/ok.go
  7. +1
    -1
      rpc/test/tests_test.go
  8. +2
    -1
      rpc/test/ws_helpers_test.go

+ 0
- 24
rpc/test/.tendermint/genesis.json View File

@ -1,24 +0,0 @@
{
"accounts": [
{
"address": "1D7A91CB32F758A02EBB9BE1FB6F8DEE56F90D42",
"amount": 200000000
},
{
"address": "AC89A6DDF4C309A89A2C4078CE409A5A7B282270",
"amount": 200000000
}
],
"validators": [
{
"pub_key": [1, "06FBAC4E285285D1D91FCBC7E91C780ADA11516F67462340B3980CE2B94940E8"],
"amount": 1000000,
"unbond_to": [
{
"address": "1D7A91CB32F758A02EBB9BE1FB6F8DEE56F90D42",
"amount": 100000
}
]
}
]
}

+ 2
- 1
rpc/test/client_rpc_test.go View File

@ -1,6 +1,7 @@
package rpc
package rpctest
import (
_ "github.com/tendermint/tendermint/test"
"testing"
)


+ 2
- 1
rpc/test/client_ws_test.go View File

@ -1,4 +1,4 @@
package rpc
package rpctest
import (
"encoding/json"
@ -7,6 +7,7 @@ import (
"github.com/tendermint/tendermint/account"
"github.com/tendermint/tendermint/binary"
"github.com/tendermint/tendermint/rpc/types"
_ "github.com/tendermint/tendermint/test"
"github.com/tendermint/tendermint/types"
"net/http"
"testing"


+ 13
- 0
rpc/test/config.go View File

@ -0,0 +1,13 @@
package rpctest
import (
cfg "github.com/tendermint/tendermint/config"
)
var config cfg.Config = nil
func init() {
cfg.OnConfig(func(newConfig cfg.Config) {
config = newConfig
})
}

+ 4
- 10
rpc/test/helpers_test.go View File

@ -1,12 +1,10 @@
package rpc
package rpctest
import (
"bytes"
"encoding/hex"
"github.com/tendermint/tendermint/account"
. "github.com/tendermint/tendermint/common"
cfg "github.com/tendermint/tendermint/config"
tmcfg "github.com/tendermint/tendermint/config/tendermint_test"
"github.com/tendermint/tendermint/consensus"
nm "github.com/tendermint/tendermint/node"
"github.com/tendermint/tendermint/p2p"
@ -20,10 +18,9 @@ import (
// global variables for use across all tests
var (
config cfg.Config = nil
rpcAddr = "127.0.0.1:36657" // Not 46657
requestAddr = "http://" + rpcAddr + "/"
websocketAddr = "ws://" + rpcAddr + "/events"
rpcAddr = "127.0.0.1:36657" // Not 46657
requestAddr = "http://" + rpcAddr + "/"
websocketAddr = "ws://" + rpcAddr + "/events"
node *nm.Node
@ -77,9 +74,6 @@ func newNode(ready chan struct{}) {
// initialize config and create new node
func init() {
config = tmcfg.GetConfig("")
cfg.ApplyConfig(config)
// Save new priv_validator file.
priv := &state.PrivValidator{
Address: decodeHex(userAddr),


+ 0
- 1
rpc/test/ok.go View File

@ -1 +0,0 @@
package rpc

+ 1
- 1
rpc/test/tests_test.go View File

@ -1,4 +1,4 @@
package rpc
package rpctest
import (
"bytes"


+ 2
- 1
rpc/test/ws_helpers_test.go View File

@ -1,10 +1,11 @@
package rpc
package rpctest
import (
"bytes"
"fmt"
"github.com/gorilla/websocket"
"github.com/tendermint/tendermint/binary"
_ "github.com/tendermint/tendermint/test"
"github.com/tendermint/tendermint/types"
"testing"
)


Loading…
Cancel
Save