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
ef9e3ebe
Commit
ef9e3ebe
authored
Jun 19, 2020
by
madengji
Committed by
33cn
Jun 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix ut cov
parent
ef673e64
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
1 deletion
+26
-1
bls_test.go
plugin/crypto/bls/bls_test.go
+15
-0
base.go
plugin/mempool/para/base.go
+2
-1
para_test.go
plugin/mempool/para/para_test.go
+9
-0
No files found.
plugin/crypto/bls/bls_test.go
View file @
ef9e3ebe
...
...
@@ -8,6 +8,8 @@ import (
"fmt"
"testing"
"github.com/33cn/chain33/common"
"github.com/33cn/chain33/common/crypto"
"github.com/stretchr/testify/assert"
)
...
...
@@ -46,6 +48,19 @@ func TestSignAndVerify(t *testing.T) {
assert
.
Equal
(
t
,
false
,
ret
)
}
func
TestPrivKeyFromBytes
(
t
*
testing
.
T
)
{
keybyte
,
_
:=
common
.
FromHex
(
"0xcacb1f5d51700aea07fca2246ab43b0917d70405c65edea9b5063d72eb5c6b71"
)
p
,
err
:=
blsDrv
.
PrivKeyFromBytes
(
keybyte
)
assert
.
Nil
(
t
,
p
)
assert
.
NotNil
(
t
,
err
)
keybyte
,
_
=
common
.
FromHex
(
"0x6da92a632ab7deb67d38c0f6560bcfed28167998f6496db64c258d5e8393a81b"
)
p
,
err
=
blsDrv
.
PrivKeyFromBytes
(
keybyte
)
assert
.
NotNil
(
t
,
p
)
assert
.
Nil
(
t
,
err
)
}
func
TestAggregate
(
t
*
testing
.
T
)
{
m
:=
[]
byte
(
"message to be signed. 将要做签名的消息"
)
n
:=
8
...
...
plugin/mempool/para/base.go
View file @
ef9e3ebe
...
...
@@ -51,7 +51,8 @@ func (mem *Mempool) SetQueueClient(client queue.Client) {
reply
,
err
=
mem
.
mainGrpcCli
.
GetProperFee
(
context
.
Background
(),
&
types
.
ReqProperFee
{})
case
types
.
EventGetMempoolSize
:
// 消息类型EventGetMempoolSize:获取mempool大小
msg
.
Reply
(
mem
.
client
.
NewMessage
(
"rpc"
,
types
.
EventMempoolSize
,
&
types
.
MempoolSize
{
Size
:
1000000
}))
size
:=
types
.
Conf
(
client
.
GetConfig
(),
"config.mempool"
)
.
GInt
(
"poolCacheSize"
)
msg
.
Reply
(
mem
.
client
.
NewMessage
(
"rpc"
,
types
.
EventMempoolSize
,
&
types
.
MempoolSize
{
Size
:
size
}))
continue
default
:
msg
.
Reply
(
client
.
NewMessage
(
mem
.
key
,
types
.
EventReply
,
types
.
ErrActionNotSupport
))
...
...
plugin/mempool/para/para_test.go
View file @
ef9e3ebe
...
...
@@ -47,4 +47,13 @@ func TestParaNodeMempool(t *testing.T) {
_
,
err
:=
mockpara
.
Para
.
GetAPI
()
.
GetMempool
(
&
types
.
ReqGetMempool
{})
assert
.
Equal
(
t
,
err
,
types
.
ErrActionNotSupport
)
t
.
Log
(
err
)
msg
:=
para
.
GetClient
()
.
NewMessage
(
"mempool"
,
types
.
EventGetMempoolSize
,
nil
)
para
.
GetClient
()
.
Send
(
msg
,
true
)
reply
,
err
:=
para
.
GetClient
()
.
Wait
(
msg
)
if
err
!=
nil
{
t
.
Error
(
err
)
return
}
t
.
Log
(
"TestGetMempoolSize "
,
reply
.
GetData
()
.
(
*
types
.
MempoolSize
)
.
Size
)
}
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