Commit 21fc4c47 authored by 郝东博's avatar 郝东博

fix misspell warning

parent 83795d85
...@@ -15,6 +15,7 @@ function filterLinter() { ...@@ -15,6 +15,7 @@ function filterLinter() {
--enable=varcheck \ --enable=varcheck \
--enable=structcheck \ --enable=structcheck \
--enable=goimports \ --enable=goimports \
--enable=misspell \
--vendor ./...) --vendor ./...)
# --enable=staticcheck \ # --enable=staticcheck \
# --enable=gocyclo \ # --enable=gocyclo \
......
...@@ -148,5 +148,5 @@ func clearTestData() { ...@@ -148,5 +148,5 @@ func clearTestData() {
if err != nil { if err != nil {
fmt.Println("delete wallet have a err:", err.Error()) fmt.Println("delete wallet have a err:", err.Error())
} }
fmt.Println("test data clear sucessfully!") fmt.Println("test data clear successfully!")
} }
...@@ -175,5 +175,5 @@ func clearTestData() { ...@@ -175,5 +175,5 @@ func clearTestData() {
if err != nil { if err != nil {
fmt.Println("delete chain33_raft dir have a err:", err.Error()) fmt.Println("delete chain33_raft dir have a err:", err.Error())
} }
fmt.Println("test data clear sucessfully!") fmt.Println("test data clear successfully!")
} }
...@@ -181,7 +181,7 @@ func remoteScp(si *ScpInfo, reqnum chan struct{}) { ...@@ -181,7 +181,7 @@ func remoteScp(si *ScpInfo, reqnum chan struct{}) {
}() }()
ScpFileFromLocalToRemote(si) ScpFileFromLocalToRemote(si)
//session, err := sshconnect("ubuntu", "Fuzamei#123456", "raft15258.chinacloudapp.cn", 22) //session, err := sshconnect("ubuntu", "Fuzamei#123456", "raft15258.chinacloudapp.cn", 22)
fmt.Println("remoteScp file sucessfully!:") fmt.Println("remoteScp file successfully!:")
} }
......
...@@ -396,7 +396,7 @@ func (node *Node) stopAndRemovePeer(peer Peer, reason interface{}) { ...@@ -396,7 +396,7 @@ func (node *Node) stopAndRemovePeer(peer Peer, reason interface{}) {
peer.Stop() peer.Stop()
} }
// StopPeerForError called if error occured // StopPeerForError called if error occurred
func (node *Node) StopPeerForError(peer Peer, reason interface{}) { func (node *Node) StopPeerForError(peer Peer, reason interface{}) {
tendermintlog.Error("Stopping peer for error", "peer", peer, "err", reason) tendermintlog.Error("Stopping peer for error", "peer", peer, "err", reason)
addr, err := peer.RemoteAddr() addr, err := peer.RemoteAddr()
......
...@@ -161,7 +161,7 @@ func clearTestData() { ...@@ -161,7 +161,7 @@ func clearTestData() {
if err != nil { if err != nil {
fmt.Println("delete datadir have a err:", err.Error()) fmt.Println("delete datadir have a err:", err.Error())
} }
fmt.Println("test data clear sucessfully!") fmt.Println("test data clear successfully!")
} }
func NormPut() { func NormPut() {
......
...@@ -528,26 +528,26 @@ func (a *action) getWinner(round *gt.BlackwhiteRound) ([]*addrResult, *gt.ReplyL ...@@ -528,26 +528,26 @@ func (a *action) getWinner(round *gt.BlackwhiteRound) ([]*addrResult, *gt.ReplyL
addrRes := round.AddrResult addrRes := round.AddrResult
loop := int(round.Loop) loop := int(round.Loop)
for _, addres := range addrRes { for _, address := range addrRes {
if len(addres.ShowSecret) > 0 && len(addres.HashValues) == loop { if len(address.ShowSecret) > 0 && len(address.HashValues) == loop {
var isBlack []bool var isBlack []bool
// 加入分叉高度判断:分叉高度在ForkV25BlackWhite到ForkV25BlackWhiteV2之间的执行原来逻辑,大于ForkV25BlackWhiteV2执行新逻辑, // 加入分叉高度判断:分叉高度在ForkV25BlackWhite到ForkV25BlackWhiteV2之间的执行原来逻辑,大于ForkV25BlackWhiteV2执行新逻辑,
// 小于ForkV25BlackWhite则无法进入 // 小于ForkV25BlackWhite则无法进入
if !types.IsDappFork(a.height, gt.BlackwhiteX, "ForkBlackWhiteV2") { if !types.IsDappFork(a.height, gt.BlackwhiteX, "ForkBlackWhiteV2") {
for _, hash := range addres.HashValues { for _, hash := range address.HashValues {
if bytes.Equal(common.Sha256([]byte(addres.ShowSecret+black)), hash) { if bytes.Equal(common.Sha256([]byte(address.ShowSecret+black)), hash) {
isBlack = append(isBlack, true) isBlack = append(isBlack, true)
} else if bytes.Equal(common.Sha256([]byte(addres.ShowSecret+white)), hash) { } else if bytes.Equal(common.Sha256([]byte(address.ShowSecret+white)), hash) {
isBlack = append(isBlack, false) isBlack = append(isBlack, false)
} else { } else {
isBlack = append(isBlack, false) isBlack = append(isBlack, false)
} }
} }
} else { } else {
for i, hash := range addres.HashValues { for i, hash := range address.HashValues {
if bytes.Equal(common.Sha256([]byte(strconv.Itoa(i)+addres.ShowSecret+black)), hash) { if bytes.Equal(common.Sha256([]byte(strconv.Itoa(i)+address.ShowSecret+black)), hash) {
isBlack = append(isBlack, true) isBlack = append(isBlack, true)
} else if bytes.Equal(common.Sha256([]byte(strconv.Itoa(i)+addres.ShowSecret+white)), hash) { } else if bytes.Equal(common.Sha256([]byte(strconv.Itoa(i)+address.ShowSecret+white)), hash) {
isBlack = append(isBlack, false) isBlack = append(isBlack, false)
} else { } else {
isBlack = append(isBlack, false) isBlack = append(isBlack, false)
...@@ -555,8 +555,8 @@ func (a *action) getWinner(round *gt.BlackwhiteRound) ([]*addrResult, *gt.ReplyL ...@@ -555,8 +555,8 @@ func (a *action) getWinner(round *gt.BlackwhiteRound) ([]*addrResult, *gt.ReplyL
} }
} }
addresX := &resultCalc{ addresX := &resultCalc{
Addr: addres.Addr, Addr: address.Addr,
amount: addres.Amount, amount: address.Amount,
IsWin: true, IsWin: true,
IsBlack: isBlack, IsBlack: isBlack,
} }
......
...@@ -217,7 +217,7 @@ func Test_getWinnerAndLoser(t *testing.T) { ...@@ -217,7 +217,7 @@ func Test_getWinnerAndLoser(t *testing.T) {
Loop: 4, Loop: 4,
} }
addres := &gt.AddressResult{ address := &gt.AddressResult{
Addr: "1", Addr: "1",
HashValues: [][]byte{common.Sha256([]byte(strconv.Itoa(0) + showSecret + black)), HashValues: [][]byte{common.Sha256([]byte(strconv.Itoa(0) + showSecret + black)),
common.Sha256([]byte(strconv.Itoa(1) + showSecret + white)), common.Sha256([]byte(strconv.Itoa(1) + showSecret + white)),
...@@ -225,9 +225,9 @@ func Test_getWinnerAndLoser(t *testing.T) { ...@@ -225,9 +225,9 @@ func Test_getWinnerAndLoser(t *testing.T) {
common.Sha256([]byte(strconv.Itoa(3) + showSecret + white))}, common.Sha256([]byte(strconv.Itoa(3) + showSecret + white))},
ShowSecret: showSecret, ShowSecret: showSecret,
} }
addrRes = append(addrRes, addres) addrRes = append(addrRes, address)
addres = &gt.AddressResult{ address = &gt.AddressResult{
Addr: "2", Addr: "2",
HashValues: [][]byte{common.Sha256([]byte(strconv.Itoa(0) + showSecret + black)), HashValues: [][]byte{common.Sha256([]byte(strconv.Itoa(0) + showSecret + black)),
common.Sha256([]byte(strconv.Itoa(1) + showSecret + white)), common.Sha256([]byte(strconv.Itoa(1) + showSecret + white)),
...@@ -235,9 +235,9 @@ func Test_getWinnerAndLoser(t *testing.T) { ...@@ -235,9 +235,9 @@ func Test_getWinnerAndLoser(t *testing.T) {
common.Sha256([]byte(strconv.Itoa(3) + showSecret + white))}, common.Sha256([]byte(strconv.Itoa(3) + showSecret + white))},
ShowSecret: showSecret, ShowSecret: showSecret,
} }
addrRes = append(addrRes, addres) addrRes = append(addrRes, address)
addres = &gt.AddressResult{ address = &gt.AddressResult{
Addr: "3", Addr: "3",
HashValues: [][]byte{common.Sha256([]byte(strconv.Itoa(0) + showSecret + black)), HashValues: [][]byte{common.Sha256([]byte(strconv.Itoa(0) + showSecret + black)),
common.Sha256([]byte(strconv.Itoa(1) + showSecret + white)), common.Sha256([]byte(strconv.Itoa(1) + showSecret + white)),
...@@ -245,7 +245,7 @@ func Test_getWinnerAndLoser(t *testing.T) { ...@@ -245,7 +245,7 @@ func Test_getWinnerAndLoser(t *testing.T) {
common.Sha256([]byte(strconv.Itoa(3) + showSecret + black))}, common.Sha256([]byte(strconv.Itoa(3) + showSecret + black))},
ShowSecret: showSecret, ShowSecret: showSecret,
} }
addrRes = append(addrRes, addres) addrRes = append(addrRes, address)
round.AddrResult = addrRes round.AddrResult = addrRes
...@@ -257,7 +257,7 @@ func Test_getWinnerAndLoser(t *testing.T) { ...@@ -257,7 +257,7 @@ func Test_getWinnerAndLoser(t *testing.T) {
//t.Logf("winers1 is %v", winers) //t.Logf("winers1 is %v", winers)
//t.Logf("losers1 is %v", losers) //t.Logf("losers1 is %v", losers)
addres = &gt.AddressResult{ address = &gt.AddressResult{
Addr: "4", Addr: "4",
HashValues: [][]byte{common.Sha256([]byte(strconv.Itoa(0) + showSecret + black)), HashValues: [][]byte{common.Sha256([]byte(strconv.Itoa(0) + showSecret + black)),
common.Sha256([]byte(strconv.Itoa(1) + showSecret + white)), common.Sha256([]byte(strconv.Itoa(1) + showSecret + white)),
...@@ -265,9 +265,9 @@ func Test_getWinnerAndLoser(t *testing.T) { ...@@ -265,9 +265,9 @@ func Test_getWinnerAndLoser(t *testing.T) {
common.Sha256([]byte(strconv.Itoa(3) + showSecret + black))}, common.Sha256([]byte(strconv.Itoa(3) + showSecret + black))},
ShowSecret: showSecret, ShowSecret: showSecret,
} }
addrRes = append(addrRes, addres) addrRes = append(addrRes, address)
addres = &gt.AddressResult{ address = &gt.AddressResult{
Addr: "5", Addr: "5",
HashValues: [][]byte{common.Sha256([]byte(strconv.Itoa(0) + showSecret + black)), HashValues: [][]byte{common.Sha256([]byte(strconv.Itoa(0) + showSecret + black)),
common.Sha256([]byte(strconv.Itoa(1) + showSecret + white)), common.Sha256([]byte(strconv.Itoa(1) + showSecret + white)),
...@@ -275,7 +275,7 @@ func Test_getWinnerAndLoser(t *testing.T) { ...@@ -275,7 +275,7 @@ func Test_getWinnerAndLoser(t *testing.T) {
common.Sha256([]byte(strconv.Itoa(3) + showSecret + white))}, common.Sha256([]byte(strconv.Itoa(3) + showSecret + white))},
ShowSecret: showSecret, ShowSecret: showSecret,
} }
addrRes = append(addrRes, addres) addrRes = append(addrRes, address)
round.AddrResult = addrRes round.AddrResult = addrRes
...@@ -286,7 +286,7 @@ func Test_getWinnerAndLoser(t *testing.T) { ...@@ -286,7 +286,7 @@ func Test_getWinnerAndLoser(t *testing.T) {
//t.Logf("winers2 is %v", winers) //t.Logf("winers2 is %v", winers)
//t.Logf("losers2 is %v", losers) //t.Logf("losers2 is %v", losers)
addres = &gt.AddressResult{ address = &gt.AddressResult{
Addr: "6", Addr: "6",
HashValues: [][]byte{common.Sha256([]byte(strconv.Itoa(0) + showSecret + black)), HashValues: [][]byte{common.Sha256([]byte(strconv.Itoa(0) + showSecret + black)),
common.Sha256([]byte(strconv.Itoa(1) + showSecret + white)), common.Sha256([]byte(strconv.Itoa(1) + showSecret + white)),
...@@ -298,7 +298,7 @@ func Test_getWinnerAndLoser(t *testing.T) { ...@@ -298,7 +298,7 @@ func Test_getWinnerAndLoser(t *testing.T) {
common.Sha256([]byte(strconv.Itoa(7) + showSecret + white))}, common.Sha256([]byte(strconv.Itoa(7) + showSecret + white))},
ShowSecret: showSecret, ShowSecret: showSecret,
} }
addrRes = append(addrRes, addres) addrRes = append(addrRes, address)
round.AddrResult = addrRes round.AddrResult = addrRes
......
...@@ -67,7 +67,7 @@ func (b BlackwhiteType) ActionName(tx *types.Transaction) string { ...@@ -67,7 +67,7 @@ func (b BlackwhiteType) ActionName(tx *types.Transaction) string {
var g BlackwhiteAction var g BlackwhiteAction
err := types.Decode(tx.Payload, &g) err := types.Decode(tx.Payload, &g)
if err != nil { if err != nil {
return "unkown-Blackwhite-action-err" return "unknown-Blackwhite-action-err"
} }
if g.Ty == BlackwhiteActionCreate && g.GetCreate() != nil { if g.Ty == BlackwhiteActionCreate && g.GetCreate() != nil {
return "BlackwhiteCreate" return "BlackwhiteCreate"
...@@ -78,7 +78,7 @@ func (b BlackwhiteType) ActionName(tx *types.Transaction) string { ...@@ -78,7 +78,7 @@ func (b BlackwhiteType) ActionName(tx *types.Transaction) string {
} else if g.Ty == BlackwhiteActionTimeoutDone && g.GetTimeoutDone() != nil { } else if g.Ty == BlackwhiteActionTimeoutDone && g.GetTimeoutDone() != nil {
return "BlackwhiteTimeoutDone" return "BlackwhiteTimeoutDone"
} }
return "unkown" return "unknown"
} }
// Amount ... // Amount ...
......
This diff is collapsed.
...@@ -106,7 +106,7 @@ func runDir(tt *testing.T, basePath string) { ...@@ -106,7 +106,7 @@ func runDir(tt *testing.T, basePath string) {
} }
func runCase(tt *testing.T, c VMCase, file string) { func runCase(tt *testing.T, c VMCase, file string) {
tt.Logf("runing test case:%s in file:%s", c.name, file) tt.Logf("running test case:%s in file:%s", c.name, file)
// 1 构建预置环境 pre // 1 构建预置环境 pre
inst := evm.NewEVMExecutor() inst := evm.NewEVMExecutor()
......
This diff is collapsed.
This diff is collapsed.
...@@ -188,7 +188,7 @@ func estHashlock(t *testing.T) { ...@@ -188,7 +188,7 @@ func estHashlock(t *testing.T) {
func estHashunlock(t *testing.T) { func estHashunlock(t *testing.T) {
fmt.Println("TestHashunlock start") fmt.Println("TestHashunlock start")
defer fmt.Println("TestHashunlock end") defer fmt.Println("TestHashunlock end")
//not sucess as time not enough //not success as time not enough
time.Sleep(5 * time.Second) time.Sleep(5 * time.Second)
err := unlock(secret) err := unlock(secret)
if err != nil { if err != nil {
......
...@@ -34,7 +34,7 @@ message Hashlockquery { ...@@ -34,7 +34,7 @@ message Hashlockquery {
message HashRecv { message HashRecv {
bytes HashlockId = 1; bytes HashlockId = 1;
Hashlockquery Infomation = 2; Hashlockquery Information = 2;
} }
message HashlockUnlock { message HashlockUnlock {
......
This diff is collapsed.
...@@ -548,11 +548,11 @@ func (action *Action) GetCalculableHash(beg, end int64, randMolNum int64) ([]byt ...@@ -548,11 +548,11 @@ func (action *Action) GetCalculableHash(beg, end int64, randMolNum int64) ([]byt
return modify, nil return modify, nil
} }
//random used for verfication in solo //random used for verification in solo
func (action *Action) findLuckyNum(isSolo bool, lott *LotteryDB) int64 { func (action *Action) findLuckyNum(isSolo bool, lott *LotteryDB) int64 {
var num int64 var num int64
if isSolo { if isSolo {
//used for internal verfication //used for internal verification
num = 12345 num = 12345
} else { } else {
randMolNum := (lott.TotalPurchasedTxNum+action.height-lott.LastTransToPurState)%3 + 2 //3~5 randMolNum := (lott.TotalPurchasedTxNum+action.height-lott.LastTransToPurState)%3 + 2 //3~5
......
This diff is collapsed.
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// source: norm.proto // source: norm.proto
/*
Package types is a generated protocol buffer package.
It is generated from these files:
norm.proto
It has these top-level messages:
Norm
NormAction
NormPut
NormGetKey
*/
package types package types
import proto "github.com/golang/protobuf/proto" import (
import fmt "fmt" fmt "fmt"
import math "math" proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal var _ = proto.Marshal
...@@ -31,16 +21,39 @@ var _ = math.Inf ...@@ -31,16 +21,39 @@ var _ = math.Inf
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type Norm struct { type Norm struct {
NormId []byte `protobuf:"bytes,1,opt,name=normId,proto3" json:"normId,omitempty"` NormId []byte `protobuf:"bytes,1,opt,name=normId,proto3" json:"normId,omitempty"`
CreateTime int64 `protobuf:"varint,2,opt,name=createTime" json:"createTime,omitempty"` CreateTime int64 `protobuf:"varint,2,opt,name=createTime,proto3" json:"createTime,omitempty"`
Key string `protobuf:"bytes,3,opt,name=key" json:"key,omitempty"` Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"`
Value []byte `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` Value []byte `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
} }
func (m *Norm) Reset() { *m = Norm{} } func (m *Norm) Reset() { *m = Norm{} }
func (m *Norm) String() string { return proto.CompactTextString(m) } func (m *Norm) String() string { return proto.CompactTextString(m) }
func (*Norm) ProtoMessage() {} func (*Norm) ProtoMessage() {}
func (*Norm) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } func (*Norm) Descriptor() ([]byte, []int) {
return fileDescriptor_4c505000707f0293, []int{0}
}
func (m *Norm) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_Norm.Unmarshal(m, b)
}
func (m *Norm) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_Norm.Marshal(b, m, deterministic)
}
func (m *Norm) XXX_Merge(src proto.Message) {
xxx_messageInfo_Norm.Merge(m, src)
}
func (m *Norm) XXX_Size() int {
return xxx_messageInfo_Norm.Size(m)
}
func (m *Norm) XXX_DiscardUnknown() {
xxx_messageInfo_Norm.DiscardUnknown(m)
}
var xxx_messageInfo_Norm proto.InternalMessageInfo
func (m *Norm) GetNormId() []byte { func (m *Norm) GetNormId() []byte {
if m != nil { if m != nil {
...@@ -73,21 +86,44 @@ func (m *Norm) GetValue() []byte { ...@@ -73,21 +86,44 @@ func (m *Norm) GetValue() []byte {
type NormAction struct { type NormAction struct {
// Types that are valid to be assigned to Value: // Types that are valid to be assigned to Value:
// *NormAction_Nput // *NormAction_Nput
Value isNormAction_Value `protobuf_oneof:"value"` Value isNormAction_Value `protobuf_oneof:"value"`
Ty int32 `protobuf:"varint,5,opt,name=ty" json:"ty,omitempty"` Ty int32 `protobuf:"varint,5,opt,name=ty,proto3" json:"ty,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *NormAction) Reset() { *m = NormAction{} }
func (m *NormAction) String() string { return proto.CompactTextString(m) }
func (*NormAction) ProtoMessage() {}
func (*NormAction) Descriptor() ([]byte, []int) {
return fileDescriptor_4c505000707f0293, []int{1}
}
func (m *NormAction) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_NormAction.Unmarshal(m, b)
}
func (m *NormAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_NormAction.Marshal(b, m, deterministic)
}
func (m *NormAction) XXX_Merge(src proto.Message) {
xxx_messageInfo_NormAction.Merge(m, src)
}
func (m *NormAction) XXX_Size() int {
return xxx_messageInfo_NormAction.Size(m)
}
func (m *NormAction) XXX_DiscardUnknown() {
xxx_messageInfo_NormAction.DiscardUnknown(m)
} }
func (m *NormAction) Reset() { *m = NormAction{} } var xxx_messageInfo_NormAction proto.InternalMessageInfo
func (m *NormAction) String() string { return proto.CompactTextString(m) }
func (*NormAction) ProtoMessage() {}
func (*NormAction) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
type isNormAction_Value interface { type isNormAction_Value interface {
isNormAction_Value() isNormAction_Value()
} }
type NormAction_Nput struct { type NormAction_Nput struct {
Nput *NormPut `protobuf:"bytes,1,opt,name=nput,oneof"` Nput *NormPut `protobuf:"bytes,1,opt,name=nput,proto3,oneof"`
} }
func (*NormAction_Nput) isNormAction_Value() {} func (*NormAction_Nput) isNormAction_Value() {}
...@@ -158,7 +194,7 @@ func _NormAction_OneofSizer(msg proto.Message) (n int) { ...@@ -158,7 +194,7 @@ func _NormAction_OneofSizer(msg proto.Message) (n int) {
switch x := m.Value.(type) { switch x := m.Value.(type) {
case *NormAction_Nput: case *NormAction_Nput:
s := proto.Size(x.Nput) s := proto.Size(x.Nput)
n += proto.SizeVarint(1<<3 | proto.WireBytes) n += 1 // tag and wire
n += proto.SizeVarint(uint64(s)) n += proto.SizeVarint(uint64(s))
n += s n += s
case nil: case nil:
...@@ -169,14 +205,37 @@ func _NormAction_OneofSizer(msg proto.Message) (n int) { ...@@ -169,14 +205,37 @@ func _NormAction_OneofSizer(msg proto.Message) (n int) {
} }
type NormPut struct { type NormPut struct {
Key string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
} }
func (m *NormPut) Reset() { *m = NormPut{} } func (m *NormPut) Reset() { *m = NormPut{} }
func (m *NormPut) String() string { return proto.CompactTextString(m) } func (m *NormPut) String() string { return proto.CompactTextString(m) }
func (*NormPut) ProtoMessage() {} func (*NormPut) ProtoMessage() {}
func (*NormPut) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } func (*NormPut) Descriptor() ([]byte, []int) {
return fileDescriptor_4c505000707f0293, []int{2}
}
func (m *NormPut) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_NormPut.Unmarshal(m, b)
}
func (m *NormPut) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_NormPut.Marshal(b, m, deterministic)
}
func (m *NormPut) XXX_Merge(src proto.Message) {
xxx_messageInfo_NormPut.Merge(m, src)
}
func (m *NormPut) XXX_Size() int {
return xxx_messageInfo_NormPut.Size(m)
}
func (m *NormPut) XXX_DiscardUnknown() {
xxx_messageInfo_NormPut.DiscardUnknown(m)
}
var xxx_messageInfo_NormPut proto.InternalMessageInfo
func (m *NormPut) GetKey() string { func (m *NormPut) GetKey() string {
if m != nil { if m != nil {
...@@ -193,13 +252,36 @@ func (m *NormPut) GetValue() []byte { ...@@ -193,13 +252,36 @@ func (m *NormPut) GetValue() []byte {
} }
type NormGetKey struct { type NormGetKey struct {
Key string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *NormGetKey) Reset() { *m = NormGetKey{} }
func (m *NormGetKey) String() string { return proto.CompactTextString(m) }
func (*NormGetKey) ProtoMessage() {}
func (*NormGetKey) Descriptor() ([]byte, []int) {
return fileDescriptor_4c505000707f0293, []int{3}
}
func (m *NormGetKey) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_NormGetKey.Unmarshal(m, b)
}
func (m *NormGetKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_NormGetKey.Marshal(b, m, deterministic)
}
func (m *NormGetKey) XXX_Merge(src proto.Message) {
xxx_messageInfo_NormGetKey.Merge(m, src)
}
func (m *NormGetKey) XXX_Size() int {
return xxx_messageInfo_NormGetKey.Size(m)
}
func (m *NormGetKey) XXX_DiscardUnknown() {
xxx_messageInfo_NormGetKey.DiscardUnknown(m)
} }
func (m *NormGetKey) Reset() { *m = NormGetKey{} } var xxx_messageInfo_NormGetKey proto.InternalMessageInfo
func (m *NormGetKey) String() string { return proto.CompactTextString(m) }
func (*NormGetKey) ProtoMessage() {}
func (*NormGetKey) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
func (m *NormGetKey) GetKey() string { func (m *NormGetKey) GetKey() string {
if m != nil { if m != nil {
...@@ -215,9 +297,9 @@ func init() { ...@@ -215,9 +297,9 @@ func init() {
proto.RegisterType((*NormGetKey)(nil), "types.NormGetKey") proto.RegisterType((*NormGetKey)(nil), "types.NormGetKey")
} }
func init() { proto.RegisterFile("norm.proto", fileDescriptor0) } func init() { proto.RegisterFile("norm.proto", fileDescriptor_4c505000707f0293) }
var fileDescriptor0 = []byte{ var fileDescriptor_4c505000707f0293 = []byte{
// 211 bytes of a gzipped FileDescriptorProto // 211 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0xc1, 0x4a, 0xc6, 0x30, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0xc1, 0x4a, 0xc6, 0x30,
0x10, 0x84, 0x4d, 0xda, 0xfc, 0xc5, 0x55, 0x8a, 0x04, 0x91, 0x9c, 0x4a, 0x28, 0x1e, 0x72, 0x2a, 0x10, 0x84, 0x4d, 0xda, 0xfc, 0xc5, 0x55, 0x8a, 0x04, 0x91, 0x9c, 0x4a, 0x28, 0x1e, 0x72, 0x2a,
......
This diff is collapsed.
...@@ -520,9 +520,9 @@ func (action *Action) checkPlayerExistInGame() bool { ...@@ -520,9 +520,9 @@ func (action *Action) checkPlayerExistInGame() bool {
} }
var value pkt.PBGameRecord var value pkt.PBGameRecord
lenght := len(values) length := len(values)
if lenght != 0 { if length != 0 {
valueBytes := values[lenght-1] valueBytes := values[length-1]
err := types.Decode(valueBytes, &value) err := types.Decode(valueBytes, &value)
if err == nil && value.Status == pkt.PBGameActionQuit { if err == nil && value.Status == pkt.PBGameActionQuit {
return false return false
......
This diff is collapsed.
...@@ -499,7 +499,7 @@ func showPrivacyAccountInfoFlag(cmd *cobra.Command) { ...@@ -499,7 +499,7 @@ func showPrivacyAccountInfoFlag(cmd *cobra.Command) {
cmd.MarkFlagRequired("addr") cmd.MarkFlagRequired("addr")
cmd.Flags().StringP("token", "t", types.BTY, "coins token, BTY supported.") cmd.Flags().StringP("token", "t", types.BTY, "coins token, BTY supported.")
cmd.Flags().Int32P("displaymode", "d", 0, "display mode.(0: display collect. 1:display avaliable detail. 2:display frozen detail. 3:display all") cmd.Flags().Int32P("displaymode", "d", 0, "display mode.(0: display collect. 1:display available detail. 2:display frozen detail. 3:display all")
} }
func showPrivacyAccountInfo(cmd *cobra.Command, args []string) { func showPrivacyAccountInfo(cmd *cobra.Command, args []string) {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -38,7 +38,7 @@ func (policy *privacyPolicy) rescanAllTxAddToUpdateUTXOs() { ...@@ -38,7 +38,7 @@ func (policy *privacyPolicy) rescanAllTxAddToUpdateUTXOs() {
go policy.rescanReqTxDetailByAddr(acc.Addr, policy.rescanwg) go policy.rescanReqTxDetailByAddr(acc.Addr, policy.rescanwg)
} }
policy.rescanwg.Wait() policy.rescanwg.Wait()
bizlog.Debug("rescanAllTxToUpdateUTXOs sucess!") bizlog.Debug("rescanAllTxToUpdateUTXOs success!")
} }
//从blockchain模块同步addr参与的所有交易详细信息 //从blockchain模块同步addr参与的所有交易详细信息
...@@ -820,7 +820,7 @@ func (policy *privacyPolicy) rescanReqUtxosByAddr(addrs []string) { ...@@ -820,7 +820,7 @@ func (policy *privacyPolicy) rescanReqUtxosByAddr(addrs []string) {
defer policy.getWalletOperate().GetWaitGroup().Done() defer policy.getWalletOperate().GetWaitGroup().Done()
bizlog.Debug("RescanAllUTXO begin!") bizlog.Debug("RescanAllUTXO begin!")
policy.reqUtxosByAddr(addrs) policy.reqUtxosByAddr(addrs)
bizlog.Debug("RescanAllUTXO sucess!") bizlog.Debug("RescanAllUTXO success!")
} }
func (policy *privacyPolicy) reqUtxosByAddr(addrs []string) { func (policy *privacyPolicy) reqUtxosByAddr(addrs []string) {
......
This diff is collapsed.
...@@ -344,7 +344,7 @@ func estRetrievePerform(t *testing.T) { ...@@ -344,7 +344,7 @@ func estRetrievePerform(t *testing.T) {
func estRetrieveCancel(t *testing.T) { func estRetrieveCancel(t *testing.T) {
fmt.Println("\nTestRetrieveCancel start") fmt.Println("\nTestRetrieveCancel start")
fmt.Println("*This case is used for checking cancel operation\n*Cancel action is done with privkey of account A/B, although the cancel action for A could succeed, but the balance have been transfered by last action with backup a\n*currBalanceA = currBalanceA - 2*fee currBalanceB = currBalanceB + 1e8 - 2*fee") fmt.Println("*This case is used for checking cancel operation\n*Cancel action is done with privkey of account A/B, although the cancel action for A could succeed, but the balance have been transferred by last action with backup a\n*currBalanceA = currBalanceA - 2*fee currBalanceB = currBalanceB + 1e8 - 2*fee")
defer fmt.Println("TestRetrieveCancel end") defer fmt.Println("TestRetrieveCancel end")
var hashes [][]byte var hashes [][]byte
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -10,22 +10,25 @@ import ( ...@@ -10,22 +10,25 @@ import (
// RPCReplyTradeOrder : trade order // RPCReplyTradeOrder : trade order
type RPCReplyTradeOrder struct { type RPCReplyTradeOrder struct {
TokenSymbol string `protobuf:"bytes,1,opt,name=tokenSymbol" json:"tokenSymbol"` TokenSymbol string `protobuf:"bytes,1,opt,name=tokenSymbol" json:"tokenSymbol"`
Owner string `protobuf:"bytes,2,opt,name=owner" json:"owner"` Owner string `protobuf:"bytes,2,opt,name=owner" json:"owner"`
AmountPerBoardlot int64 `protobuf:"varint,3,opt,name=amountPerBoardlot" json:"amountPerBoardlot"` AmountPerBoardlot int64 `protobuf:"varint,3,opt,name=amountPerBoardlot" json:"amountPerBoardlot"`
MinBoardlot int64 `protobuf:"varint,4,opt,name=minBoardlot" json:"minBoardlot"` MinBoardlot int64 `protobuf:"varint,4,opt,name=minBoardlot" json:"minBoardlot"`
PricePerBoardlot int64 `protobuf:"varint,5,opt,name=pricePerBoardlot" json:"pricePerBoardlot"` PricePerBoardlot int64 `protobuf:"varint,5,opt,name=pricePerBoardlot" json:"pricePerBoardlot"`
TotalBoardlot int64 `protobuf:"varint,6,opt,name=totalBoardlot" json:"totalBoardlot"` TotalBoardlot int64 `protobuf:"varint,6,opt,name=totalBoardlot" json:"totalBoardlot"`
TradedBoardlot int64 `protobuf:"varint,7,opt,name=tradedBoardlot" json:"tradedBoardlot"` TradedBoardlot int64 `protobuf:"varint,7,opt,name=tradedBoardlot" json:"tradedBoardlot"`
BuyID string `protobuf:"bytes,8,opt,name=buyID" json:"buyID"` BuyID string `protobuf:"bytes,8,opt,name=buyID" json:"buyID"`
Status int32 `protobuf:"varint,9,opt,name=status" json:"status"` Status int32 `protobuf:"varint,9,opt,name=status" json:"status"`
SellID string `protobuf:"bytes,10,opt,name=sellID" json:"sellID"` SellID string `protobuf:"bytes,10,opt,name=sellID" json:"sellID"`
TxHash string `protobuf:"bytes,11,opt,name=txHash" json:"txHash"` TxHash string `protobuf:"bytes,11,opt,name=txHash" json:"txHash"`
Height int64 `protobuf:"varint,12,opt,name=height" json:"height"` Height int64 `protobuf:"varint,12,opt,name=height" json:"height"`
Key string `protobuf:"bytes,13,opt,name=key" json:"key"` Key string `protobuf:"bytes,13,opt,name=key" json:"key"`
BlockTime int64 `protobuf:"varint,14,opt,name=blockTime" json:"blockTime"` BlockTime int64 `protobuf:"varint,14,opt,name=blockTime" json:"blockTime"`
IsSellOrder bool `protobuf:"varint,15,opt,name=isSellOrder" json:"isSellOrder"` IsSellOrder bool `protobuf:"varint,15,opt,name=isSellOrder" json:"isSellOrder"`
AssetExec string `protobuf:"bytes,16,opt,name=assetExec" json:"assetExec"` AssetExec string `protobuf:"bytes,16,opt,name=assetExec" json:"assetExec"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
} }
//MarshalJSON : //MarshalJSON :
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment