diff --git a/circle.yml b/circle.yml index 5b49adeb8644948cda7199d0e7befb6012480a32..fe6d25aeb740b6f2d3ac74f124f116e042cfbadc 100644 --- a/circle.yml +++ b/circle.yml @@ -2,8 +2,8 @@ machine: environment: GOPATH: /home/ubuntu/.go_workspace REPO: ${GOPATH}/src/github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} - INTEGRATION_TESTS_BRANCH: develop - INTEGRATION_TESTS_PATH: $HOME/integration-tests + #INTEGRATION_TESTS_BRANCH: develop + #INTEGRATION_TESTS_PATH: $HOME/integration-tests DOCKER_VERSION: 1.8.2 DOCKER_MACHINE_VERSION: 0.5.4 post: @@ -19,7 +19,7 @@ dependencies: - sudo service docker start - "sudo apt-get update && sudo apt-get install -y libgmp3-dev" - sudo curl -sSL -o /usr/bin/docker-machine https://github.com/docker/machine/releases/download/v${DOCKER_MACHINE_VERSION}/docker-machine_linux-amd64; sudo chmod 0755 /usr/bin/docker-machine - - git clone https://github.com/eris-ltd/integration-tests $INTEGRATION_TESTS_PATH + # - git clone https://github.com/eris-ltd/integration-tests $INTEGRATION_TESTS_PATH - "cd ./cmd/erisdb && go get -d && go build" - "mv ~/eris-db/cmd/erisdb/erisdb ~/bin" - chmod +x ~/bin/erisdb @@ -27,7 +27,7 @@ dependencies: test: override: - go test -v ./... - - bash $INTEGRATION_TESTS_PATH/test.sh + #- bash $INTEGRATION_TESTS_PATH/test.sh deployment: master: diff --git a/erisdb/codec.go b/erisdb/codec.go index 04055df146a93af48b05a10abe4e1e71f5814979..f72bcd3ad97a6aa491b7f6f5928f33b1087af4b4 100644 --- a/erisdb/codec.go +++ b/erisdb/codec.go @@ -1,10 +1,11 @@ package erisdb import ( - "github.com/eris-ltd/eris-db/Godeps/_workspace/src/github.com/tendermint/tendermint/wire" - rpc "github.com/eris-ltd/eris-db/rpc" "io" "io/ioutil" + + "github.com/eris-ltd/eris-db/Godeps/_workspace/src/github.com/tendermint/tendermint/wire" + rpc "github.com/eris-ltd/eris-db/rpc" ) // Codec that uses tendermints 'binary' package for JSON. diff --git a/erisdb/methods.go b/erisdb/methods.go index 0b0a370eee5fdb224a8d6f52a686caef700c5ff4..2adfc77874fd538f6fca39c2bab4f16f027dc972 100644 --- a/erisdb/methods.go +++ b/erisdb/methods.go @@ -3,10 +3,13 @@ package erisdb import ( "crypto/rand" "encoding/hex" - "github.com/eris-ltd/eris-db/Godeps/_workspace/src/github.com/tendermint/tendermint/types" + "strings" + ep "github.com/eris-ltd/eris-db/erisdb/pipe" rpc "github.com/eris-ltd/eris-db/rpc" - "strings" + + "github.com/eris-ltd/eris-db/Godeps/_workspace/src/github.com/tendermint/tendermint/types" + "github.com/eris-ltd/eris-db/Godeps/_workspace/src/github.com/tendermint/tendermint/wire" ) // TODO use the method name definition file. @@ -381,12 +384,14 @@ func (this *ErisDbMethods) CallCode(request *rpc.RPCRequest, requester interface } func (this *ErisDbMethods) BroadcastTx(request *rpc.RPCRequest, requester interface{}) (interface{}, int, error) { - param := &types.CallTx{} - err := this.codec.DecodeBytes(param, request.Params) + var err error + // Special because Tx is an interface + param := new(types.Tx) + wire.ReadJSONPtr(param, request.Params, &err) if err != nil { return nil, rpc.INVALID_PARAMS, err } - receipt, errC := this.pipe.Transactor().BroadcastTx(param) + receipt, errC := this.pipe.Transactor().BroadcastTx(*param) if errC != nil { return nil, rpc.INTERNAL_ERROR, errC } diff --git a/erisdb/restServer.go b/erisdb/restServer.go index 5585d572559fc2e1c8caebad3889167939df25c7..cf428321456eb9184ca7cfb6e021f0cd25fe65cd 100644 --- a/erisdb/restServer.go +++ b/erisdb/restServer.go @@ -3,14 +3,18 @@ package erisdb import ( "encoding/hex" "fmt" - "github.com/eris-ltd/eris-db/Godeps/_workspace/src/github.com/gin-gonic/gin" - "github.com/eris-ltd/eris-db/Godeps/_workspace/src/github.com/tendermint/tendermint/types" + "io/ioutil" + "strconv" + "strings" + ep "github.com/eris-ltd/eris-db/erisdb/pipe" rpc "github.com/eris-ltd/eris-db/rpc" "github.com/eris-ltd/eris-db/server" "github.com/eris-ltd/eris-db/util" - "strconv" - "strings" + + "github.com/eris-ltd/eris-db/Godeps/_workspace/src/github.com/gin-gonic/gin" + "github.com/eris-ltd/eris-db/Godeps/_workspace/src/github.com/tendermint/tendermint/types" + "github.com/eris-ltd/eris-db/Godeps/_workspace/src/github.com/tendermint/tendermint/wire" ) // Provides a REST-like web-api. Implements server.Server @@ -372,12 +376,15 @@ func (this *RestServer) handlePeer(c *gin.Context) { // ********************************* Transactions ********************************* func (this *RestServer) handleBroadcastTx(c *gin.Context) { - param := &types.CallTx{} - errD := this.codec.Decode(param, c.Request.Body) - if errD != nil { - c.AbortWithError(500, errD) + // Special because Tx is an interface + param := new(types.Tx) + b, err := ioutil.ReadAll(c.Request.Body) + defer c.Request.Body.Close() + wire.ReadJSONPtr(param, b, &err) + if err != nil { + c.AbortWithError(500, err) } - receipt, err := this.pipe.Transactor().BroadcastTx(param) + receipt, err := this.pipe.Transactor().BroadcastTx(*param) if err != nil { c.AbortWithError(500, err) } diff --git a/version/version.go b/version/version.go index ed42d7045d61d567772c6bc9febc7869a14a1509..e8308f53bd79ad1899057d9f190eb7fc0fd6210d 100644 --- a/version/version.go +++ b/version/version.go @@ -1,7 +1,3 @@ package version -import ( - -) - -const Version = "0.11.0" +const Version = "0.11.1"