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