Include "// TMSP::XXX" comments

This commit is contained in:
Jae Kwon 2016-02-08 18:08:55 -08:00
parent 538f3110b1
commit f95f253916
1 changed files with 6 additions and 0 deletions

View File

@ -22,10 +22,12 @@ func NewBlackstar(eyesCli *eyes.MerkleEyesClient) *Blackstar {
}
}
// TMSP::Info
func (app *Blackstar) Info() string {
return "Blackstar v" + version
}
// TMSP::SetOption
func (app *Blackstar) SetOption(key string, value string) (log string) {
if key == "setAccount" {
var err error
@ -45,6 +47,7 @@ func (app *Blackstar) SetOption(key string, value string) (log string) {
return "Unrecognized option key " + key
}
// TMSP::AppendTx
func (app *Blackstar) AppendTx(txBytes []byte) (code tmsp.CodeType, result []byte, log string) {
if len(txBytes) > maxTxSize {
return tmsp.CodeType_EncodingError, nil, "Tx size exceeds maximum"
@ -72,6 +75,7 @@ func (app *Blackstar) AppendTx(txBytes []byte) (code tmsp.CodeType, result []byt
return tmsp.CodeType_OK, nil, "Success"
}
// TMSP::CheckTx
func (app *Blackstar) CheckTx(txBytes []byte) (code tmsp.CodeType, result []byte, log string) {
if len(txBytes) > maxTxSize {
return tmsp.CodeType_EncodingError, nil, "Tx size exceeds maximum"
@ -97,6 +101,7 @@ func (app *Blackstar) CheckTx(txBytes []byte) (code tmsp.CodeType, result []byte
return tmsp.CodeType_OK, nil, "Success"
}
// TMSP::Query
func (app *Blackstar) Query(query []byte) (code tmsp.CodeType, result []byte, log string) {
return tmsp.CodeType_OK, nil, ""
value, err := app.eyesCli.GetSync(query)
@ -106,6 +111,7 @@ func (app *Blackstar) Query(query []byte) (code tmsp.CodeType, result []byte, lo
return tmsp.CodeType_OK, value, "Success"
}
// TMSP::GetHash
func (app *Blackstar) GetHash() (hash []byte, log string) {
hash, log, err := app.eyesCli.GetHashSync()
if err != nil {