s/GetHash/Commit/g

This commit is contained in:
Jae Kwon 2016-02-14 13:12:38 -08:00
parent f95f253916
commit 0417c71543
2 changed files with 11 additions and 6 deletions

View File

@ -111,9 +111,9 @@ func (app *Blackstar) Query(query []byte) (code tmsp.CodeType, result []byte, lo
return tmsp.CodeType_OK, value, "Success" return tmsp.CodeType_OK, value, "Success"
} }
// TMSP::GetHash // TMSP::Commit
func (app *Blackstar) GetHash() (hash []byte, log string) { func (app *Blackstar) Commit() (hash []byte, log string) {
hash, log, err := app.eyesCli.GetHashSync() hash, log, err := app.eyesCli.CommitSync()
if err != nil { if err != nil {
panic("Error getting hash: " + err.Error()) panic("Error getting hash: " + err.Error())
} }

View File

@ -2,6 +2,7 @@ package main
import ( import (
"fmt" "fmt"
"time"
"github.com/gorilla/websocket" "github.com/gorilla/websocket"
"github.com/tendermint/blackstar/tests" "github.com/tendermint/blackstar/tests"
@ -14,12 +15,13 @@ import (
) )
func main() { func main() {
ws := rpcclient.NewWSClient("ws://127.0.0.1:46657/websocket") //ws := rpcclient.NewWSClient("ws://127.0.0.1:46657/websocket")
// ws := rpcclient.NewWSClient("ws://104.236.69.128:46657/websocket") ws := rpcclient.NewWSClient("ws://104.131.151.26:46657/websocket")
_, err := ws.Start() _, err := ws.Start()
if err != nil { if err != nil {
Exit(err.Error()) Exit(err.Error())
} }
var counter = 0
// Read a bunch of responses // Read a bunch of responses
go func() { go func() {
@ -28,7 +30,7 @@ func main() {
if !ok { if !ok {
break break
} }
fmt.Println("res:", Blue(string(res))) fmt.Println(counter, "res:", Blue(string(res)))
} }
}() }()
@ -78,6 +80,9 @@ func main() {
// Now send coins between these accounts // Now send coins between these accounts
for { for {
counter += 1
time.Sleep(time.Millisecond * 10)
randA := RandInt() % len(privAccounts) randA := RandInt() % len(privAccounts)
randB := RandInt() % len(privAccounts) randB := RandInt() % len(privAccounts)
if randA == randB { if randA == randB {