Skip to content

Commit

Permalink
Fixed some print formatting. version file updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
blockcodemagic committed Jul 31, 2019
1 parent ea660e1 commit 0f6b81d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 18 deletions.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ gosdk-test:
install-gosdk: | gosdk-build gosdk-test

getrev:
$(eval VERSION_STR=$(MAJOR_VERSION).$(shell git rev-list --count HEAD))
$(eval VERSION_STR=$(VERSION_STR)-$(shell git describe --tags --dirty --always))
$(eval VERSION_STR=$(shell git describe --tags --dirty --always))
@echo "" > $(VERSION_FILE)
@echo "//====== THIS IS AUTOGENERATED FILE. DO NOT MODIFY ========" >> $(VERSION_FILE)
@echo "" >> $(VERSION_FILE)
Expand Down
4 changes: 3 additions & 1 deletion core/version/version.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@

//====== THIS IS AUTOGENERATED FILE. DO NOT MODIFY ========

package version

const VERSIONSTR = "1.0.9"
const VERSIONSTR = "v1.0.13"

1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+Ce
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
github.com/coreos/etcd v3.3.10+incompatible h1:jFneRYjIvLMLhDLCzuTuU4rSJUjRplcJQ7pD7MnhC04=
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
Expand Down
30 changes: 15 additions & 15 deletions zcncore/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,15 @@ func (t *Transaction) submitTxn() {
for _, miner := range randomMiners {
go func(minerurl string) {
url := minerurl + PUT_TRANSACTION
Logger.Info("Submitting", txnTypeString(t.txn.TransactionType), "transaction to", minerurl)
Logger.Info("Submitting ", txnTypeString(t.txn.TransactionType), " transaction to ", minerurl)
req, err := util.NewHTTPPostRequest(url, t.txn)
if err != nil {
Logger.Error(minerurl, "new post request failed. ", err.Error())
Logger.Error(minerurl, " new post request failed. ", err.Error())
return
}
res, err := req.Post()
if err != nil {
Logger.Error(minerurl, "submit transaction error. ", err.Error())
Logger.Error(minerurl, " submit transaction error. ", err.Error())
}
result <- res
return
Expand Down Expand Up @@ -369,16 +369,16 @@ func queryFromSharders(numSharders int, query string, result chan *util.GetRespo
randomShaders := util.GetRandom(_config.chain.Sharders, numSharders)
for _, sharder := range randomShaders {
go func(sharderurl string) {
Logger.Info("Query from", sharderurl+query)
Logger.Info("Query from ", sharderurl+query)
url := fmt.Sprintf("%v%v", sharderurl, query)
req, err := util.NewHTTPGetRequest(url)
if err != nil {
Logger.Error(sharderurl, "new get request failed. ", err.Error())
Logger.Error(sharderurl, " new get request failed. ", err.Error())
return
}
res, err := req.Get()
if err != nil {
Logger.Error(sharderurl, "get error. ", err.Error())
Logger.Error(sharderurl, " get error. ", err.Error())
}
result <- res
return
Expand All @@ -398,16 +398,16 @@ func getTransactionConfirmation(numSharders int, txnHash string) (map[string]jso
select {
case rsp := <-result:
Logger.Debug(rsp.Url, rsp.Status)
Logger.Error(rsp.Body)
Logger.Debug(rsp.Body)
if rsp.StatusCode == http.StatusOK {
var cfmLfb map[string]json.RawMessage
var objmap map[string]json.RawMessage
err := json.Unmarshal([]byte(rsp.Body), &cfmLfb)
if err != nil {
Logger.Error("txn confirmation parse error", err)
continue
}
if cfm, ok := cfmLfb["confirmation"]; ok {
var objmap map[string]json.RawMessage
err := json.Unmarshal([]byte(cfm), &objmap)
if err != nil {
Logger.Error("txn confirmation parse error", err)
Expand All @@ -424,12 +424,12 @@ func getTransactionConfirmation(numSharders int, txnHash string) (map[string]jso
}
}
} else {
Logger.Debug(rsp.Url, "No transaction confirmation")
Logger.Debug(rsp.Url, ". No transaction confirmation")
}
} else if lfbRaw, ok := cfmLfb["latest_finalized_block"]; ok {
err := json.Unmarshal([]byte(lfbRaw), &lfb)
if err != nil {
Logger.Error("round info parse error", err)
Logger.Error("round info parse error.", err)
continue
}
}
Expand Down Expand Up @@ -469,13 +469,13 @@ func getBlockInfoByRound(numSharders int, round int64, content string) (*blockHe
var objmap map[string]json.RawMessage
err := json.Unmarshal([]byte(rsp.Body), &objmap)
if err != nil {
Logger.Error("round info parse error", err)
Logger.Error("round info parse error. ", err)
continue
}
if header, ok := objmap["header"]; ok {
err := json.Unmarshal([]byte(header), &objmap)
if err != nil {
Logger.Error("round info parse error", err)
Logger.Error("round info parse error. ", err)
continue
}
if hash, ok := objmap["hash"]; ok {
Expand All @@ -485,7 +485,7 @@ func getBlockInfoByRound(numSharders int, round int64, content string) (*blockHe
maxConsensus = roundConsensus[h]
err := json.Unmarshal([]byte(header), &blkHdr)
if err != nil {
Logger.Error("round info parse error", err)
Logger.Error("round info parse error. ", err)
continue
}
}
Expand Down Expand Up @@ -577,9 +577,9 @@ func (t *Transaction) Verify() error {
confirmation, blockHash, lfb, err := getTransactionConfirmation(1, t.txnHash)
if err != nil {
tn := common.Now()
Logger.Info(err, "now:", tn, "LFB creation time:", lfb.CreationDate)
Logger.Info(err, " now: ", tn, ", LFB creation time:", lfb.CreationDate)
if util.MaxInt64(lfb.CreationDate, tn) < (t.txn.CreationDate + int64(defaultTxnExpirationSeconds)) {
Logger.Info("falling back to", getMinShardersVerify(), "of ", len(_config.chain.Sharders), "Sharders")
Logger.Info("falling back to ", getMinShardersVerify(), " of ", len(_config.chain.Sharders), " Sharders")
confirmation, blockHash, lfb, err = getTransactionConfirmation(getMinShardersVerify(), t.txnHash)
if err != nil {
if t.isTransactionExpired(lfb.CreationDate, tn) {
Expand Down

0 comments on commit 0f6b81d

Please sign in to comment.