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
534501b3
Commit
534501b3
authored
Jan 23, 2019
by
vipwzw
Committed by
33cn
Jan 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 01/23
parent
968ea20c
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
47 additions
and
14 deletions
+47
-14
gitlab-ci-autotest.sh
...3cn/chain33/build/autotest/gitlabci/gitlab-ci-autotest.sh
+1
-1
jerkins-ci-autotest.sh
...n/chain33/build/autotest/jerkinsci/jerkins-ci-autotest.sh
+1
-1
local-autotest.sh
...b.com/33cn/chain33/build/autotest/local/local-autotest.sh
+1
-1
black_list.sh
vendor/github.com/33cn/chain33/build/util/black_list.sh
+2
-2
manage.sh
vendor/github.com/33cn/chain33/build/util/manage.sh
+1
-1
manage_list.sh
vendor/github.com/33cn/chain33/build/util/manage_list.sh
+2
-2
allow.go
vendor/github.com/33cn/chain33/executor/allow.go
+2
-2
executor_test.go
vendor/github.com/33cn/chain33/executor/executor_test.go
+2
-0
api_test.go
vendor/github.com/33cn/chain33/rpc/grpcclient/api_test.go
+31
-0
resolver.go
vendor/github.com/33cn/chain33/rpc/grpcclient/resolver.go
+1
-1
config.go
...ub.com/33cn/chain33/system/dapp/manage/commands/config.go
+3
-3
No files found.
vendor/github.com/33cn/chain33/build/autotest/gitlabci/gitlab-ci-autotest.sh
View file @
534501b3
...
...
@@ -214,7 +214,7 @@ function auto_test() {
fi
echo
"=========== #config token blacklist ============="
rawData
=
$(${
CLI
}
config config_tx
-
k
token-blacklist
-o
add
-v
BTC
)
rawData
=
$(${
CLI
}
config config_tx
-
c
token-blacklist
-o
add
-v
BTC
)
signData
=
$(${
CLI
}
wallet sign
-d
"
${
rawData
}
"
-k
0xc34b5d9d44ac7b754806f761d3d4d2c4fe5214f6b074c19f069c4f5c2a29c8cc
)
hash
=
$(${
CLI
}
wallet send
-d
"
${
signData
}
"
)
block_wait
"
${
CLI
}
"
2
...
...
vendor/github.com/33cn/chain33/build/autotest/jerkinsci/jerkins-ci-autotest.sh
View file @
534501b3
...
...
@@ -130,7 +130,7 @@ function start_chain33() {
fi
echo
"=========== #config token blacklist ============="
rawData
=
$(${
CLI
}
config config_tx
-
k
token-blacklist
-o
add
-v
BTC
)
rawData
=
$(${
CLI
}
config config_tx
-
c
token-blacklist
-o
add
-v
BTC
)
signData
=
$(${
CLI
}
wallet sign
-d
"
${
rawData
}
"
-k
0xc34b5d9d44ac7b754806f761d3d4d2c4fe5214f6b074c19f069c4f5c2a29c8cc
)
hash
=
$(${
CLI
}
wallet send
-d
"
${
signData
}
"
)
...
...
vendor/github.com/33cn/chain33/build/autotest/local/local-autotest.sh
View file @
534501b3
...
...
@@ -143,7 +143,7 @@ function start_chain33() {
fi
echo
"=========== #config token blacklist ============="
rawData
=
$(${
CLI
}
config config_tx
-
k
token-blacklist
-o
add
-v
BTC
)
rawData
=
$(${
CLI
}
config config_tx
-
c
token-blacklist
-o
add
-v
BTC
)
signData
=
$(${
CLI
}
wallet sign
-d
"
${
rawData
}
"
-k
0xc34b5d9d44ac7b754806f761d3d4d2c4fe5214f6b074c19f069c4f5c2a29c8cc
)
hash
=
$(${
CLI
}
wallet send
-d
"
${
signData
}
"
)
...
...
vendor/github.com/33cn/chain33/build/util/black_list.sh
View file @
534501b3
#!/usr/bin/env bash
guodun
=
"
$(
../chain33-cli config config_tx
-
k
token-blacklist
-o
add
-v
BTY
--paraName
"user.p.guodun."
)
"
fzmtest
=
"
$(
../chain33-cli config config_tx
-
k
token-blacklist
-o
add
-v
BTY
--paraName
"user.p.fzmtest."
)
"
guodun
=
"
$(
../chain33-cli config config_tx
-
c
token-blacklist
-o
add
-v
BTY
--paraName
"user.p.guodun."
)
"
fzmtest
=
"
$(
../chain33-cli config config_tx
-
c
token-blacklist
-o
add
-v
BTY
--paraName
"user.p.fzmtest."
)
"
echo
"cli wallet sign -d
$guodun
-a 1JmFaA6unrCFYEWPGRi7uuXY1KthTJxJEP -e 1h > d:/b.txt"
echo
"cli wallet sign -d
$fzmtest
-a 1JmFaA6unrCFYEWPGRi7uuXY1KthTJxJEP -e 1h >> d:/b.txt"
vendor/github.com/33cn/chain33/build/util/manage.sh
View file @
534501b3
#!/usr/bin/env bash
fzmtest
=
"
$(
../chain33-cli
--paraName
user.p.fzmtest. config config_tx
-
k
lottery-creator
-o
add
-v
15nn4D2ppUj8tmyHfdm8g4EvtqpBYUS7DM
)
"
fzmtest
=
"
$(
../chain33-cli
--paraName
user.p.fzmtest. config config_tx
-
c
lottery-creator
-o
add
-v
15nn4D2ppUj8tmyHfdm8g4EvtqpBYUS7DM
)
"
echo
"cli wallet sign -d
$fzmtest
-a 1JmFaA6unrCFYEWPGRi7uuXY1KthTJxJEP -e 1h >> d:/b.txt"
vendor/github.com/33cn/chain33/build/util/manage_list.sh
View file @
534501b3
#!/usr/bin/env bash
guodun1
=
$(
../chain33-cli config config_tx
-
k
token-blacklist
-o
add
-v
BTY
--paraName
"user.p.
$2
."
)
guodun2
=
$(
../chain33-cli config config_tx
-
k
token-finisher
-o
add
-v
"
$1
"
--paraName
"user.p.
$2
."
)
guodun1
=
$(
../chain33-cli config config_tx
-
c
token-blacklist
-o
add
-v
BTY
--paraName
"user.p.
$2
."
)
guodun2
=
$(
../chain33-cli config config_tx
-
c
token-finisher
-o
add
-v
"
$1
"
--paraName
"user.p.
$2
."
)
echo
"cli wallet sign -d
$guodun1
-a 1JmFaA6unrCFYEWPGRi7uuXY1KthTJxJEP -e 1h > d:/b.txt"
echo
"cli wallet sign -d
$guodun2
-a 1JmFaA6unrCFYEWPGRi7uuXY1KthTJxJEP -e 1h >> d:/b.txt"
vendor/github.com/33cn/chain33/executor/allow.go
View file @
534501b3
...
...
@@ -88,9 +88,9 @@ func isAllowLocalKey2(execer []byte, key []byte) error {
err
:=
errors
.
Wrapf
(
types
.
ErrLocalKeyLen
,
"isAllowLocalKey too short. key=%s exec=%s"
,
string
(
key
),
string
(
execer
))
return
err
}
if
key
[
minkeylen
-
1
]
!=
'-'
{
if
key
[
minkeylen
-
1
]
!=
'-'
||
key
[
len
(
types
.
LocalPrefix
)]
!=
'-'
{
err
:=
errors
.
Wrapf
(
types
.
ErrLocalPrefix
,
"isAllowLocalKey prefix last char is not '-'. key=%s exec=%s minkeylen=%d title=%s"
,
"isAllowLocalKey prefix last char
or separator
is not '-'. key=%s exec=%s minkeylen=%d title=%s"
,
string
(
key
),
string
(
execer
),
minkeylen
,
types
.
GetTitle
())
return
err
}
...
...
vendor/github.com/33cn/chain33/executor/executor_test.go
View file @
534501b3
...
...
@@ -130,6 +130,8 @@ func TestKeyAllow_evm(t *testing.T) {
func
TestKeyLocalAllow
(
t
*
testing
.
T
)
{
err
:=
isAllowLocalKey
([]
byte
(
"token"
),
[]
byte
(
"LODB-token-"
))
assert
.
Equal
(
t
,
err
,
types
.
ErrLocalKeyLen
)
err
=
isAllowLocalKey
([]
byte
(
"token"
),
[]
byte
(
"LODB_token-a"
))
assert
.
Equal
(
t
,
err
,
types
.
ErrLocalPrefix
)
err
=
isAllowLocalKey
([]
byte
(
"token"
),
[]
byte
(
"LODB-token-a"
))
assert
.
Nil
(
t
,
err
)
err
=
isAllowLocalKey
([]
byte
(
""
),
[]
byte
(
"LODB--a"
))
...
...
vendor/github.com/33cn/chain33/rpc/grpcclient/api_test.go
View file @
534501b3
...
...
@@ -46,6 +46,37 @@ func TestMultipleGRPC(t *testing.T) {
assert
.
Equal
(
t
,
reply
.
Hash
,
[]
byte
(
"hello"
))
}
func
TestMultipleGRPCLocalhost
(
t
*
testing
.
T
)
{
qapi
:=
new
(
mocks
.
QueueProtocolAPI
)
qapi
.
On
(
"Query"
,
"ticket"
,
"RandNumHash"
,
mock
.
Anything
)
.
Return
(
&
types
.
ReplyHash
{
Hash
:
[]
byte
(
"hello"
)},
nil
)
//testnode setup
rpcCfg
:=
new
(
types
.
RPC
)
rpcCfg
.
GrpcBindAddr
=
"localhost:8003"
rpcCfg
.
JrpcBindAddr
=
"localhost:8004"
rpcCfg
.
MainnetJrpcAddr
=
rpcCfg
.
JrpcBindAddr
rpcCfg
.
Whitelist
=
[]
string
{
"localhost"
,
"0.0.0.0"
}
rpcCfg
.
JrpcFuncWhitelist
=
[]
string
{
"*"
}
rpcCfg
.
GrpcFuncWhitelist
=
[]
string
{
"*"
}
rpc
.
InitCfg
(
rpcCfg
)
server
:=
rpc
.
NewGRpcServer
(
&
qmocks
.
Client
{},
qapi
)
assert
.
NotNil
(
t
,
server
)
go
server
.
Listen
()
time
.
Sleep
(
time
.
Second
)
//一个IP 有效,一个IP 无效
paraRemoteGrpcClient
:=
"localhost:8004,localhost:8003,localhost"
conn
,
err
:=
grpc
.
Dial
(
grpcclient
.
NewMultipleURL
(
paraRemoteGrpcClient
),
grpc
.
WithInsecure
())
assert
.
Nil
(
t
,
err
)
grpcClient
:=
types
.
NewChain33Client
(
conn
)
param
:=
&
types
.
ReqRandHash
{
ExecName
:
"ticket"
,
BlockNum
:
5
,
Hash
:
[]
byte
(
"hello"
),
}
reply
,
err
:=
grpcClient
.
QueryRandNum
(
context
.
Background
(),
param
)
assert
.
Nil
(
t
,
err
)
assert
.
Equal
(
t
,
reply
.
Hash
,
[]
byte
(
"hello"
))
}
func
TestNewParaClient
(
t
*
testing
.
T
)
{
qapi
:=
new
(
mocks
.
QueueProtocolAPI
)
qapi
.
On
(
"Query"
,
"ticket"
,
"RandNumHash"
,
mock
.
Anything
)
.
Return
(
&
types
.
ReplyHash
{
Hash
:
[]
byte
(
"hello"
)},
nil
)
...
...
vendor/github.com/33cn/chain33/rpc/grpcclient/resolver.go
View file @
534501b3
...
...
@@ -62,7 +62,7 @@ func (*multipleBuilder) Build(target resolver.Target, cc resolver.ClientConn, op
return
nil
,
err
}
if
net
.
ParseIP
(
host
)
!=
nil
{
if
host
!=
""
{
r
.
addrs
=
append
(
r
.
addrs
,
resolver
.
Address
{
Addr
:
host
+
":"
+
port
})
}
}
...
...
vendor/github.com/33cn/chain33/system/dapp/manage/commands/config.go
View file @
534501b3
...
...
@@ -47,8 +47,8 @@ func ConfigTxCmd() *cobra.Command {
}
func
addConfigTxFlags
(
cmd
*
cobra
.
Command
)
{
cmd
.
Flags
()
.
StringP
(
"
key"
,
"k"
,
""
,
"
key string"
)
cmd
.
MarkFlagRequired
(
"key"
)
cmd
.
Flags
()
.
StringP
(
"
config_key"
,
"c"
,
""
,
"config
key string"
)
cmd
.
MarkFlagRequired
(
"
config_
key"
)
cmd
.
Flags
()
.
StringP
(
"operation"
,
"o"
,
""
,
"adding or deletion operation"
)
cmd
.
MarkFlagRequired
(
"operation"
)
...
...
@@ -60,7 +60,7 @@ func addConfigTxFlags(cmd *cobra.Command) {
func
configTx
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
paraName
,
_
:=
cmd
.
Flags
()
.
GetString
(
"paraName"
)
key
,
_
:=
cmd
.
Flags
()
.
GetString
(
"key"
)
key
,
_
:=
cmd
.
Flags
()
.
GetString
(
"
config_
key"
)
op
,
_
:=
cmd
.
Flags
()
.
GetString
(
"operation"
)
opAddr
,
_
:=
cmd
.
Flags
()
.
GetString
(
"value"
)
...
...
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