Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
plugin
Commits
babaa782
Commit
babaa782
authored
Nov 26, 2018
by
kingwang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix linter
parent
2e832209
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
72 additions
and
82 deletions
+72
-82
.gitignore
.gitignore
+1
-0
Makefile
Makefile
+3
-1
raft_test.go
plugin/consensus/raft/raft_test.go
+1
-1
raftPerf.go
plugin/consensus/raft/tools/raftPerf.go
+2
-2
tendermint_test.go
plugin/consensus/tendermint/tendermint_test.go
+1
-1
blackwhite.pb.go
plugin/dapp/blackwhite/types/blackwhite.pb.go
+1
-2
cert.pb.go
plugin/dapp/cert/types/cert.pb.go
+1
-2
evmcontract.pb.go
plugin/dapp/evm/types/evmcontract.pb.go
+1
-2
game.pb.go
plugin/dapp/game/types/game.pb.go
+1
-2
hashlock.pb.go
plugin/dapp/hashlock/types/hashlock.pb.go
+1
-2
lottery.pb.go
plugin/dapp/lottery/types/lottery.pb.go
+1
-2
norm.go
plugin/dapp/norm/executor/norm.go
+1
-1
norm.proto
plugin/dapp/norm/proto/norm.proto
+4
-3
norm.pb.go
plugin/dapp/norm/types/norm.pb.go
+25
-26
paracross.pb.go
plugin/dapp/paracross/types/paracross.pb.go
+1
-2
pokerbull.pb.go
plugin/dapp/pokerbull/types/pokerbull.pb.go
+1
-2
privacy.pb.go
plugin/dapp/privacy/types/privacy.pb.go
+1
-2
privacystore_test.go
plugin/dapp/privacy/wallet/privacystore_test.go
+4
-4
relaydb_test.go
plugin/dapp/relay/executor/relaydb_test.go
+9
-4
relay.pb.go
plugin/dapp/relay/types/relay.pb.go
+1
-2
retrieve.pb.go
plugin/dapp/retrieve/types/retrieve.pb.go
+1
-2
rpc_test.go
plugin/dapp/ticket/rpc/rpc_test.go
+1
-1
ticket.pb.go
plugin/dapp/ticket/types/ticket.pb.go
+1
-2
types_test.go
plugin/dapp/ticket/types/types_test.go
+4
-6
token.pb.go
plugin/dapp/token/types/token.pb.go
+1
-2
trade.pb.go
plugin/dapp/trade/types/trade.pb.go
+1
-2
tendermint.pb.go
plugin/dapp/valnode/types/tendermint.pb.go
+1
-2
valnode.pb.go
plugin/dapp/valnode/types/valnode.pb.go
+1
-2
No files found.
.gitignore
View file @
babaa782
...
...
@@ -8,6 +8,7 @@ datadir*
.idea
.vscode
build/chain33*
chain33_raft-1
build/datadir
build/bityuan*
build/para
...
...
Makefile
View file @
babaa782
...
...
@@ -13,7 +13,6 @@ CHAIN33_PATH=vendor/${CHAIN33}
LDFLAGS
:=
-ldflags
"-w -s"
PKG_LIST_VET
:=
`
go list ./... |
grep
-v
"vendor"
|
grep
-v
plugin/dapp/evm/executor/vm/common/crypto/bn256
`
PKG_LIST
:=
`
go list ./... |
grep
-v
"vendor"
|
grep
-v
"chain33/test"
|
grep
-v
"mocks"
|
grep
-v
"pbft"
`
PKG_LIST_Q
:=
`
go list ./... |
grep
-v
"vendor"
|
grep
-v
"chain33/test"
|
grep
-v
"mocks"
|
grep
-v
"blockchain"
|
grep
-v
"pbft"
`
BUILD_FLAGS
=
-ldflags
"-X github.com/33cn/chain33/common/version.GitCommit=
`
git rev-parse
--short
=
8 HEAD
`
"
MKPATH
=
$
(
abspath
$
(
lastword
$(MAKEFILE_LIST)
))
MKDIR
=
$
(
dir
$(MKPATH)
)
...
...
@@ -88,6 +87,9 @@ race: ## Run data race detector
test
:
##
Run unittests
@
go
test
-race
$(PKG_LIST)
testq
:
##
Run unittests
@
go
test
$(PKG_LIST)
fmt
:
fmt_proto fmt_shell
##
go fmt
@
go
fmt
./...
@
find
.
-name
'*.go'
-not
-path
"./vendor/*"
| xargs goimports
-l
-w
...
...
plugin/consensus/raft/raft_test.go
View file @
babaa782
...
...
@@ -149,7 +149,7 @@ func prepareTxList() *types.Transaction {
key
=
generateKey
(
i
,
32
)
value
=
generateValue
(
i
,
180
)
nput
:=
&
pty
.
NormAction_Nput
{
Nput
:
&
pty
.
NormPut
{
Key
:
key
,
Value
:
[]
byte
(
value
)}}
nput
:=
&
pty
.
NormAction_Nput
{
Nput
:
&
pty
.
NormPut
{
Key
:
[]
byte
(
key
)
,
Value
:
[]
byte
(
value
)}}
action
:=
&
pty
.
NormAction
{
Value
:
nput
,
Ty
:
pty
.
NormActionPut
}
tx
:=
&
types
.
Transaction
{
Execer
:
[]
byte
(
"norm"
),
Payload
:
types
.
Encode
(
action
),
Fee
:
0
}
tx
.
To
=
address
.
ExecAddress
(
"norm"
)
...
...
plugin/consensus/raft/tools/raftPerf.go
View file @
babaa782
...
...
@@ -330,7 +330,7 @@ func RandStringBytes(n int) string {
// NormPut run put action
func
NormPut
(
privkey
string
,
key
string
,
value
string
)
{
fmt
.
Println
(
key
,
"="
,
value
)
nput
:=
&
pty
.
NormAction_Nput
{
Nput
:
&
pty
.
NormPut
{
Key
:
key
,
Value
:
[]
byte
(
value
)}}
nput
:=
&
pty
.
NormAction_Nput
{
Nput
:
&
pty
.
NormPut
{
Key
:
[]
byte
(
key
)
,
Value
:
[]
byte
(
value
)}}
action
:=
&
pty
.
NormAction
{
Value
:
nput
,
Ty
:
pty
.
NormActionPut
}
tx
:=
&
types
.
Transaction
{
Execer
:
[]
byte
(
"norm"
),
Payload
:
types
.
Encode
(
action
),
Fee
:
fee
}
tx
.
To
=
address
.
ExecAddress
(
"norm"
)
...
...
@@ -350,7 +350,7 @@ func NormPut(privkey string, key string, value string) {
// NormGet run query action
func
NormGet
(
key
string
)
{
in
:=
&
pty
.
NormGetKey
{
Key
:
key
}
in
:=
&
pty
.
NormGetKey
{
Key
:
[]
byte
(
key
)
}
data
,
err
:=
proto
.
Marshal
(
in
)
if
err
!=
nil
{
fmt
.
Fprintln
(
os
.
Stderr
,
err
)
...
...
plugin/consensus/tendermint/tendermint_test.go
View file @
babaa782
...
...
@@ -147,7 +147,7 @@ func prepareTxList() *types.Transaction {
key
=
generateKey
(
i
,
32
)
value
=
generateValue
(
i
,
180
)
nput
:=
&
pty
.
NormAction_Nput
{
Nput
:
&
pty
.
NormPut
{
Key
:
key
,
Value
:
[]
byte
(
value
)}}
nput
:=
&
pty
.
NormAction_Nput
{
Nput
:
&
pty
.
NormPut
{
Key
:
[]
byte
(
key
)
,
Value
:
[]
byte
(
value
)}}
action
:=
&
pty
.
NormAction
{
Value
:
nput
,
Ty
:
pty
.
NormActionPut
}
tx
:=
&
types
.
Transaction
{
Execer
:
[]
byte
(
"norm"
),
Payload
:
types
.
Encode
(
action
),
Fee
:
fee
}
tx
.
To
=
address
.
ExecAddress
(
"norm"
)
...
...
plugin/dapp/blackwhite/types/blackwhite.pb.go
View file @
babaa782
...
...
@@ -6,11 +6,10 @@ package types
import
(
context
"context"
fmt
"fmt"
math
"math"
types
"github.com/33cn/chain33/types"
proto
"github.com/golang/protobuf/proto"
grpc
"google.golang.org/grpc"
math
"math"
)
// Reference imports to suppress errors if they are not otherwise used.
...
...
plugin/dapp/cert/types/cert.pb.go
View file @
babaa782
...
...
@@ -5,9 +5,8 @@ package types
import
(
fmt
"fmt"
math
"math"
proto
"github.com/golang/protobuf/proto"
math
"math"
)
// Reference imports to suppress errors if they are not otherwise used.
...
...
plugin/dapp/evm/types/evmcontract.pb.go
View file @
babaa782
...
...
@@ -5,9 +5,8 @@ package types
import
(
fmt
"fmt"
math
"math"
proto
"github.com/golang/protobuf/proto"
math
"math"
)
// Reference imports to suppress errors if they are not otherwise used.
...
...
plugin/dapp/game/types/game.pb.go
View file @
babaa782
...
...
@@ -5,9 +5,8 @@ package types
import
(
fmt
"fmt"
math
"math"
proto
"github.com/golang/protobuf/proto"
math
"math"
)
// Reference imports to suppress errors if they are not otherwise used.
...
...
plugin/dapp/hashlock/types/hashlock.pb.go
View file @
babaa782
...
...
@@ -5,9 +5,8 @@ package types
import
(
fmt
"fmt"
math
"math"
proto
"github.com/golang/protobuf/proto"
math
"math"
)
// Reference imports to suppress errors if they are not otherwise used.
...
...
plugin/dapp/lottery/types/lottery.pb.go
View file @
babaa782
...
...
@@ -5,9 +5,8 @@ package types
import
(
fmt
"fmt"
math
"math"
proto
"github.com/golang/protobuf/proto"
math
"math"
)
// Reference imports to suppress errors if they are not otherwise used.
...
...
plugin/dapp/norm/executor/norm.go
View file @
babaa782
...
...
@@ -53,7 +53,7 @@ func (n *Norm) CheckTx(tx *types.Transaction, index int) error {
}
// Key for norm
func
Key
(
str
string
)
(
key
[]
byte
)
{
func
Key
(
str
[]
byte
)
(
key
[]
byte
)
{
key
=
append
(
key
,
[]
byte
(
"mavl-norm-"
)
...
)
key
=
append
(
key
,
str
...
)
return
key
...
...
plugin/dapp/norm/proto/norm.proto
View file @
babaa782
...
...
@@ -4,7 +4,7 @@ package types;
message
Norm
{
bytes
normId
=
1
;
int64
createTime
=
2
;
string
key
=
3
;
bytes
key
=
3
;
bytes
value
=
4
;
}
...
...
@@ -16,10 +16,10 @@ message NormAction {
}
message
NormPut
{
string
key
=
1
;
bytes
key
=
1
;
bytes
value
=
2
;
}
message
NormGetKey
{
string
key
=
1
;
bytes
key
=
1
;
}
\ No newline at end of file
plugin/dapp/norm/types/norm.pb.go
View file @
babaa782
...
...
@@ -5,9 +5,8 @@ package types
import
(
fmt
"fmt"
math
"math"
proto
"github.com/golang/protobuf/proto"
math
"math"
)
// Reference imports to suppress errors if they are not otherwise used.
...
...
@@ -24,7 +23,7 @@ const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type
Norm
struct
{
NormId
[]
byte
`protobuf:"bytes,1,opt,name=normId,proto3" json:"normId,omitempty"`
CreateTime
int64
`protobuf:"varint,2,opt,name=createTime,proto3" json:"createTime,omitempty"`
Key
string
`protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"`
Key
[]
byte
`protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"`
Value
[]
byte
`protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"`
XXX_NoUnkeyedLiteral
struct
{}
`json:"-"`
XXX_unrecognized
[]
byte
`json:"-"`
...
...
@@ -70,11 +69,11 @@ func (m *Norm) GetCreateTime() int64 {
return
0
}
func
(
m
*
Norm
)
GetKey
()
string
{
func
(
m
*
Norm
)
GetKey
()
[]
byte
{
if
m
!=
nil
{
return
m
.
Key
}
return
""
return
nil
}
func
(
m
*
Norm
)
GetValue
()
[]
byte
{
...
...
@@ -206,7 +205,7 @@ func _NormAction_OneofSizer(msg proto.Message) (n int) {
}
type
NormPut
struct
{
Key
string
`protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Key
[]
byte
`protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Value
[]
byte
`protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
XXX_NoUnkeyedLiteral
struct
{}
`json:"-"`
XXX_unrecognized
[]
byte
`json:"-"`
...
...
@@ -238,11 +237,11 @@ func (m *NormPut) XXX_DiscardUnknown() {
var
xxx_messageInfo_NormPut
proto
.
InternalMessageInfo
func
(
m
*
NormPut
)
GetKey
()
string
{
func
(
m
*
NormPut
)
GetKey
()
[]
byte
{
if
m
!=
nil
{
return
m
.
Key
}
return
""
return
nil
}
func
(
m
*
NormPut
)
GetValue
()
[]
byte
{
...
...
@@ -253,7 +252,7 @@ func (m *NormPut) GetValue() []byte {
}
type
NormGetKey
struct
{
Key
string
`protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
Key
[]
byte
`protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
XXX_NoUnkeyedLiteral
struct
{}
`json:"-"`
XXX_unrecognized
[]
byte
`json:"-"`
XXX_sizecache
int32
`json:"-"`
...
...
@@ -284,11 +283,11 @@ func (m *NormGetKey) XXX_DiscardUnknown() {
var
xxx_messageInfo_NormGetKey
proto
.
InternalMessageInfo
func
(
m
*
NormGetKey
)
GetKey
()
string
{
func
(
m
*
NormGetKey
)
GetKey
()
[]
byte
{
if
m
!=
nil
{
return
m
.
Key
}
return
""
return
nil
}
func
init
()
{
...
...
@@ -301,19 +300,19 @@ func init() {
func
init
()
{
proto
.
RegisterFile
(
"norm.proto"
,
fileDescriptor_4c505000707f0293
)
}
var
fileDescriptor_4c505000707f0293
=
[]
byte
{
// 2
11
bytes of a gzipped FileDescriptorProto
0x1f
,
0x8b
,
0x08
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x02
,
0xff
,
0x
6c
,
0x90
,
0xc1
,
0x4a
,
0xc6
,
0x30
,
0x
10
,
0x84
,
0x4d
,
0xda
,
0xfc
,
0xc5
,
0x55
,
0x8a
,
0x04
,
0x91
,
0x9c
,
0x4a
,
0x28
,
0x1e
,
0x72
,
0x2a
,
0x
a8
,
0x4f
,
0xa0
,
0x17
,
0x95
,
0x82
,
0x48
,
0xf0
,
0x05
,
0x6a
,
0x5d
,
0xa1
,
0x68
,
0x9b
,
0x12
,
0xb7
,
0x
42
,
0xde
,
0x5e
,
0x92
,
0x56
,
0x28
,
0xe8
,
0x2d
,
0x93
,
0x99
,
0x9d
,
0x6f
,
0x59
,
0x80
,
0xc9
,
0xf
9
,
0x
b1
,
0x99
,
0xbd
,
0x23
,
0x27
,
0x05
,
0x85
,
0x19
,
0xbf
,
0xea
,
0x77
,
0xc8
,
0x9f
,
0x9c
,
0x1f
,
0xe5
,
0x
05
,
0x1c
,
0xa2
,
0xf9
,
0xf8
,
0xa6
,
0x98
,
0x66
,
0xe6
,
0xd4
,
0x6e
,
0x4a
,
0x56
,
0x00
,
0xbd
,
0xc7
,
0x
8e
,
0xf0
,
0x65
,
0x18
,
0x51
,
0x71
,
0xcd
,
0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xff
,
0x32
,
0x24
,
0xd0
,
0x7e
,
0x23
,
0x01
,
0x00
,
0x00
,
}
plugin/dapp/paracross/types/paracross.pb.go
View file @
babaa782
...
...
@@ -6,11 +6,10 @@ package types
import
(
context
"context"
fmt
"fmt"
math
"math"
types
"github.com/33cn/chain33/types"
proto
"github.com/golang/protobuf/proto"
grpc
"google.golang.org/grpc"
math
"math"
)
// Reference imports to suppress errors if they are not otherwise used.
...
...
plugin/dapp/pokerbull/types/pokerbull.pb.go
View file @
babaa782
...
...
@@ -6,11 +6,10 @@ package types
import
(
context
"context"
fmt
"fmt"
math
"math"
types
"github.com/33cn/chain33/types"
proto
"github.com/golang/protobuf/proto"
grpc
"google.golang.org/grpc"
math
"math"
)
// Reference imports to suppress errors if they are not otherwise used.
...
...
plugin/dapp/privacy/types/privacy.pb.go
View file @
babaa782
...
...
@@ -6,11 +6,10 @@ package types
import
(
context
"context"
fmt
"fmt"
math
"math"
types
"github.com/33cn/chain33/types"
proto
"github.com/golang/protobuf/proto"
grpc
"google.golang.org/grpc"
math
"math"
)
// Reference imports to suppress errors if they are not otherwise used.
...
...
plugin/dapp/privacy/wallet/privacystore_test.go
View file @
babaa782
...
...
@@ -234,7 +234,7 @@ func testStore_listFrozenUTXOs(t *testing.T) {
txs
,
err
=
store
.
listFrozenUTXOs
(
token
,
addr
)
assert
.
NoError
(
t
,
err
)
assert
.
Equal
(
t
,
1
,
len
(
txs
))
assert
.
Equal
(
t
,
t
x
,
txs
[
0
]
)
assert
.
Equal
(
t
,
t
rue
,
proto
.
Equal
(
tx
,
txs
[
0
])
)
}
func
testStore_listAvailableUTXOs
(
t
*
testing
.
T
)
{
...
...
@@ -260,7 +260,7 @@ func testStore_listAvailableUTXOs(t *testing.T) {
utxos
,
err
=
store
.
listAvailableUTXOs
(
token
,
addr
)
assert
.
NoError
(
t
,
err
)
assert
.
Equal
(
t
,
1
,
len
(
utxos
))
assert
.
Equal
(
t
,
utxo
,
utxos
[
0
]
)
assert
.
Equal
(
t
,
true
,
proto
.
Equal
(
utxo
,
utxos
[
0
])
)
}
func
testStore_setWalletAccountPrivacy
(
t
*
testing
.
T
)
{
...
...
@@ -291,7 +291,7 @@ func testStore_getAccountByAddr(t *testing.T) {
assert
.
NoError
(
t
,
err
)
err
=
store
.
Set
(
calcAddrKey
(
addr
),
bt
)
was
,
err
=
store
.
getAccountByAddr
(
addr
)
assert
.
Equal
(
t
,
was
,
account
)
assert
.
Equal
(
t
,
true
,
proto
.
Equal
(
was
,
account
)
)
assert
.
NoError
(
t
,
err
)
}
...
...
@@ -325,7 +325,7 @@ func testStore_getAccountByPrefix(t *testing.T) {
assert
.
NoError
(
t
,
err
)
was
,
err
=
store
.
getAccountByAddr
(
addr
)
assert
.
NoError
(
t
,
err
)
assert
.
Equal
(
t
,
was
,
account
)
assert
.
Equal
(
t
,
true
,
proto
.
Equal
(
was
,
account
)
)
}
func
testStore_setVersion
(
t
*
testing
.
T
)
{
...
...
plugin/dapp/relay/executor/relaydb_test.go
View file @
babaa782
...
...
@@ -14,6 +14,7 @@ import (
"github.com/33cn/chain33/common/db/mocks"
"github.com/33cn/chain33/types"
ty
"github.com/33cn/plugin/plugin/dapp/relay/types"
"github.com/gogo/protobuf/proto"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/suite"
)
...
...
@@ -1197,8 +1198,10 @@ func (s *suiteSaveBtcHeader) TestSaveBtcHeader_1() {
s
.
Zero
(
log
.
LastBaseHeight
)
s
.
Equal
(
head2
.
Height
,
log
.
NewHeight
)
s
.
Zero
(
log
.
NewBaseHeight
)
s
.
Equal
(
headers
.
BtcHeader
,
log
.
Headers
)
s
.
Equal
(
len
(
headers
.
BtcHeader
),
len
(
log
.
Headers
))
for
i
,
h
:=
range
headers
.
BtcHeader
{
s
.
Equal
(
true
,
proto
.
Equal
(
h
,
log
.
Headers
[
i
]))
}
}
//not continuous
...
...
@@ -1325,8 +1328,10 @@ func (s *suiteSaveBtcHeader) TestSaveBtcHeader_4() {
s
.
Zero
(
log
.
LastBaseHeight
)
s
.
Equal
(
head5
.
Height
,
log
.
NewHeight
)
s
.
Equal
(
head4
.
Height
,
log
.
NewBaseHeight
)
s
.
Equal
(
headers
.
BtcHeader
,
log
.
Headers
)
s
.
Equal
(
len
(
headers
.
BtcHeader
),
len
(
log
.
Headers
))
for
i
,
h
:=
range
headers
.
BtcHeader
{
s
.
Equal
(
true
,
proto
.
Equal
(
h
,
log
.
Headers
[
i
]))
}
}
func
TestRunSuiteSaveBtcHeader
(
t
*
testing
.
T
)
{
...
...
plugin/dapp/relay/types/relay.pb.go
View file @
babaa782
...
...
@@ -5,9 +5,8 @@ package types
import
(
fmt
"fmt"
math
"math"
proto
"github.com/golang/protobuf/proto"
math
"math"
)
// Reference imports to suppress errors if they are not otherwise used.
...
...
plugin/dapp/retrieve/types/retrieve.pb.go
View file @
babaa782
...
...
@@ -6,11 +6,10 @@ package types
import
(
context
"context"
fmt
"fmt"
math
"math"
types
"github.com/33cn/chain33/types"
proto
"github.com/golang/protobuf/proto"
grpc
"google.golang.org/grpc"
math
"math"
)
// Reference imports to suppress errors if they are not otherwise used.
...
...
plugin/dapp/ticket/rpc/rpc_test.go
View file @
babaa782
...
...
@@ -148,7 +148,7 @@ func TestRPC_CallTestNode(t *testing.T) {
var
result
=
""
err
=
jsonClient
.
Call
(
"Chain33.Version"
,
nil
,
&
result
)
assert
.
Nil
(
t
,
err
)
assert
.
Equal
(
t
,
"
5.3.0
"
,
result
)
assert
.
Equal
(
t
,
"
6.0.1
"
,
result
)
var
isSnyc
bool
err
=
jsonClient
.
Call
(
"Chain33.IsSync"
,
&
types
.
ReqNil
{},
&
isSnyc
)
...
...
plugin/dapp/ticket/types/ticket.pb.go
View file @
babaa782
...
...
@@ -6,11 +6,10 @@ package types
import
(
context
"context"
fmt
"fmt"
math
"math"
types
"github.com/33cn/chain33/types"
proto
"github.com/golang/protobuf/proto"
grpc
"google.golang.org/grpc"
math
"math"
)
// Reference imports to suppress errors if they are not otherwise used.
...
...
plugin/dapp/ticket/types/types_test.go
View file @
babaa782
...
...
@@ -121,10 +121,8 @@ func TestProtoNewEncodeOldDecode(t *testing.T) {
told
:=
&
TicketMinerOld
{}
err
:=
types
.
Decode
(
data
,
told
)
assert
.
Nil
(
t
,
err
)
assert
.
Equal
(
t
,
&
TicketMinerOld
{
Bits
:
1
,
Reward
:
1
,
TicketId
:
"id"
,
Modify
:
[]
byte
(
"modify"
),
},
told
)
assert
.
Equal
(
t
,
told
.
Bits
,
uint32
(
1
))
assert
.
Equal
(
t
,
told
.
Reward
,
int64
(
1
))
assert
.
Equal
(
t
,
told
.
TicketId
,
"id"
)
assert
.
Equal
(
t
,
told
.
Modify
,
[]
byte
(
"modify"
))
}
plugin/dapp/token/types/token.pb.go
View file @
babaa782
...
...
@@ -6,11 +6,10 @@ package types
import
(
context
"context"
fmt
"fmt"
math
"math"
types
"github.com/33cn/chain33/types"
proto
"github.com/golang/protobuf/proto"
grpc
"google.golang.org/grpc"
math
"math"
)
// Reference imports to suppress errors if they are not otherwise used.
...
...
plugin/dapp/trade/types/trade.pb.go
View file @
babaa782
...
...
@@ -6,11 +6,10 @@ package types
import
(
context
"context"
fmt
"fmt"
math
"math"
types
"github.com/33cn/chain33/types"
proto
"github.com/golang/protobuf/proto"
grpc
"google.golang.org/grpc"
math
"math"
)
// Reference imports to suppress errors if they are not otherwise used.
...
...
plugin/dapp/valnode/types/tendermint.pb.go
View file @
babaa782
...
...
@@ -5,10 +5,9 @@ package types
import
(
fmt
"fmt"
math
"math"
types
"github.com/33cn/chain33/types"
proto
"github.com/golang/protobuf/proto"
math
"math"
)
// Reference imports to suppress errors if they are not otherwise used.
...
...
plugin/dapp/valnode/types/valnode.pb.go
View file @
babaa782
...
...
@@ -5,9 +5,8 @@ package types
import
(
fmt
"fmt"
math
"math"
proto
"github.com/golang/protobuf/proto"
math
"math"
)
// Reference imports to suppress errors if they are not otherwise used.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment