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
c3da2ad9
Commit
c3da2ad9
authored
Jan 19, 2019
by
张振华
Browse files
Options
Browse Files
Download
Plain Diff
merge master
parents
ef5b3f90
59703110
Show whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
183 additions
and
112 deletions
+183
-112
docker-compose.sh
build/docker-compose.sh
+4
-6
para.go
plugin/consensus/para/para.go
+33
-5
para_test.go
plugin/consensus/para/para_test.go
+18
-0
paracommitmsg_test.go
plugin/consensus/para/paracommitmsg_test.go
+1
-0
paratxrequest_test.go
plugin/consensus/para/paratxrequest_test.go
+1
-0
raftPerf.go
plugin/consensus/raft/tools/raftPerf.go
+1
-2
multisig.go
plugin/dapp/multisig/commands/multisig.go
+1
-1
query.go
plugin/dapp/multisig/executor/query.go
+1
-1
rpc_real_test.go
plugin/dapp/multisig/rpc/rpc_real_test.go
+1
-1
const.go
plugin/dapp/multisig/types/const.go
+1
-23
nginx.conf
plugin/dapp/paracross/cmd/build/nginx.conf
+2
-1
privacy.go
plugin/dapp/privacy/wallet/privacy.go
+3
-4
blockstore.go
vendor/github.com/33cn/chain33/blockchain/blockstore.go
+0
-2
chain_test.go
vendor/github.com/33cn/chain33/blockchain/chain_test.go
+10
-1
proc.go
vendor/github.com/33cn/chain33/blockchain/proc.go
+0
-2
process.go
vendor/github.com/33cn/chain33/blockchain/process.go
+16
-5
queueprotocol_test.go
vendor/github.com/33cn/chain33/client/queueprotocol_test.go
+1
-1
bty.go
vendor/github.com/33cn/chain33/system/dapp/commands/bty.go
+3
-3
utils.go
...thub.com/33cn/chain33/system/dapp/commands/types/utils.go
+1
-1
jsonpb.go
vendor/github.com/33cn/chain33/types/jsonpb/jsonpb.go
+22
-2
jsonpb_test.go
vendor/github.com/33cn/chain33/types/jsonpb/jsonpb_test.go
+3
-2
wallet.proto
vendor/github.com/33cn/chain33/types/proto/wallet.proto
+2
-2
types_test.go
vendor/github.com/33cn/chain33/types/types_test.go
+11
-0
wallet.pb.go
vendor/github.com/33cn/chain33/types/wallet.pb.go
+42
-42
healthcheck.go
vendor/github.com/33cn/chain33/util/healthcheck.go
+1
-1
wallet_proc.go
vendor/github.com/33cn/chain33/wallet/wallet_proc.go
+1
-1
wallet_test.go
vendor/github.com/33cn/chain33/wallet/wallet_test.go
+3
-3
No files found.
build/docker-compose.sh
View file @
c3da2ad9
...
@@ -247,19 +247,17 @@ function sync_status() {
...
@@ -247,19 +247,17 @@ function sync_status() {
while
[
$count
-gt
0
]
;
do
while
[
$count
-gt
0
]
;
do
sync_status
=
$(${
1
}
net is_sync
)
sync_status
=
$(${
1
}
net is_sync
)
if
[
"
${
sync_status
}
"
=
"true"
]
;
then
if
[
"
${
sync_status
}
"
=
"true"
]
;
then
echo
"=========== query clock sync status========== "
sync_status
=
$(${
1
}
net is_clock_sync
)
if
[
"
${
sync_status
}
"
=
"true"
]
;
then
break
break
fi
fi
fi
((
count--
))
((
count--
))
wait_sec
=
$((
wait_sec
+
1
))
wait_sec
=
$((
wait_sec
+
1
))
sleep
1
sleep
1
done
done
echo
"sync wait
${
wait_sec
}
s"
echo
"sync wait
${
wait_sec
}
s"
echo
"=========== query clock sync status========== "
sync_status
=
$(${
1
}
net is_clock_sync
)
if
[
"
${
sync_status
}
"
=
"false"
]
;
then
exit
1
fi
}
}
function
sync
()
{
function
sync
()
{
...
...
plugin/consensus/para/para.go
View file @
c3da2ad9
...
@@ -49,6 +49,7 @@ var (
...
@@ -49,6 +49,7 @@ var (
//current miner tx take any privatekey for unify all nodes sign purpose, and para chain is free
//current miner tx take any privatekey for unify all nodes sign purpose, and para chain is free
minerPrivateKey
=
"6da92a632ab7deb67d38c0f6560bcfed28167998f6496db64c258d5e8393a81b"
minerPrivateKey
=
"6da92a632ab7deb67d38c0f6560bcfed28167998f6496db64c258d5e8393a81b"
searchHashMatchDepth
int32
=
100
searchHashMatchDepth
int32
=
100
mainBlockHashForkHeight
int64
=
types
.
MaxHeight
//calc block hash fork height in main chain
)
)
func
init
()
{
func
init
()
{
...
@@ -176,6 +177,12 @@ func (client *client) SetQueueClient(c queue.Client) {
...
@@ -176,6 +177,12 @@ func (client *client) SetQueueClient(c queue.Client) {
}
}
func
(
client
*
client
)
InitBlock
()
{
func
(
client
*
client
)
InitBlock
()
{
var
err
error
mainBlockHashForkHeight
,
err
=
client
.
GetBlockHashForkHeightOnMainChain
()
if
err
!=
nil
{
panic
(
err
)
}
block
,
err
:=
client
.
RequestLastBlock
()
block
,
err
:=
client
.
RequestLastBlock
()
if
err
!=
nil
{
if
err
!=
nil
{
panic
(
err
)
panic
(
err
)
...
@@ -203,6 +210,7 @@ func (client *client) GetStartSeq(height int64) int64 {
...
@@ -203,6 +210,7 @@ func (client *client) GetStartSeq(height int64) int64 {
if
height
==
0
{
if
height
==
0
{
return
0
return
0
}
}
lastHeight
,
err
:=
client
.
GetLastHeightOnMainChain
()
lastHeight
,
err
:=
client
.
GetLastHeightOnMainChain
()
if
err
!=
nil
{
if
err
!=
nil
{
panic
(
err
)
panic
(
err
)
...
@@ -368,6 +376,16 @@ func (client *client) getLastBlockInfo() (int64, *types.Block, []byte, int64, er
...
@@ -368,6 +376,16 @@ func (client *client) getLastBlockInfo() (int64, *types.Block, []byte, int64, er
}
}
func
(
client
*
client
)
GetBlockHashForkHeightOnMainChain
()
(
int64
,
error
)
{
ret
,
err
:=
client
.
grpcClient
.
GetFork
(
context
.
Background
(),
&
types
.
ReqKey
{
Key
:
[]
byte
(
"ForkBlockHash"
)})
if
err
!=
nil
{
plog
.
Error
(
"para get rpc ForkBlockHash fail"
,
"err"
,
err
.
Error
())
return
-
1
,
err
}
return
ret
.
Data
,
nil
}
func
(
client
*
client
)
GetLastHeightOnMainChain
()
(
int64
,
error
)
{
func
(
client
*
client
)
GetLastHeightOnMainChain
()
(
int64
,
error
)
{
header
,
err
:=
client
.
grpcClient
.
GetLastHeader
(
context
.
Background
(),
&
types
.
ReqNil
{})
header
,
err
:=
client
.
grpcClient
.
GetLastHeader
(
context
.
Background
(),
&
types
.
ReqNil
{})
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -421,6 +439,14 @@ func (client *client) GetBlockOnMainBySeq(seq int64) (*types.BlockSeq, error) {
...
@@ -421,6 +439,14 @@ func (client *client) GetBlockOnMainBySeq(seq int64) (*types.BlockSeq, error) {
plog
.
Error
(
"Not found block on main"
,
"seq"
,
seq
)
plog
.
Error
(
"Not found block on main"
,
"seq"
,
seq
)
return
nil
,
err
return
nil
,
err
}
}
hash
:=
blockSeq
.
Detail
.
Block
.
HashByForkHeight
(
mainBlockHashForkHeight
)
if
!
bytes
.
Equal
(
blockSeq
.
Seq
.
Hash
,
hash
)
{
plog
.
Error
(
"para compare ForkBlockHash fail"
,
"forkHeight"
,
mainBlockHashForkHeight
,
"seqHash"
,
common
.
Bytes2Hex
(
blockSeq
.
Seq
.
Hash
),
"calcHash"
,
common
.
Bytes2Hex
(
hash
))
return
nil
,
types
.
ErrBlockHashNoMatch
}
return
blockSeq
,
nil
return
blockSeq
,
nil
}
}
...
@@ -505,6 +531,7 @@ func (client *client) switchHashMatchedBlock(currSeq int64) (int64, []byte, erro
...
@@ -505,6 +531,7 @@ func (client *client) switchHashMatchedBlock(currSeq int64) (int64, []byte, erro
if
err
!=
nil
{
if
err
!=
nil
{
return
-
2
,
nil
,
err
return
-
2
,
nil
,
err
}
}
//当前block结构已经有mainHash和MainHeight但是从blockchain获取的block还没有写入,以后如果获取到,可以替换从minerTx获取
miner
,
err
:=
getMinerTxInfo
(
block
)
miner
,
err
:=
getMinerTxInfo
(
block
)
if
err
!=
nil
{
if
err
!=
nil
{
return
-
2
,
nil
,
err
return
-
2
,
nil
,
err
...
@@ -684,19 +711,20 @@ func (client *client) addMinerTx(preStateHash []byte, block *types.Block, main *
...
@@ -684,19 +711,20 @@ func (client *client) addMinerTx(preStateHash []byte, block *types.Block, main *
func
(
client
*
client
)
createBlock
(
lastBlock
*
types
.
Block
,
txs
[]
*
types
.
Transaction
,
seq
int64
,
mainBlock
*
types
.
BlockSeq
)
error
{
func
(
client
*
client
)
createBlock
(
lastBlock
*
types
.
Block
,
txs
[]
*
types
.
Transaction
,
seq
int64
,
mainBlock
*
types
.
BlockSeq
)
error
{
var
newblock
types
.
Block
var
newblock
types
.
Block
plog
.
Debug
(
fmt
.
Sprintf
(
"the len txs is: %v"
,
len
(
txs
)))
plog
.
Debug
(
fmt
.
Sprintf
(
"the len txs is: %v"
,
len
(
txs
)))
newblock
.
ParentHash
=
lastBlock
.
Hash
()
newblock
.
ParentHash
=
lastBlock
.
Hash
()
newblock
.
Height
=
lastBlock
.
Height
+
1
newblock
.
Height
=
lastBlock
.
Height
+
1
newblock
.
Txs
=
txs
newblock
.
Txs
=
txs
err
:=
client
.
addMinerTx
(
lastBlock
.
StateHash
,
&
newblock
,
mainBlock
)
if
err
!=
nil
{
return
err
}
//挖矿固定难度
//挖矿固定难度
newblock
.
Difficulty
=
types
.
GetP
(
0
)
.
PowLimitBits
newblock
.
Difficulty
=
types
.
GetP
(
0
)
.
PowLimitBits
newblock
.
TxHash
=
merkle
.
CalcMerkleRoot
(
newblock
.
Txs
)
newblock
.
TxHash
=
merkle
.
CalcMerkleRoot
(
newblock
.
Txs
)
newblock
.
BlockTime
=
mainBlock
.
Detail
.
Block
.
BlockTime
newblock
.
BlockTime
=
mainBlock
.
Detail
.
Block
.
BlockTime
newblock
.
MainHash
=
mainBlock
.
Detail
.
Block
.
Hash
()
newblock
.
MainHash
=
mainBlock
.
Seq
.
Hash
newblock
.
MainHeight
=
mainBlock
.
Detail
.
Block
.
Height
newblock
.
MainHeight
=
mainBlock
.
Detail
.
Block
.
Height
err
:=
client
.
addMinerTx
(
lastBlock
.
StateHash
,
&
newblock
,
mainBlock
)
if
err
!=
nil
{
return
err
}
err
=
client
.
WriteBlock
(
lastBlock
.
StateHash
,
&
newblock
,
seq
)
err
=
client
.
WriteBlock
(
lastBlock
.
StateHash
,
&
newblock
,
seq
)
...
...
plugin/consensus/para/para_test.go
View file @
c3da2ad9
...
@@ -11,9 +11,13 @@ import (
...
@@ -11,9 +11,13 @@ import (
"testing"
"testing"
"time"
"time"
"errors"
"github.com/33cn/chain33/common/address"
"github.com/33cn/chain33/common/address"
"github.com/33cn/chain33/types"
"github.com/33cn/chain33/types"
typesmocks
"github.com/33cn/chain33/types/mocks"
pt
"github.com/33cn/plugin/plugin/dapp/paracross/types"
pt
"github.com/33cn/plugin/plugin/dapp/paracross/types"
"github.com/stretchr/testify/mock"
)
)
var
(
var
(
...
@@ -222,3 +226,17 @@ func createTxsGroup(txs []*types.Transaction) ([]*types.Transaction, error) {
...
@@ -222,3 +226,17 @@ func createTxsGroup(txs []*types.Transaction) ([]*types.Transaction, error) {
}
}
return
group
.
Txs
,
nil
return
group
.
Txs
,
nil
}
}
func
TestGetBlockHashForkHeightOnMainChain
(
t
*
testing
.
T
)
{
para
:=
new
(
client
)
grpcClient
:=
&
typesmocks
.
Chain33Client
{}
grpcClient
.
On
(
"GetFork"
,
mock
.
Anything
,
&
types
.
ReqKey
{
Key
:
[]
byte
(
"ForkBlockHash"
)})
.
Return
(
&
types
.
Int64
{
Data
:
1
},
errors
.
New
(
"err"
))
.
Once
()
para
.
grpcClient
=
grpcClient
_
,
err
:=
para
.
GetBlockHashForkHeightOnMainChain
()
assert
.
NotNil
(
t
,
err
)
grpcClient
.
On
(
"GetFork"
,
mock
.
Anything
,
&
types
.
ReqKey
{
Key
:
[]
byte
(
"ForkBlockHash"
)})
.
Return
(
&
types
.
Int64
{
Data
:
1
},
nil
)
.
Once
()
ret
,
err
:=
para
.
GetBlockHashForkHeightOnMainChain
()
assert
.
Nil
(
t
,
err
)
assert
.
Equal
(
t
,
int64
(
1
),
ret
)
}
plugin/consensus/para/paracommitmsg_test.go
View file @
c3da2ad9
...
@@ -75,6 +75,7 @@ func (s *suiteParaCommitMsg) initEnv(cfg *types.Config, sub *types.ConfigSubModu
...
@@ -75,6 +75,7 @@ func (s *suiteParaCommitMsg) initEnv(cfg *types.Config, sub *types.ConfigSubModu
s
.
para
=
New
(
cfg
.
Consensus
,
sub
.
Consensus
[
"para"
])
.
(
*
client
)
s
.
para
=
New
(
cfg
.
Consensus
,
sub
.
Consensus
[
"para"
])
.
(
*
client
)
s
.
grpcCli
=
&
typesmocks
.
Chain33Client
{}
s
.
grpcCli
=
&
typesmocks
.
Chain33Client
{}
s
.
grpcCli
.
On
(
"GetFork"
,
mock
.
Anything
,
&
types
.
ReqKey
{
Key
:
[]
byte
(
"ForkBlockHash"
)})
.
Return
(
&
types
.
Int64
{
Data
:
1
},
nil
)
.
Once
()
// GetBlockBySeq return error to stop create's for cycle to request tx
// GetBlockBySeq return error to stop create's for cycle to request tx
s
.
grpcCli
.
On
(
"GetBlockBySeq"
,
mock
.
Anything
,
mock
.
Anything
)
.
Return
(
nil
,
errors
.
New
(
"quit create"
))
s
.
grpcCli
.
On
(
"GetBlockBySeq"
,
mock
.
Anything
,
mock
.
Anything
)
.
Return
(
nil
,
errors
.
New
(
"quit create"
))
//data := &types.Int64{1}
//data := &types.Int64{1}
...
...
plugin/consensus/para/paratxrequest_test.go
View file @
c3da2ad9
...
@@ -66,6 +66,7 @@ func (s *suiteParaClient) initEnv(cfg *types.Config, sub *types.ConfigSubModule)
...
@@ -66,6 +66,7 @@ func (s *suiteParaClient) initEnv(cfg *types.Config, sub *types.ConfigSubModule)
s
.
para
=
New
(
cfg
.
Consensus
,
sub
.
Consensus
[
"para"
])
.
(
*
client
)
s
.
para
=
New
(
cfg
.
Consensus
,
sub
.
Consensus
[
"para"
])
.
(
*
client
)
s
.
grpcCli
=
&
typesmocks
.
Chain33Client
{}
s
.
grpcCli
=
&
typesmocks
.
Chain33Client
{}
s
.
grpcCli
.
On
(
"GetFork"
,
mock
.
Anything
,
&
types
.
ReqKey
{
Key
:
[]
byte
(
"ForkBlockHash"
)})
.
Return
(
&
types
.
Int64
{
Data
:
1
},
nil
)
.
Once
()
s
.
createBlockMock
()
s
.
createBlockMock
()
reply
:=
&
types
.
Reply
{
IsOk
:
true
}
reply
:=
&
types
.
Reply
{
IsOk
:
true
}
...
...
plugin/consensus/raft/tools/raftPerf.go
View file @
c3da2ad9
...
@@ -46,7 +46,6 @@ func createConn(ip string) {
...
@@ -46,7 +46,6 @@ func createConn(ip string) {
c
=
types
.
NewChain33Client
(
conn
)
c
=
types
.
NewChain33Client
(
conn
)
r
=
rand
.
New
(
rand
.
NewSource
(
types
.
Now
()
.
UnixNano
()))
r
=
rand
.
New
(
rand
.
NewSource
(
types
.
Now
()
.
UnixNano
()))
}
}
func
main
()
{
func
main
()
{
rlog
.
SetLogLevel
(
"eror"
)
rlog
.
SetLogLevel
(
"eror"
)
if
len
(
os
.
Args
)
==
1
||
os
.
Args
[
1
]
==
"-h"
{
if
len
(
os
.
Args
)
==
1
||
os
.
Args
[
1
]
==
"-h"
{
...
@@ -149,7 +148,7 @@ func SendToAddress(from string, to string, amount string, note string) {
...
@@ -149,7 +148,7 @@ func SendToAddress(from string, to string, amount string, note string) {
return
return
}
}
amountInt64
:=
int64
(
amountFloat64
*
1e4
)
amountInt64
:=
int64
(
amountFloat64
*
1e4
)
tx
:=
&
types
.
ReqWalletSendToAddress
{
From
:
from
,
To
:
to
,
Amount
:
amountInt64
*
1e4
,
Note
:
[]
byte
(
note
)
}
tx
:=
&
types
.
ReqWalletSendToAddress
{
From
:
from
,
To
:
to
,
Amount
:
amountInt64
*
1e4
,
Note
:
note
}
reply
,
err
:=
c
.
SendToAddress
(
context
.
Background
(),
tx
)
reply
,
err
:=
c
.
SendToAddress
(
context
.
Background
(),
tx
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
plugin/dapp/multisig/commands/multisig.go
View file @
c3da2ad9
...
@@ -699,7 +699,7 @@ func parseAccInfo(view interface{}) (interface{}, error) {
...
@@ -699,7 +699,7 @@ func parseAccInfo(view interface{}) (interface{}, error) {
for
_
,
dailyLimit
:=
range
res
.
DailyLimits
{
for
_
,
dailyLimit
:=
range
res
.
DailyLimits
{
dailyLimt
:=
strconv
.
FormatFloat
(
float64
(
dailyLimit
.
DailyLimit
)
/
float64
(
types
.
Coin
),
'f'
,
4
,
64
)
dailyLimt
:=
strconv
.
FormatFloat
(
float64
(
dailyLimit
.
DailyLimit
)
/
float64
(
types
.
Coin
),
'f'
,
4
,
64
)
spentToday
:=
strconv
.
FormatFloat
(
float64
(
dailyLimit
.
SpentToday
)
/
float64
(
types
.
Coin
),
'f'
,
4
,
64
)
spentToday
:=
strconv
.
FormatFloat
(
float64
(
dailyLimit
.
SpentToday
)
/
float64
(
types
.
Coin
),
'f'
,
4
,
64
)
fmt
.
Println
(
"parseAccInfo dailyLimt"
,
dailyLimt
)
dailyLimitResult
:=
&
mty
.
DailyLimitResult
{
dailyLimitResult
:=
&
mty
.
DailyLimitResult
{
Symbol
:
dailyLimit
.
Symbol
,
Symbol
:
dailyLimit
.
Symbol
,
Execer
:
dailyLimit
.
Execer
,
Execer
:
dailyLimit
.
Execer
,
...
...
plugin/dapp/multisig/executor/query.go
View file @
c3da2ad9
...
@@ -45,7 +45,7 @@ func (m *MultiSig) Query_MultiSigAccounts(in *mty.ReqMultiSigAccs) (types.Messag
...
@@ -45,7 +45,7 @@ func (m *MultiSig) Query_MultiSigAccounts(in *mty.ReqMultiSigAccs) (types.Messag
if
totalcount
==
0
{
if
totalcount
==
0
{
return
accountAddrs
,
nil
return
accountAddrs
,
nil
}
}
if
in
.
End
>
totalcount
{
if
in
.
End
>
=
totalcount
{
return
nil
,
types
.
ErrInvalidParam
return
nil
,
types
.
ErrInvalidParam
}
}
for
index
:=
in
.
Start
;
index
<=
in
.
End
;
index
++
{
for
index
:=
in
.
Start
;
index
<=
in
.
End
;
index
++
{
...
...
plugin/dapp/multisig/rpc/rpc_real_test.go
View file @
c3da2ad9
...
@@ -923,7 +923,7 @@ func testAbnormal(t *testing.T, mocker *testnode.Chain33Mock, jrpcClient *jsoncl
...
@@ -923,7 +923,7 @@ func testAbnormal(t *testing.T, mocker *testnode.Chain33Mock, jrpcClient *jsoncl
RequiredWeight
:
15
,
RequiredWeight
:
15
,
DailyLimit
:
symboldailylimit
,
DailyLimit
:
symboldailylimit
,
}
}
testAbnormalCreateTx
(
t
,
mocker
,
jrpcClient
,
req
,
mty
.
ErrInvalidSymbo
l
)
testAbnormalCreateTx
(
t
,
mocker
,
jrpcClient
,
req
,
ni
l
)
// Execer 错误
// Execer 错误
symboldailylimit
=
&
mty
.
SymbolDailyLimit
{
symboldailylimit
=
&
mty
.
SymbolDailyLimit
{
...
...
plugin/dapp/multisig/types/const.go
View file @
c3da2ad9
...
@@ -5,8 +5,6 @@
...
@@ -5,8 +5,6 @@
package
types
package
types
import
(
import
(
"strings"
"github.com/33cn/chain33/common/log/log15"
"github.com/33cn/chain33/common/log/log15"
"github.com/33cn/chain33/types"
"github.com/33cn/chain33/types"
)
)
...
@@ -125,26 +123,6 @@ func IsAssetsInvalid(exec, symbol string) error {
...
@@ -125,26 +123,6 @@ func IsAssetsInvalid(exec, symbol string) error {
multisiglog
.
Error
(
"IsAssetsInvalid"
,
"exec"
,
exec
)
multisiglog
.
Error
(
"IsAssetsInvalid"
,
"exec"
,
exec
)
return
ErrInvalidExec
return
ErrInvalidExec
}
}
//Symbol检测
//Symbol不做检测
symbolstr
:=
strings
.
Split
(
symbol
,
"."
)[
len
(
strings
.
Split
(
symbol
,
"."
))
-
1
]
valid
:=
validSymbol
([]
byte
(
symbolstr
))
if
!
valid
{
multisiglog
.
Error
(
"IsAssetsInvalid"
,
"symbol"
,
symbol
)
return
ErrInvalidSymbol
}
return
nil
return
nil
}
}
func
isUpperChar
(
a
byte
)
bool
{
res
:=
(
a
<=
'Z'
&&
a
>=
'A'
)
return
res
}
func
validSymbol
(
cs
[]
byte
)
bool
{
for
_
,
c
:=
range
cs
{
if
!
isUpperChar
(
c
)
{
return
false
}
}
return
true
}
plugin/dapp/paracross/cmd/build/nginx.conf
View file @
c3da2ad9
...
@@ -3,7 +3,8 @@ worker_processes 1;
...
@@ -3,7 +3,8 @@ worker_processes 1;
events
{
events
{
worker_connections
1024
;
#worker_connections 1024 may not enough
worker_connections
10240
;
}
}
...
...
plugin/dapp/privacy/wallet/privacy.go
View file @
c3da2ad9
...
@@ -82,7 +82,6 @@ func (policy *privacyPolicy) reqTxDetailByAddr(addr string) {
...
@@ -82,7 +82,6 @@ func (policy *privacyPolicy) reqTxDetailByAddr(addr string) {
return
return
}
}
txcount
:=
len
(
ReplyTxInfos
.
TxInfos
)
txcount
:=
len
(
ReplyTxInfos
.
TxInfos
)
var
ReqHashes
types
.
ReqHashes
var
ReqHashes
types
.
ReqHashes
ReqHashes
.
Hashes
=
make
([][]
byte
,
len
(
ReplyTxInfos
.
TxInfos
))
ReqHashes
.
Hashes
=
make
([][]
byte
,
len
(
ReplyTxInfos
.
TxInfos
))
for
index
,
ReplyTxInfo
:=
range
ReplyTxInfos
.
TxInfos
{
for
index
,
ReplyTxInfo
:=
range
ReplyTxInfos
.
TxInfos
{
...
@@ -592,7 +591,7 @@ func (policy *privacyPolicy) createPublic2PrivacyTx(req *types.ReqCreateTransact
...
@@ -592,7 +591,7 @@ func (policy *privacyPolicy) createPublic2PrivacyTx(req *types.ReqCreateTransact
value
:=
&
privacytypes
.
Public2Privacy
{
value
:=
&
privacytypes
.
Public2Privacy
{
Tokenname
:
req
.
Tokenname
,
Tokenname
:
req
.
Tokenname
,
Amount
:
amount
,
Amount
:
amount
,
Note
:
string
(
req
.
GetNote
()
),
Note
:
req
.
GetNote
(
),
Output
:
privacyOutput
,
Output
:
privacyOutput
,
}
}
...
@@ -662,7 +661,7 @@ func (policy *privacyPolicy) createPrivacy2PrivacyTx(req *types.ReqCreateTransac
...
@@ -662,7 +661,7 @@ func (policy *privacyPolicy) createPrivacy2PrivacyTx(req *types.ReqCreateTransac
value
:=
&
privacytypes
.
Privacy2Privacy
{
value
:=
&
privacytypes
.
Privacy2Privacy
{
Tokenname
:
req
.
GetTokenname
(),
Tokenname
:
req
.
GetTokenname
(),
Amount
:
req
.
GetAmount
(),
Amount
:
req
.
GetAmount
(),
Note
:
string
(
req
.
GetNote
()
),
Note
:
req
.
GetNote
(
),
Input
:
privacyInput
,
Input
:
privacyInput
,
Output
:
privacyOutput
,
Output
:
privacyOutput
,
}
}
...
@@ -731,7 +730,7 @@ func (policy *privacyPolicy) createPrivacy2PublicTx(req *types.ReqCreateTransact
...
@@ -731,7 +730,7 @@ func (policy *privacyPolicy) createPrivacy2PublicTx(req *types.ReqCreateTransact
value
:=
&
privacytypes
.
Privacy2Public
{
value
:=
&
privacytypes
.
Privacy2Public
{
Tokenname
:
req
.
GetTokenname
(),
Tokenname
:
req
.
GetTokenname
(),
Amount
:
req
.
GetAmount
(),
Amount
:
req
.
GetAmount
(),
Note
:
string
(
req
.
GetNote
()
),
Note
:
req
.
GetNote
(
),
Input
:
privacyInput
,
Input
:
privacyInput
,
Output
:
privacyOutput
,
Output
:
privacyOutput
,
}
}
...
...
vendor/github.com/33cn/chain33/blockchain/blockstore.go
View file @
c3da2ad9
...
@@ -1061,8 +1061,6 @@ func (bs *BlockStore) SetUpgradeMeta(meta *types.UpgradeMeta) error {
...
@@ -1061,8 +1061,6 @@ func (bs *BlockStore) SetUpgradeMeta(meta *types.UpgradeMeta) error {
//isRecordBlockSequence配置的合法性检测
//isRecordBlockSequence配置的合法性检测
func
(
bs
*
BlockStore
)
isRecordBlockSequenceValid
()
{
func
(
bs
*
BlockStore
)
isRecordBlockSequenceValid
()
{
storeLog
.
Error
(
"isRecordBlockSequenceValid"
)
lastHeight
:=
bs
.
Height
()
lastHeight
:=
bs
.
Height
()
lastSequence
,
err
:=
bs
.
LoadBlockLastSequence
()
lastSequence
,
err
:=
bs
.
LoadBlockLastSequence
()
if
err
!=
nil
{
if
err
!=
nil
{
...
...
vendor/github.com/33cn/chain33/blockchain/chain_test.go
View file @
c3da2ad9
...
@@ -119,6 +119,7 @@ func TestBlockChain(t *testing.T) {
...
@@ -119,6 +119,7 @@ func TestBlockChain(t *testing.T) {
testProcGetBlockBySeqMsg
(
t
,
mock33
,
blockchain
)
testProcGetBlockBySeqMsg
(
t
,
mock33
,
blockchain
)
testProcBlockChainFork
(
t
,
blockchain
)
testProcBlockChainFork
(
t
,
blockchain
)
testDelBlock
(
t
,
blockchain
,
curBlock
)
testDelBlock
(
t
,
blockchain
,
curBlock
)
testIsRecordFaultErr
(
t
)
}
}
...
@@ -501,7 +502,7 @@ func testGetBlocksMsg(t *testing.T, blockchain *blockchain.BlockChain) {
...
@@ -501,7 +502,7 @@ func testGetBlocksMsg(t *testing.T, blockchain *blockchain.BlockChain) {
if
err
==
nil
&&
blocks
!=
nil
{
if
err
==
nil
&&
blocks
!=
nil
{
for
_
,
block
:=
range
blocks
.
Items
{
for
_
,
block
:=
range
blocks
.
Items
{
if
checkheight
!=
block
.
Block
.
Height
||
block
.
Receipts
==
nil
{
if
checkheight
!=
block
.
Block
.
Height
||
block
.
Receipts
==
nil
{
t
.
Error
(
"
testGetBlocksMsg Block Height or Receipts check error"
)
t
.
Error
(
"
TestGetBlocksMsg"
,
"checkheight"
,
checkheight
,
"block"
,
block
)
}
}
checkheight
++
checkheight
++
}
}
...
@@ -955,3 +956,11 @@ func testAddBlockSeqCB(t *testing.T, blockchain *blockchain.BlockChain) {
...
@@ -955,3 +956,11 @@ func testAddBlockSeqCB(t *testing.T, blockchain *blockchain.BlockChain) {
}
}
chainlog
.
Info
(
"testAddBlockSeqCB end -------------------------"
)
chainlog
.
Info
(
"testAddBlockSeqCB end -------------------------"
)
}
}
func
testIsRecordFaultErr
(
t
*
testing
.
T
)
{
chainlog
.
Info
(
"testIsRecordFaultErr begin ---------------------"
)
isok
:=
blockchain
.
IsRecordFaultErr
(
types
.
ErrFutureBlock
)
if
isok
{
t
.
Error
(
"testIsRecordFaultErr IsRecordFaultErr"
,
"isok"
,
isok
)
}
chainlog
.
Info
(
"testIsRecordFaultErr begin ---------------------"
)
}
vendor/github.com/33cn/chain33/blockchain/proc.go
View file @
c3da2ad9
...
@@ -231,7 +231,6 @@ func (chain *BlockChain) addBlockDetail(msg queue.Message) {
...
@@ -231,7 +231,6 @@ func (chain *BlockChain) addBlockDetail(msg queue.Message) {
blockDetail
:=
msg
.
Data
.
(
*
types
.
BlockDetail
)
blockDetail
:=
msg
.
Data
.
(
*
types
.
BlockDetail
)
Height
:=
blockDetail
.
Block
.
Height
Height
:=
blockDetail
.
Block
.
Height
chainlog
.
Info
(
"EventAddBlockDetail"
,
"height"
,
blockDetail
.
Block
.
Height
,
"parent"
,
common
.
ToHex
(
blockDetail
.
Block
.
ParentHash
))
chainlog
.
Info
(
"EventAddBlockDetail"
,
"height"
,
blockDetail
.
Block
.
Height
,
"parent"
,
common
.
ToHex
(
blockDetail
.
Block
.
ParentHash
))
//首先判断共识过来的block的parenthash是否是当前bestchain链的tip区块,如果不是就直接返回错误给共识模块
blockDetail
,
err
:=
chain
.
ProcAddBlockMsg
(
true
,
blockDetail
,
"self"
)
blockDetail
,
err
:=
chain
.
ProcAddBlockMsg
(
true
,
blockDetail
,
"self"
)
if
err
!=
nil
{
if
err
!=
nil
{
chainlog
.
Error
(
"addBlockDetail"
,
"err"
,
err
.
Error
())
chainlog
.
Error
(
"addBlockDetail"
,
"err"
,
err
.
Error
())
...
@@ -244,7 +243,6 @@ func (chain *BlockChain) addBlockDetail(msg queue.Message) {
...
@@ -244,7 +243,6 @@ func (chain *BlockChain) addBlockDetail(msg queue.Message) {
msg
.
Reply
(
chain
.
client
.
NewMessage
(
"consensus"
,
types
.
EventAddBlockDetail
,
err
))
msg
.
Reply
(
chain
.
client
.
NewMessage
(
"consensus"
,
types
.
EventAddBlockDetail
,
err
))
return
return
}
}
//获取此高度区块执行后的区块详情blockdetail返回给共识模块
chainlog
.
Debug
(
"addBlockDetail success "
,
"Height"
,
Height
,
"hash"
,
common
.
HashHex
(
blockDetail
.
Block
.
Hash
()))
chainlog
.
Debug
(
"addBlockDetail success "
,
"Height"
,
Height
,
"hash"
,
common
.
HashHex
(
blockDetail
.
Block
.
Hash
()))
msg
.
Reply
(
chain
.
client
.
NewMessage
(
"consensus"
,
types
.
EventAddBlockDetail
,
blockDetail
))
msg
.
Reply
(
chain
.
client
.
NewMessage
(
"consensus"
,
types
.
EventAddBlockDetail
,
blockDetail
))
}
}
...
...
vendor/github.com/33cn/chain33/blockchain/process.go
View file @
c3da2ad9
...
@@ -10,6 +10,7 @@ import (
...
@@ -10,6 +10,7 @@ import (
"math/big"
"math/big"
"sync/atomic"
"sync/atomic"
"github.com/33cn/chain33/client/api"
"github.com/33cn/chain33/common"
"github.com/33cn/chain33/common"
"github.com/33cn/chain33/common/difficulty"
"github.com/33cn/chain33/common/difficulty"
"github.com/33cn/chain33/types"
"github.com/33cn/chain33/types"
...
@@ -296,14 +297,19 @@ func (b *BlockChain) connectBlock(node *blockNode, blockdetail *types.BlockDetai
...
@@ -296,14 +297,19 @@ func (b *BlockChain) connectBlock(node *blockNode, blockdetail *types.BlockDetai
block
:=
blockdetail
.
Block
block
:=
blockdetail
.
Block
prevStateHash
:=
b
.
bestChain
.
Tip
()
.
statehash
prevStateHash
:=
b
.
bestChain
.
Tip
()
.
statehash
//广播或者同步过来的blcok需要调用执行模块
errReturn
:=
(
node
.
pid
!=
"self"
)
errReturn
:=
(
node
.
pid
!=
"self"
)
//println("--exec before--")
blockdetail
,
_
,
err
=
execBlock
(
b
.
client
,
prevStateHash
,
block
,
errReturn
,
sync
)
blockdetail
,
_
,
err
=
execBlock
(
b
.
client
,
prevStateHash
,
block
,
errReturn
,
sync
)
//println("--exec end--")
if
err
!=
nil
{
if
err
!=
nil
&&
err
!=
types
.
ErrFutureBlock
{
//记录执行出错的block信息,需要过滤掉一些特殊的错误,不计入故障中,尝试再次执行
//记录执行出错的block信息,需要过滤掉ErrFutureBlock错误的block,不计入故障中,尝试再次执行
if
IsRecordFaultErr
(
err
)
{
b
.
RecordFaultPeer
(
node
.
pid
,
block
.
Height
,
node
.
hash
,
err
)
b
.
RecordFaultPeer
(
node
.
pid
,
block
.
Height
,
node
.
hash
,
err
)
}
else
if
node
.
pid
==
"self"
{
// 本节点产生的block由于api或者queue导致执行失败需要删除block在index中的记录,
// 返回错误信息给共识模块,由共识模块尝试再次发起block的执行
// 同步或者广播过来的情况会再下了一个区块过来后重新触发此block的执行
chainlog
.
Debug
(
"connectBlock DelNode!"
,
"height"
,
block
.
Height
,
"node.hash"
,
common
.
ToHex
(
node
.
hash
),
"err"
,
err
)
b
.
index
.
DelNode
(
node
.
hash
)
}
chainlog
.
Error
(
"connectBlock ExecBlock is err!"
,
"height"
,
block
.
Height
,
"err"
,
err
)
chainlog
.
Error
(
"connectBlock ExecBlock is err!"
,
"height"
,
block
.
Height
,
"err"
,
err
)
return
nil
,
err
return
nil
,
err
}
}
...
@@ -578,3 +584,8 @@ func (b *BlockChain) ProcessDelParaChainBlock(broadcast bool, blockdetail *types
...
@@ -578,3 +584,8 @@ func (b *BlockChain) ProcessDelParaChainBlock(broadcast bool, blockdetail *types
return
nil
,
true
,
false
,
nil
return
nil
,
true
,
false
,
nil
}
}
// IsRecordFaultErr 检测此错误是否要记录到故障错误中
func
IsRecordFaultErr
(
err
error
)
bool
{
return
err
!=
types
.
ErrFutureBlock
&&
!
api
.
IsGrpcError
(
err
)
&&
!
api
.
IsQueueError
(
err
)
}
vendor/github.com/33cn/chain33/client/queueprotocol_test.go
View file @
c3da2ad9
...
@@ -436,7 +436,7 @@ func testWalletSendToAddress(t *testing.T, api client.QueueProtocolAPI) {
...
@@ -436,7 +436,7 @@ func testWalletSendToAddress(t *testing.T, api client.QueueProtocolAPI) {
if
err
==
nil
{
if
err
==
nil
{
t
.
Error
(
"WalletSendToAddress(nil) need return error."
)
t
.
Error
(
"WalletSendToAddress(nil) need return error."
)
}
}
_
,
err
=
api
.
WalletSendToAddress
(
&
types
.
ReqWalletSendToAddress
{
Note
:
[]
byte
(
"case1"
)
})
_
,
err
=
api
.
WalletSendToAddress
(
&
types
.
ReqWalletSendToAddress
{
Note
:
"case1"
})
if
err
==
nil
{
if
err
==
nil
{
t
.
Error
(
"WalletSendToAddress(&types.ReqWalletSendToAddress{Note:
\"
case1
\"
}) need return error."
)
t
.
Error
(
"WalletSendToAddress(&types.ReqWalletSendToAddress{Note:
\"
case1
\"
}) need return error."
)
}
}
...
...
vendor/github.com/33cn/chain33/system/dapp/commands/bty.go
View file @
c3da2ad9
...
@@ -371,7 +371,7 @@ func createPub2PrivTx(cmd *cobra.Command, args []string) {
...
@@ -371,7 +371,7 @@ func createPub2PrivTx(cmd *cobra.Command, args []string) {
Tokenname
:
tokenname
,
Tokenname
:
tokenname
,
Type
:
types
.
PrivacyTypePublic2Privacy
,
Type
:
types
.
PrivacyTypePublic2Privacy
,
Amount
:
amount
,
Amount
:
amount
,
Note
:
[]
byte
(
note
)
,
Note
:
note
,
Pubkeypair
:
pubkeypair
,
Pubkeypair
:
pubkeypair
,
Expire
:
expire
,
Expire
:
expire
,
}
}
...
@@ -431,7 +431,7 @@ func createPriv2PrivTx(cmd *cobra.Command, args []string) {
...
@@ -431,7 +431,7 @@ func createPriv2PrivTx(cmd *cobra.Command, args []string) {
Tokenname
:
tokenname
,
Tokenname
:
tokenname
,
Type
:
types
.
PrivacyTypePrivacy2Privacy
,
Type
:
types
.
PrivacyTypePrivacy2Privacy
,
Amount
:
amount
,
Amount
:
amount
,
Note
:
[]
byte
(
note
)
,
Note
:
note
,
Pubkeypair
:
pubkeypair
,
Pubkeypair
:
pubkeypair
,
From
:
sender
,
From
:
sender
,
Mixcount
:
defaultPrivacyMixCount
,
Mixcount
:
defaultPrivacyMixCount
,
...
@@ -493,7 +493,7 @@ func createPriv2PubTx(cmd *cobra.Command, args []string) {
...
@@ -493,7 +493,7 @@ func createPriv2PubTx(cmd *cobra.Command, args []string) {
Tokenname
:
tokenname
,
Tokenname
:
tokenname
,
Type
:
types
.
PrivacyTypePrivacy2Public
,
Type
:
types
.
PrivacyTypePrivacy2Public
,
Amount
:
amount
,
Amount
:
amount
,
Note
:
[]
byte
(
note
)
,
Note
:
note
,
From
:
from
,
From
:
from
,
To
:
to
,
To
:
to
,
Mixcount
:
defaultPrivacyMixCount
,
Mixcount
:
defaultPrivacyMixCount
,
...
...
vendor/github.com/33cn/chain33/system/dapp/commands/types/utils.go
View file @
c3da2ad9
...
@@ -66,7 +66,7 @@ func SendToAddress(rpcAddr string, from string, to string, amount int64, note st
...
@@ -66,7 +66,7 @@ func SendToAddress(rpcAddr string, from string, to string, amount int64, note st
if
isWithdraw
{
if
isWithdraw
{
amt
=
-
amount
amt
=
-
amount
}
}
params
:=
types
.
ReqWalletSendToAddress
{
From
:
from
,
To
:
to
,
Amount
:
amt
,
Note
:
[]
byte
(
note
)
}
params
:=
types
.
ReqWalletSendToAddress
{
From
:
from
,
To
:
to
,
Amount
:
amt
,
Note
:
note
}
if
!
isToken
{
if
!
isToken
{
params
.
IsToken
=
false
params
.
IsToken
=
false
}
else
{
}
else
{
...
...
vendor/github.com/33cn/chain33/types/jsonpb/jsonpb.go
View file @
c3da2ad9
...
@@ -521,7 +521,11 @@ func (m *Marshaler) marshalValue(out *errWriter, prop *proto.Properties, v refle
...
@@ -521,7 +521,11 @@ func (m *Marshaler) marshalValue(out *errWriter, prop *proto.Properties, v refle
return
out
.
err
return
out
.
err
}
}
//[]byte
//[]byte 写bytes 的情况,默认情况下,转化成 hex
//为什么不用base64:
//1. 我们的数据都经过压缩(base64带来的字节数的减少有限)
//2. hex 是一种最容易解析的格式
//3. 我们的hash 默认是 bytes,而且转化成hex
if
v
.
Kind
()
==
reflect
.
Slice
&&
v
.
Type
()
.
Elem
()
.
Kind
()
==
reflect
.
Uint8
{
if
v
.
Kind
()
==
reflect
.
Slice
&&
v
.
Type
()
.
Elem
()
.
Kind
()
==
reflect
.
Uint8
{
if
v
.
IsNil
()
{
if
v
.
IsNil
()
{
out
.
write
(
"null"
)
out
.
write
(
"null"
)
...
@@ -1037,7 +1041,7 @@ func (u *Unmarshaler) unmarshalValue(target reflect.Value, inputValue json.RawMe
...
@@ -1037,7 +1041,7 @@ func (u *Unmarshaler) unmarshalValue(target reflect.Value, inputValue json.RawMe
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
b
,
err
:=
common
.
FromHex
(
hexstr
)
b
,
err
:=
parseBytes
(
hexstr
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
@@ -1309,3 +1313,19 @@ func checkRequiredFieldsInValue(v reflect.Value) error {
...
@@ -1309,3 +1313,19 @@ func checkRequiredFieldsInValue(v reflect.Value) error {
}
}
return
nil
return
nil
}
}
//ErrBytesFormat 错误的bytes 类型
var
ErrBytesFormat
=
errors
.
New
(
"ErrBytesFormat"
)
func
parseBytes
(
jsonstr
string
)
([]
byte
,
error
)
{
if
jsonstr
==
""
{
return
[]
byte
{},
nil
}
if
strings
.
HasPrefix
(
jsonstr
,
"str://"
)
{
return
[]
byte
(
jsonstr
[
len
(
"str://"
)
:
]),
nil
}
if
strings
.
HasPrefix
(
jsonstr
,
"0x"
)
||
strings
.
HasPrefix
(
jsonstr
,
"0X"
)
{
return
common
.
FromHex
(
jsonstr
)
}
return
nil
,
ErrBytesFormat
}
vendor/github.com/33cn/chain33/types/jsonpb/jsonpb_test.go
View file @
c3da2ad9
...
@@ -524,7 +524,6 @@ var marshalingTests = []struct {
...
@@ -524,7 +524,6 @@ var marshalingTests = []struct {
{
"BoolValue"
,
marshaler
,
&
pb
.
KnownTypes
{
Bool
:
&
wpb
.
BoolValue
{
Value
:
true
}},
`{"bool":true}`
},
{
"BoolValue"
,
marshaler
,
&
pb
.
KnownTypes
{
Bool
:
&
wpb
.
BoolValue
{
Value
:
true
}},
`{"bool":true}`
},
{
"StringValue"
,
marshaler
,
&
pb
.
KnownTypes
{
Str
:
&
wpb
.
StringValue
{
Value
:
"plush"
}},
`{"str":"plush"}`
},
{
"StringValue"
,
marshaler
,
&
pb
.
KnownTypes
{
Str
:
&
wpb
.
StringValue
{
Value
:
"plush"
}},
`{"str":"plush"}`
},
{
"BytesValue"
,
marshaler
,
&
pb
.
KnownTypes
{
Bytes
:
&
wpb
.
BytesValue
{
Value
:
[]
byte
(
"wow"
)}},
`{"bytes":"0x776f77"}`
},
{
"BytesValue"
,
marshaler
,
&
pb
.
KnownTypes
{
Bytes
:
&
wpb
.
BytesValue
{
Value
:
[]
byte
(
"wow"
)}},
`{"bytes":"0x776f77"}`
},
{
"required"
,
marshaler
,
&
pb
.
MsgWithRequired
{
Str
:
proto
.
String
(
"hello"
)},
`{"str":"hello"}`
},
{
"required"
,
marshaler
,
&
pb
.
MsgWithRequired
{
Str
:
proto
.
String
(
"hello"
)},
`{"str":"hello"}`
},
{
"required bytes"
,
marshaler
,
&
pb
.
MsgWithRequiredBytes
{
Byts
:
[]
byte
{}},
`{"byts":""}`
},
{
"required bytes"
,
marshaler
,
&
pb
.
MsgWithRequiredBytes
{
Byts
:
[]
byte
{}},
`{"byts":""}`
},
}
}
...
@@ -833,7 +832,9 @@ var unmarshalingTests = []struct {
...
@@ -833,7 +832,9 @@ var unmarshalingTests = []struct {
},
},
}},
}},
{
"BytesValue"
,
Unmarshaler
{},
`{"bytes":"0x776f77"}`
,
&
pb
.
KnownTypes
{
Bytes
:
&
wpb
.
BytesValue
{
Value
:
[]
byte
(
"wow"
)}}},
{
"BytesValue"
,
Unmarshaler
{},
`{"bytes":"0x776f77"}`
,
&
pb
.
KnownTypes
{
Bytes
:
&
wpb
.
BytesValue
{
Value
:
[]
byte
(
"wow"
)}}},
{
"BytesValue"
,
Unmarshaler
{},
`{"bytes":"0X776f77"}`
,
&
pb
.
KnownTypes
{
Bytes
:
&
wpb
.
BytesValue
{
Value
:
[]
byte
(
"wow"
)}}},
{
"BytesValue"
,
Unmarshaler
{},
`{"bytes":"str://wow"}`
,
&
pb
.
KnownTypes
{
Bytes
:
&
wpb
.
BytesValue
{
Value
:
[]
byte
(
"wow"
)}}},
{
"BytesValue"
,
Unmarshaler
{},
`{"bytes":"str://"}`
,
&
pb
.
KnownTypes
{
Bytes
:
&
wpb
.
BytesValue
{
Value
:
[]
byte
(
""
)}}},
// Ensure that `null` as a value ends up with a nil pointer instead of a [type]Value struct.
// Ensure that `null` as a value ends up with a nil pointer instead of a [type]Value struct.
{
"null DoubleValue"
,
Unmarshaler
{},
`{"dbl":null}`
,
&
pb
.
KnownTypes
{
Dbl
:
nil
}},
{
"null DoubleValue"
,
Unmarshaler
{},
`{"dbl":null}`
,
&
pb
.
KnownTypes
{
Dbl
:
nil
}},
{
"null FloatValue"
,
Unmarshaler
{},
`{"flt":null}`
,
&
pb
.
KnownTypes
{
Flt
:
nil
}},
{
"null FloatValue"
,
Unmarshaler
{},
`{"flt":null}`
,
&
pb
.
KnownTypes
{
Flt
:
nil
}},
...
...
vendor/github.com/33cn/chain33/types/proto/wallet.proto
View file @
c3da2ad9
...
@@ -147,7 +147,7 @@ message ReqWalletSendToAddress {
...
@@ -147,7 +147,7 @@ message ReqWalletSendToAddress {
string
from
=
1
;
string
from
=
1
;
string
to
=
2
;
string
to
=
2
;
int64
amount
=
3
;
int64
amount
=
3
;
bytes
note
=
4
;
string
note
=
4
;
bool
isToken
=
5
;
bool
isToken
=
5
;
string
tokenSymbol
=
6
;
string
tokenSymbol
=
6
;
}
}
...
@@ -234,7 +234,7 @@ message ReqCreateTransaction {
...
@@ -234,7 +234,7 @@ message ReqCreateTransaction {
// 3:隐私交易 隐私->公开
// 3:隐私交易 隐私->公开
int32
type
=
2
;
int32
type
=
2
;
int64
amount
=
3
;
int64
amount
=
3
;
bytes
note
=
4
;
string
note
=
4
;
// 普通交易的发送方
// 普通交易的发送方
string
from
=
5
;
string
from
=
5
;
// 普通交易的接收方
// 普通交易的接收方
...
...
vendor/github.com/33cn/chain33/types/types_test.go
View file @
c3da2ad9
...
@@ -124,9 +124,20 @@ func TestProtoToJson(t *testing.T) {
...
@@ -124,9 +124,20 @@ func TestProtoToJson(t *testing.T) {
assert
.
Equal
(
t
,
dr
.
Msg
,
[]
byte
(
"OK"
))
assert
.
Equal
(
t
,
dr
.
Msg
,
[]
byte
(
"OK"
))
err
=
jsonpb
.
UnmarshalString
(
`{"isOk":false,"msg":"4f4b"}`
,
&
dr
)
err
=
jsonpb
.
UnmarshalString
(
`{"isOk":false,"msg":"4f4b"}`
,
&
dr
)
assert
.
Equal
(
t
,
err
,
jsonpb
.
ErrBytesFormat
)
err
=
jsonpb
.
UnmarshalString
(
`{"isOk":false,"msg":"0x"}`
,
&
dr
)
assert
.
Nil
(
t
,
err
)
assert
.
Equal
(
t
,
dr
.
Msg
,
[]
byte
(
""
))
err
=
jsonpb
.
UnmarshalString
(
`{"isOk":false,"msg":"str://OK"}`
,
&
dr
)
assert
.
Nil
(
t
,
err
)
assert
.
Nil
(
t
,
err
)
assert
.
Equal
(
t
,
dr
.
Msg
,
[]
byte
(
"OK"
))
assert
.
Equal
(
t
,
dr
.
Msg
,
[]
byte
(
"OK"
))
err
=
jsonpb
.
UnmarshalString
(
`{"isOk":false,"msg":"str://0"}`
,
&
dr
)
assert
.
Nil
(
t
,
err
)
assert
.
Equal
(
t
,
dr
.
Msg
,
[]
byte
(
"0"
))
r
=
&
Reply
{
Msg
:
[]
byte
{}}
r
=
&
Reply
{
Msg
:
[]
byte
{}}
b
,
err
=
json
.
Marshal
(
r
)
b
,
err
=
json
.
Marshal
(
r
)
assert
.
Nil
(
t
,
err
)
assert
.
Nil
(
t
,
err
)
...
...
vendor/github.com/33cn/chain33/types/wallet.pb.go
View file @
c3da2ad9
...
@@ -884,7 +884,7 @@ type ReqWalletSendToAddress struct {
...
@@ -884,7 +884,7 @@ type ReqWalletSendToAddress struct {
From
string
`protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"`
From
string
`protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"`
To
string
`protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"`
To
string
`protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"`
Amount
int64
`protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"`
Amount
int64
`protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"`
Note
[]
byte
`protobuf:"bytes,4,opt,name=note,proto3" json:"note,omitempty"`
Note
string
`protobuf:"bytes,4,opt,name=note,proto3" json:"note,omitempty"`
IsToken
bool
`protobuf:"varint,5,opt,name=isToken,proto3" json:"isToken,omitempty"`
IsToken
bool
`protobuf:"varint,5,opt,name=isToken,proto3" json:"isToken,omitempty"`
TokenSymbol
string
`protobuf:"bytes,6,opt,name=tokenSymbol,proto3" json:"tokenSymbol,omitempty"`
TokenSymbol
string
`protobuf:"bytes,6,opt,name=tokenSymbol,proto3" json:"tokenSymbol,omitempty"`
XXX_NoUnkeyedLiteral
struct
{}
`json:"-"`
XXX_NoUnkeyedLiteral
struct
{}
`json:"-"`
...
@@ -938,11 +938,11 @@ func (m *ReqWalletSendToAddress) GetAmount() int64 {
...
@@ -938,11 +938,11 @@ func (m *ReqWalletSendToAddress) GetAmount() int64 {
return
0
return
0
}
}
func
(
m
*
ReqWalletSendToAddress
)
GetNote
()
[]
byte
{
func
(
m
*
ReqWalletSendToAddress
)
GetNote
()
string
{
if
m
!=
nil
{
if
m
!=
nil
{
return
m
.
Note
return
m
.
Note
}
}
return
nil
return
""
}
}
func
(
m
*
ReqWalletSendToAddress
)
GetIsToken
()
bool
{
func
(
m
*
ReqWalletSendToAddress
)
GetIsToken
()
bool
{
...
@@ -1594,7 +1594,7 @@ type ReqCreateTransaction struct {
...
@@ -1594,7 +1594,7 @@ type ReqCreateTransaction struct {
// 3:隐私交易 隐私->公开
// 3:隐私交易 隐私->公开
Type
int32
`protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"`
Type
int32
`protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"`
Amount
int64
`protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"`
Amount
int64
`protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"`
Note
[]
byte
`protobuf:"bytes,4,opt,name=note,proto3" json:"note,omitempty"`
Note
string
`protobuf:"bytes,4,opt,name=note,proto3" json:"note,omitempty"`
// 普通交易的发送方
// 普通交易的发送方
From
string
`protobuf:"bytes,5,opt,name=from,proto3" json:"from,omitempty"`
From
string
`protobuf:"bytes,5,opt,name=from,proto3" json:"from,omitempty"`
// 普通交易的接收方
// 普通交易的接收方
...
@@ -1654,11 +1654,11 @@ func (m *ReqCreateTransaction) GetAmount() int64 {
...
@@ -1654,11 +1654,11 @@ func (m *ReqCreateTransaction) GetAmount() int64 {
return
0
return
0
}
}
func
(
m
*
ReqCreateTransaction
)
GetNote
()
[]
byte
{
func
(
m
*
ReqCreateTransaction
)
GetNote
()
string
{
if
m
!=
nil
{
if
m
!=
nil
{
return
m
.
Note
return
m
.
Note
}
}
return
nil
return
""
}
}
func
(
m
*
ReqCreateTransaction
)
GetFrom
()
string
{
func
(
m
*
ReqCreateTransaction
)
GetFrom
()
string
{
...
@@ -1771,7 +1771,7 @@ func init() {
...
@@ -1771,7 +1771,7 @@ func init() {
func
init
()
{
proto
.
RegisterFile
(
"wallet.proto"
,
fileDescriptor_b88fd140af4deb6f
)
}
func
init
()
{
proto
.
RegisterFile
(
"wallet.proto"
,
fileDescriptor_b88fd140af4deb6f
)
}
var
fileDescriptor_b88fd140af4deb6f
=
[]
byte
{
var
fileDescriptor_b88fd140af4deb6f
=
[]
byte
{
// 130
5
bytes of a gzipped FileDescriptorProto
// 130
4
bytes of a gzipped FileDescriptorProto
0x1f
,
0x8b
,
0x08
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x02
,
0xff
,
0xa4
,
0x56
,
0x5f
,
0x6e
,
0x1b
,
0x37
,
0x1f
,
0x8b
,
0x08
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x02
,
0xff
,
0xa4
,
0x56
,
0x5f
,
0x6e
,
0x1b
,
0x37
,
0x13
,
0xc7
,
0x4a
,
0x96
,
0x6d
,
0xd1
,
0xb2
,
0x93
,
0x2c
,
0x92
,
0x40
,
0xf0
,
0xf7
,
0x25
,
0x71
,
0x58
,
0x13
,
0xc7
,
0x4a
,
0x96
,
0x6d
,
0xd1
,
0xb2
,
0x93
,
0x2c
,
0x92
,
0x40
,
0xf0
,
0xf7
,
0x25
,
0x71
,
0x58
,
0x24
,
0x75
,
0x81
,
0xc2
,
0x01
,
0xa2
,
0x97
,
0xa2
,
0x40
,
0x81
,
0x38
,
0x7f
,
0x1d
,
0xc0
,
0x49
,
0x0d
,
0x24
,
0x75
,
0x81
,
0xc2
,
0x01
,
0xa2
,
0x97
,
0xa2
,
0x40
,
0x81
,
0x38
,
0x7f
,
0x1d
,
0xc0
,
0x49
,
0x0d
,
...
@@ -1819,39 +1819,39 @@ var fileDescriptor_b88fd140af4deb6f = []byte{
...
@@ -1819,39 +1819,39 @@ var fileDescriptor_b88fd140af4deb6f = []byte{
0x36
,
0xf6
,
0xc2
,
0xbf
,
0xd9
,
0x2f
,
0x7c
,
0xcd
,
0xfc
,
0xf7
,
0xa8
,
0x66
,
0x6a
,
0x08
,
0x79
,
0x3a
,
0x36
,
0xf6
,
0xc2
,
0xbf
,
0xd9
,
0x2f
,
0x7c
,
0xcd
,
0xfc
,
0xf7
,
0xa8
,
0x66
,
0x6a
,
0x08
,
0x79
,
0x3a
,
0xd2
,
0xa7
,
0x69
,
0x6a
,
0xa0
,
0x2c
,
0x91
,
0x51
,
0xbc
,
0x62
,
0x60
,
0x14
,
0xd7
,
0xf1
,
0x01
,
0x6b
,
0xd2
,
0xa7
,
0x69
,
0x6a
,
0xa0
,
0x2c
,
0x91
,
0x51
,
0xbc
,
0x62
,
0x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f
,
0x12
,
0x3d
,
0x7f
,
0x36
,
0x18
,
0x24
,
0xf9
,
0x33
,
0x1a
,
0xf2
,
0x
f9
,
0x83
,
0xc1
,
0x33
,
0x9a
,
0x45
,
0xc6
,
0xdb
,
0x34
,
0xce
,
0x0f
,
0xfe
,
0x09
,
0x00
,
0x00
,
0xff
,
0x
07
,
0x83
,
0x67
,
0x34
,
0x8b
,
0x8c
,
0xb7
,
0x69
,
0x9c
,
0x1f
,
0xfc
,
0x13
,
0x00
,
0x00
,
0xff
,
0xff
,
0x
ff
,
0xab
,
0x59
,
0x52
,
0xd8
,
0x29
,
0x0c
,
0x00
,
0x00
,
0x
b9
,
0xa3
,
0x5d
,
0xe0
,
0x29
,
0x0c
,
0x00
,
0x00
,
}
}
vendor/github.com/33cn/chain33/util/healthcheck.go
View file @
c3da2ad9
...
@@ -17,7 +17,7 @@ import (
...
@@ -17,7 +17,7 @@ import (
)
)
var
(
var
(
listenAddr
=
"
localhost:8805"
listenAddr
=
"
:8805"
//as server, should keep default 0.0.0.0
unSyncMaxTimes
uint32
=
6
//max 6 times
unSyncMaxTimes
uint32
=
6
//max 6 times
checkInterval
uint32
=
5
// 5s
checkInterval
uint32
=
5
// 5s
)
)
...
...
vendor/github.com/33cn/chain33/wallet/wallet_proc.go
View file @
c3da2ad9
...
@@ -552,7 +552,7 @@ func (wallet *Wallet) ProcSendToAddress(SendToAddress *types.ReqWalletSendToAddr
...
@@ -552,7 +552,7 @@ func (wallet *Wallet) ProcSendToAddress(SendToAddress *types.ReqWalletSendToAddr
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
return
wallet
.
sendToAddress
(
priv
,
addrto
,
amount
,
string
(
note
)
,
SendToAddress
.
IsToken
,
SendToAddress
.
TokenSymbol
)
return
wallet
.
sendToAddress
(
priv
,
addrto
,
amount
,
note
,
SendToAddress
.
IsToken
,
SendToAddress
.
TokenSymbol
)
}
}
// ProcWalletSetFee 处理设置手续费
// ProcWalletSetFee 处理设置手续费
...
...
vendor/github.com/33cn/chain33/wallet/wallet_test.go
View file @
c3da2ad9
...
@@ -464,7 +464,7 @@ func testProcSendToAddress(t *testing.T, wallet *Wallet) {
...
@@ -464,7 +464,7 @@ func testProcSendToAddress(t *testing.T, wallet *Wallet) {
transfer
:=
&
types
.
ReqWalletSendToAddress
{
transfer
:=
&
types
.
ReqWalletSendToAddress
{
Amount
:
1000
,
Amount
:
1000
,
From
:
FromAddr
,
From
:
FromAddr
,
Note
:
[]
byte
(
"test"
)
,
Note
:
"test"
,
To
:
"1L1zEgVcjqdM2KkQixENd7SZTaudKkcyDu"
,
To
:
"1L1zEgVcjqdM2KkQixENd7SZTaudKkcyDu"
,
}
}
msg
:=
wallet
.
client
.
NewMessage
(
"wallet"
,
types
.
EventWalletSendToAddress
,
transfer
)
msg
:=
wallet
.
client
.
NewMessage
(
"wallet"
,
types
.
EventWalletSendToAddress
,
transfer
)
...
@@ -476,7 +476,7 @@ func testProcSendToAddress(t *testing.T, wallet *Wallet) {
...
@@ -476,7 +476,7 @@ func testProcSendToAddress(t *testing.T, wallet *Wallet) {
withdraw
:=
&
types
.
ReqWalletSendToAddress
{
withdraw
:=
&
types
.
ReqWalletSendToAddress
{
Amount
:
-
1000
,
Amount
:
-
1000
,
From
:
FromAddr
,
From
:
FromAddr
,
Note
:
[]
byte
(
"test"
)
,
Note
:
"test"
,
To
:
"16htvcBNSEA7fZhAdLJphDwQRQJaHpyHTp"
,
To
:
"16htvcBNSEA7fZhAdLJphDwQRQJaHpyHTp"
,
}
}
msg
=
wallet
.
client
.
NewMessage
(
"wallet"
,
types
.
EventWalletSendToAddress
,
withdraw
)
msg
=
wallet
.
client
.
NewMessage
(
"wallet"
,
types
.
EventWalletSendToAddress
,
withdraw
)
...
@@ -597,7 +597,7 @@ func testProcWalletLock(t *testing.T, wallet *Wallet) {
...
@@ -597,7 +597,7 @@ func testProcWalletLock(t *testing.T, wallet *Wallet) {
transfer
:=
&
types
.
ReqWalletSendToAddress
{
transfer
:=
&
types
.
ReqWalletSendToAddress
{
Amount
:
1000
,
Amount
:
1000
,
From
:
FromAddr
,
From
:
FromAddr
,
Note
:
[]
byte
(
"test"
)
,
Note
:
"test"
,
To
:
"1L1zEgVcjqdM2KkQixENd7SZTaudKkcyDu"
,
To
:
"1L1zEgVcjqdM2KkQixENd7SZTaudKkcyDu"
,
}
}
msg
=
wallet
.
client
.
NewMessage
(
"wallet"
,
types
.
EventWalletSendToAddress
,
transfer
)
msg
=
wallet
.
client
.
NewMessage
(
"wallet"
,
types
.
EventWalletSendToAddress
,
transfer
)
...
...
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