s/blackstar/basecoin/g
This commit is contained in:
parent
0417c71543
commit
cec82d8250
6
Makefile
6
Makefile
|
@ -3,10 +3,10 @@
|
||||||
all: test install
|
all: test install
|
||||||
|
|
||||||
install: get_deps
|
install: get_deps
|
||||||
go install github.com/tendermint/blackstar/cmd/...
|
go install github.com/tendermint/basecoin/cmd/...
|
||||||
|
|
||||||
test:
|
test:
|
||||||
go test github.com/tendermint/blackstar/...
|
go test github.com/tendermint/basecoin/...
|
||||||
|
|
||||||
get_deps:
|
get_deps:
|
||||||
go get -d github.com/tendermint/blackstar/...
|
go get -d github.com/tendermint/basecoin/...
|
||||||
|
|
22
app/app.go
22
app/app.go
|
@ -2,7 +2,7 @@ package app
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/tendermint/blackstar/types"
|
"github.com/tendermint/basecoin/types"
|
||||||
"github.com/tendermint/go-crypto"
|
"github.com/tendermint/go-crypto"
|
||||||
"github.com/tendermint/go-wire"
|
"github.com/tendermint/go-wire"
|
||||||
eyes "github.com/tendermint/merkleeyes/client"
|
eyes "github.com/tendermint/merkleeyes/client"
|
||||||
|
@ -12,23 +12,23 @@ import (
|
||||||
const version = "0.1"
|
const version = "0.1"
|
||||||
const maxTxSize = 10240
|
const maxTxSize = 10240
|
||||||
|
|
||||||
type Blackstar struct {
|
type Basecoin struct {
|
||||||
eyesCli *eyes.MerkleEyesClient
|
eyesCli *eyes.MerkleEyesClient
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewBlackstar(eyesCli *eyes.MerkleEyesClient) *Blackstar {
|
func NewBasecoin(eyesCli *eyes.MerkleEyesClient) *Basecoin {
|
||||||
return &Blackstar{
|
return &Basecoin{
|
||||||
eyesCli: eyesCli,
|
eyesCli: eyesCli,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TMSP::Info
|
// TMSP::Info
|
||||||
func (app *Blackstar) Info() string {
|
func (app *Basecoin) Info() string {
|
||||||
return "Blackstar v" + version
|
return "Basecoin v" + version
|
||||||
}
|
}
|
||||||
|
|
||||||
// TMSP::SetOption
|
// TMSP::SetOption
|
||||||
func (app *Blackstar) SetOption(key string, value string) (log string) {
|
func (app *Basecoin) SetOption(key string, value string) (log string) {
|
||||||
if key == "setAccount" {
|
if key == "setAccount" {
|
||||||
var err error
|
var err error
|
||||||
var setAccount types.PubAccount
|
var setAccount types.PubAccount
|
||||||
|
@ -48,7 +48,7 @@ func (app *Blackstar) SetOption(key string, value string) (log string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// TMSP::AppendTx
|
// TMSP::AppendTx
|
||||||
func (app *Blackstar) AppendTx(txBytes []byte) (code tmsp.CodeType, result []byte, log string) {
|
func (app *Basecoin) AppendTx(txBytes []byte) (code tmsp.CodeType, result []byte, log string) {
|
||||||
if len(txBytes) > maxTxSize {
|
if len(txBytes) > maxTxSize {
|
||||||
return tmsp.CodeType_EncodingError, nil, "Tx size exceeds maximum"
|
return tmsp.CodeType_EncodingError, nil, "Tx size exceeds maximum"
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ func (app *Blackstar) AppendTx(txBytes []byte) (code tmsp.CodeType, result []byt
|
||||||
}
|
}
|
||||||
|
|
||||||
// TMSP::CheckTx
|
// TMSP::CheckTx
|
||||||
func (app *Blackstar) CheckTx(txBytes []byte) (code tmsp.CodeType, result []byte, log string) {
|
func (app *Basecoin) CheckTx(txBytes []byte) (code tmsp.CodeType, result []byte, log string) {
|
||||||
if len(txBytes) > maxTxSize {
|
if len(txBytes) > maxTxSize {
|
||||||
return tmsp.CodeType_EncodingError, nil, "Tx size exceeds maximum"
|
return tmsp.CodeType_EncodingError, nil, "Tx size exceeds maximum"
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,7 @@ func (app *Blackstar) CheckTx(txBytes []byte) (code tmsp.CodeType, result []byte
|
||||||
}
|
}
|
||||||
|
|
||||||
// TMSP::Query
|
// TMSP::Query
|
||||||
func (app *Blackstar) Query(query []byte) (code tmsp.CodeType, result []byte, log string) {
|
func (app *Basecoin) Query(query []byte) (code tmsp.CodeType, result []byte, log string) {
|
||||||
return tmsp.CodeType_OK, nil, ""
|
return tmsp.CodeType_OK, nil, ""
|
||||||
value, err := app.eyesCli.GetSync(query)
|
value, err := app.eyesCli.GetSync(query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -112,7 +112,7 @@ func (app *Blackstar) Query(query []byte) (code tmsp.CodeType, result []byte, lo
|
||||||
}
|
}
|
||||||
|
|
||||||
// TMSP::Commit
|
// TMSP::Commit
|
||||||
func (app *Blackstar) Commit() (hash []byte, log string) {
|
func (app *Basecoin) Commit() (hash []byte, log string) {
|
||||||
hash, log, err := app.eyesCli.CommitSync()
|
hash, log, err := app.eyesCli.CommitSync()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic("Error getting hash: " + err.Error())
|
panic("Error getting hash: " + err.Error())
|
||||||
|
|
8
main.go
8
main.go
|
@ -3,8 +3,8 @@ package main
|
||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
|
|
||||||
"github.com/tendermint/blackstar/app"
|
"github.com/tendermint/basecoin/app"
|
||||||
"github.com/tendermint/blackstar/types"
|
"github.com/tendermint/basecoin/types"
|
||||||
. "github.com/tendermint/go-common"
|
. "github.com/tendermint/go-common"
|
||||||
"github.com/tendermint/go-wire"
|
"github.com/tendermint/go-wire"
|
||||||
eyes "github.com/tendermint/merkleeyes/client"
|
eyes "github.com/tendermint/merkleeyes/client"
|
||||||
|
@ -24,8 +24,8 @@ func main() {
|
||||||
Exit("connect to MerkleEyes: " + err.Error())
|
Exit("connect to MerkleEyes: " + err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create BlackStar app
|
// Create Basecoin app
|
||||||
app := app.NewBlackstar(eyesCli)
|
app := app.NewBasecoin(eyesCli)
|
||||||
|
|
||||||
// Load GenesisState
|
// Load GenesisState
|
||||||
jsonBytes, err := ReadFile(*genPtr)
|
jsonBytes, err := ReadFile(*genPtr)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package tests
|
package tests
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/tendermint/blackstar/types"
|
"github.com/tendermint/basecoin/types"
|
||||||
. "github.com/tendermint/go-common"
|
. "github.com/tendermint/go-common"
|
||||||
"github.com/tendermint/go-crypto"
|
"github.com/tendermint/go-crypto"
|
||||||
)
|
)
|
||||||
|
|
|
@ -5,8 +5,8 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gorilla/websocket"
|
"github.com/gorilla/websocket"
|
||||||
"github.com/tendermint/blackstar/tests"
|
"github.com/tendermint/basecoin/tests"
|
||||||
"github.com/tendermint/blackstar/types"
|
"github.com/tendermint/basecoin/types"
|
||||||
. "github.com/tendermint/go-common"
|
. "github.com/tendermint/go-common"
|
||||||
"github.com/tendermint/go-rpc/client"
|
"github.com/tendermint/go-rpc/client"
|
||||||
"github.com/tendermint/go-rpc/types"
|
"github.com/tendermint/go-rpc/types"
|
||||||
|
|
Loading…
Reference in New Issue