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
3b38b667
Commit
3b38b667
authored
Oct 22, 2019
by
liuyuhang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/mod_global_config' into mod_global_config
# Conflicts: # plugin/dapp/ticket/rpc/rpc.go # plugin/store/kvmvccmavl/kvmvccdb.go
parents
c47d8bf7
0a31cde3
Hide whitespace changes
Inline
Side-by-side
Showing
61 changed files
with
132 additions
and
130 deletions
+132
-130
para_test.go
plugin/consensus/para/para_test.go
+1
-1
parasync_test.go
plugin/consensus/para/parasync_test.go
+1
-1
paratxrequest_test.go
plugin/consensus/para/paratxrequest_test.go
+5
-6
ticket_test.go
plugin/consensus/ticket/ticket_test.go
+3
-3
proposal_board.go
plugin/dapp/autonomy/commands/proposal_board.go
+2
-1
proposal_change.go
plugin/dapp/autonomy/commands/proposal_change.go
+2
-1
proposal_project.go
plugin/dapp/autonomy/commands/proposal_project.go
+2
-1
proposal_rule.go
plugin/dapp/autonomy/commands/proposal_rule.go
+2
-1
autonomy.go
plugin/dapp/autonomy/executor/autonomy.go
+1
-1
board_test.go
plugin/dapp/autonomy/executor/board_test.go
+3
-3
boardaction_test.go
plugin/dapp/autonomy/executor/boardaction_test.go
+2
-2
action.go
plugin/dapp/blackwhite/executor/action.go
+1
-1
action_test.go
plugin/dapp/blackwhite/executor/action_test.go
+3
-3
authority_test.go
plugin/dapp/cert/authority/authority_test.go
+0
-1
echo.go
plugin/dapp/echo/executor/echo.go
+0
-2
evm_test.go
plugin/dapp/evm/executor/tests/evm_test.go
+2
-2
util_test.go
plugin/dapp/evm/executor/tests/util_test.go
+5
-4
interface.go
plugin/dapp/evm/executor/vm/state/interface.go
+1
-1
statedb.go
plugin/dapp/evm/executor/vm/state/statedb.go
+2
-3
game_test.go
plugin/dapp/game/executor/game_test.go
+2
-2
gamedb.go
plugin/dapp/game/executor/gamedb.go
+1
-1
types_test.go
plugin/dapp/game/types/types_test.go
+1
-1
hashlock_unit_test.go
plugin/dapp/hashlock/executor/hashlock_unit_test.go
+2
-2
hashlockdb.go
plugin/dapp/hashlock/executor/hashlockdb.go
+1
-1
jsvm_test.go
plugin/dapp/js/executor/jsvm_test.go
+1
-1
lottery_test.go
plugin/dapp/lottery/executor/lottery_test.go
+12
-12
lotterydb.go
plugin/dapp/lottery/executor/lotterydb.go
+1
-1
lottery.go
plugin/dapp/lottery/types/lottery.go
+1
-2
exec_test.go
plugin/dapp/multisig/executor/exec_test.go
+1
-1
multisig.go
plugin/dapp/multisig/executor/multisig.go
+0
-1
oracle.go
plugin/dapp/oracle/executor/oracle.go
+0
-1
assettransfer_test.go
plugin/dapp/paracross/executor/assettransfer_test.go
+1
-1
paracross_test.go
plugin/dapp/paracross/executor/paracross_test.go
+5
-4
superaccount.go
plugin/dapp/paracross/executor/superaccount.go
+0
-1
rpc_test.go
plugin/dapp/paracross/rpc/rpc_test.go
+1
-1
type.go
plugin/dapp/paracross/types/type.go
+0
-1
pokerbull_test.go
plugin/dapp/pokerbull/executor/pokerbull_test.go
+2
-2
ring_signature_test.go
plugin/dapp/privacy/crypto/ring_signature_test.go
+4
-4
privacy_test.go
plugin/dapp/privacy/wallet/privacy_test.go
+7
-5
main.go
plugin/dapp/relay/cmd/relayd/main.go
+3
-3
relay.go
plugin/dapp/relay/executor/relay.go
+0
-1
relay_test.go
plugin/dapp/relay/executor/relay_test.go
+1
-1
relaydb.go
plugin/dapp/relay/executor/relaydb.go
+1
-1
relaydb_test.go
plugin/dapp/relay/executor/relaydb_test.go
+1
-1
retrieve_unit_test.go
plugin/dapp/retrieve/executor/retrieve_unit_test.go
+5
-5
retrievedb.go
plugin/dapp/retrieve/executor/retrievedb.go
+1
-1
ticketdb.go
plugin/dapp/ticket/executor/ticketdb.go
+1
-1
rpc.go
plugin/dapp/ticket/rpc/rpc.go
+1
-1
rpc_real_test.go
plugin/dapp/ticket/rpc/rpc_real_test.go
+2
-2
token_new_test.go
plugin/dapp/token/executor/token_new_test.go
+3
-2
token_test.go
plugin/dapp/token/executor/token_test.go
+4
-2
tokendb.go
plugin/dapp/token/executor/tokendb.go
+1
-1
exec_test.go
plugin/dapp/trade/executor/exec_test.go
+4
-3
tradedb.go
plugin/dapp/trade/executor/tradedb.go
+0
-1
rpc_test.go
plugin/dapp/trade/rpc/rpc_test.go
+1
-1
trade_test.go
plugin/dapp/trade/types/trade_test.go
+1
-1
exec_test.go
plugin/dapp/unfreeze/executor/exec_test.go
+4
-3
rpc_test.go
plugin/dapp/valnode/rpc/rpc_test.go
+5
-4
base.go
plugin/mempool/para/base.go
+2
-2
kvmvcc_mavl_test.go
plugin/store/kvmvccmavl/kvmvcc_mavl_test.go
+2
-2
kvmvccdb.go
plugin/store/kvmvccmavl/kvmvccdb.go
+8
-8
No files found.
plugin/consensus/para/para_test.go
View file @
3b38b667
...
...
@@ -172,7 +172,7 @@ func TestAddMinerTx(t *testing.T) {
api
:=
new
(
apimocks
.
QueueProtocolAPI
)
api
.
On
(
"GetConfig"
,
mock
.
Anything
)
.
Return
(
cfg
,
nil
)
para
:=
&
client
{
BaseClient
:&
drivers
.
BaseClient
{}}
para
:=
&
client
{
BaseClient
:
&
drivers
.
BaseClient
{}}
para
.
SetAPI
(
api
)
para
.
subCfg
=
new
(
subConfig
)
para
.
privateKey
=
priKey
...
...
plugin/consensus/para/parasync_test.go
View file @
3b38b667
...
...
@@ -16,10 +16,10 @@ import (
"github.com/33cn/chain33/queue"
typesmocks
"github.com/33cn/chain33/types/mocks"
"github.com/33cn/plugin/plugin/dapp/paracross/testnode"
pt
"github.com/33cn/plugin/plugin/dapp/paracross/types"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"github.com/33cn/plugin/plugin/dapp/paracross/testnode"
)
const
(
...
...
plugin/consensus/para/paratxrequest_test.go
View file @
3b38b667
...
...
@@ -16,12 +16,12 @@ import (
apimocks
"github.com/33cn/chain33/client/mocks"
_
"github.com/33cn/chain33/system"
drivers
"github.com/33cn/chain33/system/consensus"
"github.com/33cn/chain33/types"
typesmocks
"github.com/33cn/chain33/types/mocks"
"github.com/33cn/plugin/plugin/dapp/paracross/testnode"
pt
"github.com/33cn/plugin/plugin/dapp/paracross/types"
"github.com/stretchr/testify/assert"
drivers
"github.com/33cn/chain33/system/consensus"
"github.com/33cn/plugin/plugin/dapp/paracross/testnode"
)
func
init
()
{
...
...
@@ -45,7 +45,7 @@ func TestCalcCommitMsgTxs(t *testing.T) {
cfg
:=
types
.
NewChain33Config
(
testnode
.
DefaultConfig
)
api
:=
new
(
apimocks
.
QueueProtocolAPI
)
api
.
On
(
"GetConfig"
,
mock
.
Anything
)
.
Return
(
cfg
,
nil
)
para
:=
&
client
{
BaseClient
:&
drivers
.
BaseClient
{}}
para
:=
&
client
{
BaseClient
:
&
drivers
.
BaseClient
{}}
para
.
SetAPI
(
api
)
para
.
subCfg
=
new
(
subConfig
)
...
...
@@ -87,8 +87,7 @@ func TestGetConsensusStatus(t *testing.T) {
api
:=
new
(
apimocks
.
QueueProtocolAPI
)
api
.
On
(
"GetConfig"
,
mock
.
Anything
)
.
Return
(
chain33Cfg
,
nil
)
para
:=
&
client
{
BaseClient
:&
drivers
.
BaseClient
{}}
para
:=
&
client
{
BaseClient
:
&
drivers
.
BaseClient
{}}
para
.
subCfg
=
new
(
subConfig
)
grpcClient
:=
&
typesmocks
.
Chain33Client
{}
...
...
@@ -127,7 +126,7 @@ func TestSendCommitMsg(t *testing.T) {
cfg
:=
types
.
NewChain33Config
(
testnode
.
DefaultConfig
)
api
:=
new
(
apimocks
.
QueueProtocolAPI
)
api
.
On
(
"GetConfig"
,
mock
.
Anything
)
.
Return
(
cfg
,
nil
)
para
:=
&
client
{
BaseClient
:&
drivers
.
BaseClient
{}}
para
:=
&
client
{
BaseClient
:
&
drivers
.
BaseClient
{}}
para
.
SetAPI
(
api
)
grpcClient
:=
&
typesmocks
.
Chain33Client
{}
...
...
plugin/consensus/ticket/ticket_test.go
View file @
3b38b667
...
...
@@ -21,12 +21,12 @@ import (
secp256k1
"github.com/btcsuite/btcd/btcec"
"github.com/stretchr/testify/assert"
apimocks
"github.com/33cn/chain33/client/mocks"
_
"github.com/33cn/chain33/system"
drivers
"github.com/33cn/chain33/system/consensus"
_
"github.com/33cn/plugin/plugin/dapp/init"
_
"github.com/33cn/plugin/plugin/store/init"
"github.com/stretchr/testify/mock"
apimocks
"github.com/33cn/chain33/client/mocks"
drivers
"github.com/33cn/chain33/system/consensus"
)
func
TestTicket
(
t
*
testing
.
T
)
{
...
...
@@ -176,7 +176,7 @@ func Test_getNextRequiredDifficulty(t *testing.T) {
api
:=
new
(
apimocks
.
QueueProtocolAPI
)
api
.
On
(
"GetConfig"
,
mock
.
Anything
)
.
Return
(
cfg
,
nil
)
c
:=
&
Client
{
BaseClient
:&
drivers
.
BaseClient
{}}
c
:=
&
Client
{
BaseClient
:
&
drivers
.
BaseClient
{}}
c
.
SetAPI
(
api
)
bits
,
bt
,
err
:=
c
.
getNextRequiredDifficulty
(
nil
,
1
)
...
...
plugin/dapp/autonomy/commands/proposal_board.go
View file @
3b38b667
...
...
@@ -9,12 +9,13 @@ import (
"encoding/json"
"fmt"
jsonrpc
"github.com/33cn/chain33/rpc/jsonclient"
rpctypes
"github.com/33cn/chain33/rpc/types"
"github.com/33cn/chain33/types"
auty
"github.com/33cn/plugin/plugin/dapp/autonomy/types"
"github.com/spf13/cobra"
"fmt"
)
// AutonomyCmd 自治系统命令行
...
...
plugin/dapp/autonomy/commands/proposal_change.go
View file @
3b38b667
...
...
@@ -9,12 +9,13 @@ import (
"encoding/json"
"fmt"
jsonrpc
"github.com/33cn/chain33/rpc/jsonclient"
rpctypes
"github.com/33cn/chain33/rpc/types"
"github.com/33cn/chain33/types"
auty
"github.com/33cn/plugin/plugin/dapp/autonomy/types"
"github.com/spf13/cobra"
"fmt"
)
// ProposalChangeCmd 创建提案命令
...
...
plugin/dapp/autonomy/commands/proposal_project.go
View file @
3b38b667
...
...
@@ -9,12 +9,13 @@ import (
"strings"
"fmt"
jsonrpc
"github.com/33cn/chain33/rpc/jsonclient"
rpctypes
"github.com/33cn/chain33/rpc/types"
"github.com/33cn/chain33/types"
auty
"github.com/33cn/plugin/plugin/dapp/autonomy/types"
"github.com/spf13/cobra"
"fmt"
)
// ProposalProjectCmd 创建提案命令
...
...
plugin/dapp/autonomy/commands/proposal_rule.go
View file @
3b38b667
...
...
@@ -9,12 +9,13 @@ import (
"strings"
"fmt"
jsonrpc
"github.com/33cn/chain33/rpc/jsonclient"
rpctypes
"github.com/33cn/chain33/rpc/types"
"github.com/33cn/chain33/types"
auty
"github.com/33cn/plugin/plugin/dapp/autonomy/types"
"github.com/spf13/cobra"
"fmt"
)
// ProposalRuleCmd 创建提案命令
...
...
plugin/dapp/autonomy/executor/autonomy.go
View file @
3b38b667
...
...
@@ -21,7 +21,7 @@ var (
alog
=
log
.
New
(
"module"
,
"execs.autonomy"
)
driverName
=
auty
.
AutonomyX
autonomyAddr
=
address
.
ExecAddress
(
auty
.
AutonomyX
)
subcfg
subConfig
subcfg
subConfig
)
// Init 重命名执行器名称
...
...
plugin/dapp/autonomy/executor/board_test.go
View file @
3b38b667
...
...
@@ -7,19 +7,19 @@ package executor
import
(
"testing"
"github.com/33cn/chain33/client"
"github.com/33cn/chain33/common/db"
"github.com/33cn/chain33/queue"
"github.com/33cn/chain33/system/dapp"
"github.com/33cn/chain33/types"
"github.com/33cn/chain33/util"
auty
"github.com/33cn/plugin/plugin/dapp/autonomy/types"
"github.com/stretchr/testify/assert"
"github.com/33cn/chain33/client"
"github.com/33cn/chain33/queue"
)
var
chainTestCfg
=
types
.
NewChain33Config
(
types
.
GetDefaultCfgstring
())
func
newTestAutonomy
()
*
Autonomy
{
func
newTestAutonomy
()
*
Autonomy
{
au
:=
&
Autonomy
{
dapp
.
DriverBase
{},
}
...
...
plugin/dapp/autonomy/executor/boardaction_test.go
View file @
3b38b667
...
...
@@ -8,12 +8,14 @@ import (
"testing"
"github.com/33cn/chain33/account"
"github.com/33cn/chain33/client"
apimock
"github.com/33cn/chain33/client/mocks"
"github.com/33cn/chain33/common"
"github.com/33cn/chain33/common/crypto"
dbm
"github.com/33cn/chain33/common/db"
dbmock
"github.com/33cn/chain33/common/db/mocks"
commonlog
"github.com/33cn/chain33/common/log"
"github.com/33cn/chain33/queue"
_
"github.com/33cn/chain33/system"
drivers
"github.com/33cn/chain33/system/dapp"
"github.com/33cn/chain33/types"
...
...
@@ -23,8 +25,6 @@ import (
ticketTy
"github.com/33cn/plugin/plugin/dapp/ticket/types"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/33cn/chain33/queue"
"github.com/33cn/chain33/client"
)
// ExecEnv exec environment
...
...
plugin/dapp/blackwhite/executor/action.go
View file @
3b38b667
...
...
@@ -11,12 +11,12 @@ import (
"strconv"
"github.com/33cn/chain33/account"
"github.com/33cn/chain33/client"
"github.com/33cn/chain33/common"
dbm
"github.com/33cn/chain33/common/db"
"github.com/33cn/chain33/system/dapp"
"github.com/33cn/chain33/types"
gt
"github.com/33cn/plugin/plugin/dapp/blackwhite/types"
"github.com/33cn/chain33/client"
)
const
(
...
...
plugin/dapp/blackwhite/executor/action_test.go
View file @
3b38b667
...
...
@@ -11,15 +11,15 @@ import (
"fmt"
"strconv"
"github.com/33cn/chain33/client"
"github.com/33cn/chain33/common"
"github.com/33cn/chain33/queue"
"github.com/33cn/chain33/types"
gt
"github.com/33cn/plugin/plugin/dapp/blackwhite/types"
"github.com/stretchr/testify/require"
"github.com/33cn/chain33/queue"
"github.com/33cn/chain33/client"
)
func
newTestAction
()
*
action
{
func
newTestAction
()
*
action
{
cfg
:=
types
.
NewChain33Config
(
types
.
GetDefaultCfgstring
())
au
:=
&
action
{}
q
:=
queue
.
New
(
"channel"
)
...
...
plugin/dapp/cert/authority/authority_test.go
View file @
3b38b667
...
...
@@ -204,7 +204,6 @@ func TestChckSignWithSm2(t *testing.T) {
}
cfg
.
SetMinFee
(
0
)
tx15
.
Sign
(
ct
.
AuthSM2
,
privKeysm2
)
if
!
tx15
.
CheckSign
()
{
t
.
Error
(
"check signature failed"
)
...
...
plugin/dapp/echo/executor/echo.go
View file @
3b38b667
...
...
@@ -18,8 +18,6 @@ var (
KeyPrefixPangLocal
=
"LODB-echo-pang:%s"
)
// Init 本执行器的初始化动作,向系统注册本执行器,这里生效高度暂写为0
func
Init
(
name
string
,
cfg
*
types
.
Chain33Config
,
sub
[]
byte
)
{
dapp
.
Register
(
cfg
,
echotypes
.
EchoX
,
newEcho
,
0
)
...
...
plugin/dapp/evm/executor/tests/evm_test.go
View file @
3b38b667
...
...
@@ -15,15 +15,15 @@ import (
"time"
"github.com/33cn/chain33/account"
"github.com/33cn/chain33/client"
"github.com/33cn/chain33/common/db"
"github.com/33cn/chain33/queue"
"github.com/33cn/chain33/types"
evm
"github.com/33cn/plugin/plugin/dapp/evm/executor"
"github.com/33cn/plugin/plugin/dapp/evm/executor/vm/common"
"github.com/33cn/plugin/plugin/dapp/evm/executor/vm/common/crypto"
"github.com/33cn/plugin/plugin/dapp/evm/executor/vm/runtime"
"github.com/33cn/plugin/plugin/dapp/evm/executor/vm/state"
"github.com/33cn/chain33/queue"
"github.com/33cn/chain33/client"
)
func
TestVM
(
t
*
testing
.
T
)
{
...
...
plugin/dapp/evm/executor/tests/util_test.go
View file @
3b38b667
...
...
@@ -9,10 +9,14 @@ import (
"fmt"
"strconv"
"strings"
"github.com/33cn/chain33/account"
"github.com/33cn/chain33/client"
"github.com/33cn/chain33/common/address"
"github.com/33cn/chain33/common/crypto"
"github.com/33cn/chain33/common/db"
"github.com/33cn/chain33/queue"
"github.com/33cn/chain33/types"
evm
"github.com/33cn/plugin/plugin/dapp/evm/executor"
"github.com/33cn/plugin/plugin/dapp/evm/executor/vm/common"
...
...
@@ -20,12 +24,9 @@ import (
"github.com/33cn/plugin/plugin/dapp/evm/executor/vm/runtime"
"github.com/33cn/plugin/plugin/dapp/evm/executor/vm/state"
evmtypes
"github.com/33cn/plugin/plugin/dapp/evm/types"
"github.com/33cn/chain33/queue"
"github.com/33cn/chain33/client"
"strings"
)
var
chainTestCfg
=
types
.
NewChain33Config
(
strings
.
Replace
(
types
.
GetDefaultCfgstring
(),
"Title=
\"
local
\"
"
,
"Title=
\"
chain33
\"
"
,
1
))
var
chainTestCfg
=
types
.
NewChain33Config
(
strings
.
Replace
(
types
.
GetDefaultCfgstring
(),
"Title=
\"
local
\"
"
,
"Title=
\"
chain33
\"
"
,
1
))
func
init
()
{
evm
.
Init
(
evmtypes
.
ExecutorName
,
chainTestCfg
,
nil
)
...
...
plugin/dapp/evm/executor/vm/state/interface.go
View file @
3b38b667
...
...
@@ -5,9 +5,9 @@
package
state
import
(
"github.com/33cn/chain33/types"
"github.com/33cn/plugin/plugin/dapp/evm/executor/vm/common"
"github.com/33cn/plugin/plugin/dapp/evm/executor/vm/model"
"github.com/33cn/chain33/types"
)
// EVMStateDB 状态数据库封装,面向EVM业务执行逻辑;
...
...
plugin/dapp/evm/executor/vm/state/statedb.go
View file @
3b38b667
...
...
@@ -9,13 +9,13 @@ import (
"strings"
"github.com/33cn/chain33/account"
"github.com/33cn/chain33/client"
"github.com/33cn/chain33/common/db"
"github.com/33cn/chain33/common/log/log15"
"github.com/33cn/chain33/types"
"github.com/33cn/plugin/plugin/dapp/evm/executor/vm/common"
"github.com/33cn/plugin/plugin/dapp/evm/executor/vm/model"
evmtypes
"github.com/33cn/plugin/plugin/dapp/evm/types"
"github.com/33cn/chain33/client"
)
// MemoryStateDB 内存状态数据库,保存在区块操作时内部的数据变更操作
...
...
@@ -742,4 +742,4 @@ func (mdb *MemoryStateDB) GetBlockHeight() int64 {
// GetConfig 获取系统配置
func
(
mdb
*
MemoryStateDB
)
GetConfig
()
*
types
.
Chain33Config
{
return
mdb
.
api
.
GetConfig
()
}
\ No newline at end of file
}
plugin/dapp/game/executor/game_test.go
View file @
3b38b667
...
...
@@ -8,13 +8,13 @@ import (
"github.com/33cn/chain33/types"
"github.com/33cn/chain33/util"
"github.com/33cn/chain33/client"
"github.com/33cn/chain33/common"
"github.com/33cn/chain33/common/crypto"
dbm
"github.com/33cn/chain33/common/db"
"github.com/33cn/chain33/queue"
pty
"github.com/33cn/plugin/plugin/dapp/game/types"
"github.com/stretchr/testify/assert"
"github.com/33cn/chain33/queue"
"github.com/33cn/chain33/client"
)
type
execEnv
struct
{
...
...
plugin/dapp/game/executor/gamedb.go
View file @
3b38b667
...
...
@@ -12,12 +12,12 @@ import (
"strconv"
"github.com/33cn/chain33/account"
"github.com/33cn/chain33/client"
"github.com/33cn/chain33/common"
dbm
"github.com/33cn/chain33/common/db"
"github.com/33cn/chain33/system/dapp"
"github.com/33cn/chain33/types"
gt
"github.com/33cn/plugin/plugin/dapp/game/types"
"github.com/33cn/chain33/client"
)
const
(
...
...
plugin/dapp/game/types/types_test.go
View file @
3b38b667
...
...
@@ -9,8 +9,8 @@ package types
import
(
"testing"
"github.com/stretchr/testify/assert"
"github.com/33cn/chain33/types"
"github.com/stretchr/testify/assert"
)
func
TestCreateRawGamePreCreateTx
(
t
*
testing
.
T
)
{
...
...
plugin/dapp/hashlock/executor/hashlock_unit_test.go
View file @
3b38b667
...
...
@@ -12,15 +12,15 @@ import (
"math/rand"
"github.com/33cn/chain33/client"
"github.com/33cn/chain33/common"
"github.com/33cn/chain33/common/address"
"github.com/33cn/chain33/common/crypto"
"github.com/33cn/chain33/queue"
drivers
"github.com/33cn/chain33/system/dapp"
"github.com/33cn/chain33/types"
"github.com/33cn/chain33/util"
pty
"github.com/33cn/plugin/plugin/dapp/hashlock/types"
"github.com/33cn/chain33/queue"
"github.com/33cn/chain33/client"
)
var
(
...
...
plugin/dapp/hashlock/executor/hashlockdb.go
View file @
3b38b667
...
...
@@ -10,12 +10,12 @@ import (
"fmt"
"github.com/33cn/chain33/account"
"github.com/33cn/chain33/client"
"github.com/33cn/chain33/common"
dbm
"github.com/33cn/chain33/common/db"
log
"github.com/33cn/chain33/common/log/log15"
"github.com/33cn/chain33/types"
pty
"github.com/33cn/plugin/plugin/dapp/hashlock/types"
"github.com/33cn/chain33/client"
)
var
hlog
=
log
.
New
(
"module"
,
"hashlock.db"
)
...
...
plugin/dapp/js/executor/jsvm_test.go
View file @
3b38b667
...
...
@@ -23,7 +23,7 @@ import (
func
initExec
(
ldb
db
.
DB
,
kvdb
db
.
KVDB
,
code
string
,
t
assert
.
TestingT
)
*
js
{
cfg
:=
types
.
NewChain33Config
(
types
.
GetDefaultCfgstring
())
Init
(
ptypes
.
JsX
,
cfg
,
nil
)
Init
(
ptypes
.
JsX
,
cfg
,
nil
)
e
:=
newjs
()
.
(
*
js
)
...
...
plugin/dapp/lottery/executor/lottery_test.go
View file @
3b38b667
...
...
@@ -11,29 +11,29 @@ import (
"math/rand"
"testing"
"github.com/33cn/chain33/client"
"github.com/33cn/chain33/common"
"github.com/33cn/chain33/common/address"
"github.com/33cn/chain33/common/crypto"
"github.com/33cn/chain33/common/db"
"github.com/33cn/chain33/queue"
drivers
"github.com/33cn/chain33/system/dapp"
pty
"github.com/33cn/chain33/system/dapp/manage/types"
"github.com/33cn/chain33/types"
"github.com/33cn/chain33/util"
rt
"github.com/33cn/plugin/plugin/dapp/lottery/types"
"github.com/33cn/chain33/queue"
"github.com/33cn/chain33/client"
)
var
(
creatorAddr
string
buyAddr
string
buyPriv
crypto
.
PrivKey
creatorPriv
crypto
.
PrivKey
testNormErr
error
lottery
drivers
.
Driver
r
*
rand
.
Rand
mydb
db
.
KV
lotteryID
string
creatorAddr
string
buyAddr
string
buyPriv
crypto
.
PrivKey
creatorPriv
crypto
.
PrivKey
testNormErr
error
lottery
drivers
.
Driver
r
*
rand
.
Rand
mydb
db
.
KV
lotteryID
string
chainTestCfg
*
types
.
Chain33Config
)
...
...
@@ -196,7 +196,7 @@ func ConstructDrawTx() *types.Transaction {
func
constructLotteryInstance
()
drivers
.
Driver
{
chainTestCfg
=
types
.
NewChain33Config
(
types
.
GetDefaultCfgstring
())
Init
(
rt
.
LotteryX
,
chainTestCfg
,
nil
)
Init
(
rt
.
LotteryX
,
chainTestCfg
,
nil
)
lottery
:=
newLottery
()
//lottery.SetStateDB(NewTestDB())
_
,
_
,
kvdb
:=
util
.
CreateTestDB
()
...
...
plugin/dapp/lottery/executor/lotterydb.go
View file @
3b38b667
...
...
@@ -8,12 +8,12 @@ import (
"strconv"
"github.com/33cn/chain33/account"
"github.com/33cn/chain33/client"
"github.com/33cn/chain33/common"
dbm
"github.com/33cn/chain33/common/db"
"github.com/33cn/chain33/system/dapp"
"github.com/33cn/chain33/types"
pty
"github.com/33cn/plugin/plugin/dapp/lottery/types"
"github.com/33cn/chain33/client"
)
const
(
...
...
plugin/dapp/lottery/types/lottery.go
View file @
3b38b667
...
...
@@ -31,7 +31,6 @@ func InitExecutor(cfg *types.Chain33Config) {
types
.
RegistorExecutor
(
LotteryX
,
NewType
(
cfg
))
}
// LotteryType def
type
LotteryType
struct
{
types
.
ExecTypeBase
...
...
@@ -68,7 +67,7 @@ func (lottery *LotteryType) GetPayload() types.Message {
// CreateTx method
func
(
lottery
LotteryType
)
CreateTx
(
action
string
,
message
json
.
RawMessage
)
(
*
types
.
Transaction
,
error
)
{
llog
.
Debug
(
"lottery.CreateTx"
,
"action"
,
action
)
cfg
:=
lottery
.
GetConfig
()
cfg
:=
lottery
.
GetConfig
()
if
action
==
"LotteryCreate"
{
var
param
LotteryCreateTx
err
:=
json
.
Unmarshal
(
message
,
&
param
)
...
...
plugin/dapp/multisig/executor/exec_test.go
View file @
3b38b667
...
...
@@ -61,7 +61,7 @@ var (
func
init
()
{
commonlog
.
SetLogLevel
(
"debug"
)
types
.
AllowUserExec
=
append
(
types
.
AllowUserExec
,
[]
byte
(
"coins"
))
Init
(
mty
.
MultiSigX
,
chainTestCfg
,
nil
)
Init
(
mty
.
MultiSigX
,
chainTestCfg
,
nil
)
}
//创建一个多重签名的账户
...
...
plugin/dapp/multisig/executor/multisig.go
View file @
3b38b667
...
...
@@ -32,7 +32,6 @@ var multisiglog = log.New("module", "execs.multisig")
var
driverName
=
"multisig"
// Init multisig模块初始化
func
Init
(
name
string
,
cfg
*
types
.
Chain33Config
,
sub
[]
byte
)
{
drivers
.
Register
(
cfg
,
GetName
(),
newMultiSig
,
cfg
.
GetDappFork
(
driverName
,
"Enable"
))
...
...
plugin/dapp/oracle/executor/oracle.go
View file @
3b38b667
...
...
@@ -27,7 +27,6 @@ func InitExecType() {
ety
.
InitFuncList
(
types
.
ListMethod
(
&
oracle
{}))
}
// GetName 获取oracle执行器名
func
GetName
()
string
{
return
newOracle
()
.
GetName
()
...
...
plugin/dapp/paracross/executor/assettransfer_test.go
View file @
3b38b667
...
...
@@ -17,8 +17,8 @@ import (
dbm
"github.com/33cn/chain33/common/db"
dbmock
"github.com/33cn/chain33/common/db/mocks"
"github.com/33cn/chain33/types"
pt
"github.com/33cn/plugin/plugin/dapp/paracross/types"
"github.com/33cn/plugin/plugin/dapp/paracross/testnode"
pt
"github.com/33cn/plugin/plugin/dapp/paracross/types"
"github.com/stretchr/testify/mock"
)
...
...
plugin/dapp/paracross/executor/paracross_test.go
View file @
3b38b667
...
...
@@ -8,6 +8,8 @@ import (
"bytes"
"testing"
"strings"
apimock
"github.com/33cn/chain33/client/mocks"
"github.com/33cn/chain33/common"
"github.com/33cn/chain33/common/address"
...
...
@@ -17,12 +19,11 @@ import (
"github.com/33cn/chain33/common/log"
mty
"github.com/33cn/chain33/system/dapp/manage/types"
"github.com/33cn/chain33/types"
"github.com/33cn/plugin/plugin/dapp/paracross/testnode"
pt
"github.com/33cn/plugin/plugin/dapp/paracross/types"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"
"github.com/stretchr/testify/mock"
"strings"
"github.com/33cn/plugin/plugin/dapp/paracross/testnode"
"github.com/stretchr/testify/suite"
)
// 构造一个4个节点的平行链数据, 进行测试
...
...
@@ -56,7 +57,7 @@ var (
MainBlockHeightForTransfer
=
int64
(
9
)
tempTitle
=
""
chain33TestCfg
=
types
.
NewChain33Config
(
testnode
.
DefaultConfig
)
chain33TestMainCfg
=
types
.
NewChain33Config
(
strings
.
Replace
(
types
.
GetDefaultCfgstring
(),
"Title=
\"
local
\"
"
,
"Title=
\"
test
\"
"
,
1
))
chain33TestMainCfg
=
types
.
NewChain33Config
(
strings
.
Replace
(
types
.
GetDefaultCfgstring
(),
"Title=
\"
local
\"
"
,
"Title=
\"
test
\"
"
,
1
))
)
type
CommitTestSuite
struct
{
...
...
plugin/dapp/paracross/executor/superaccount.go
View file @
3b38b667
...
...
@@ -21,7 +21,6 @@ import (
"github.com/pkg/errors"
)
func
deepCopy
(
dst
,
src
interface
{})
error
{
var
buf
bytes
.
Buffer
if
err
:=
gob
.
NewEncoder
(
&
buf
)
.
Encode
(
src
);
err
!=
nil
{
...
...
plugin/dapp/paracross/rpc/rpc_test.go
View file @
3b38b667
...
...
@@ -14,11 +14,11 @@ import (
"github.com/33cn/chain33/client/mocks"
rpctypes
"github.com/33cn/chain33/rpc/types"
"github.com/33cn/chain33/types"
ptestNode
"github.com/33cn/plugin/plugin/dapp/paracross/testnode"
pt
"github.com/33cn/plugin/plugin/dapp/paracross/types"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"golang.org/x/net/context"
ptestNode
"github.com/33cn/plugin/plugin/dapp/paracross/testnode"
)
func
newGrpc
(
api
client
.
QueueProtocolAPI
)
*
channelClient
{
...
...
plugin/dapp/paracross/types/type.go
View file @
3b38b667
...
...
@@ -47,7 +47,6 @@ func InitExecutor(cfg *types.Chain33Config) {
types
.
RegistorExecutor
(
ParaX
,
NewType
(
cfg
))
}
// GetExecName get para exec name
func
GetExecName
(
cfg
*
types
.
Chain33Config
)
string
{
return
cfg
.
ExecName
(
ParaX
)
...
...
plugin/dapp/pokerbull/executor/pokerbull_test.go
View file @
3b38b667
...
...
@@ -4,6 +4,7 @@ import (
"testing"
"github.com/33cn/chain33/account"
apimock
"github.com/33cn/chain33/client/mocks"
"github.com/33cn/chain33/common"
"github.com/33cn/chain33/common/crypto"
dbm
"github.com/33cn/chain33/common/db"
...
...
@@ -13,7 +14,6 @@ import (
pkt
"github.com/33cn/plugin/plugin/dapp/pokerbull/types"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
apimock
"github.com/33cn/chain33/client/mocks"
)
type
execEnv
struct
{
...
...
@@ -34,7 +34,7 @@ var (
func
TestPokerbull
(
t
*
testing
.
T
)
{
cfg
:=
types
.
NewChain33Config
(
types
.
GetDefaultCfgstring
())
cfg
.
SetTitleOnlyForTest
(
"chain33"
)
Init
(
pkt
.
PokerBullX
,
cfg
,
nil
)
Init
(
pkt
.
PokerBullX
,
cfg
,
nil
)
total
:=
1000
*
types
.
Coin
accountA
:=
types
.
Account
{
Balance
:
total
,
...
...
plugin/dapp/privacy/crypto/ring_signature_test.go
View file @
3b38b667
...
...
@@ -17,13 +17,13 @@ import (
"github.com/33cn/chain33/common"
"github.com/33cn/chain33/common/crypto"
"github.com/33cn/chain33/types"
privacytypes
"github.com/33cn/plugin/plugin/dapp/privacy/types"
pexec
"github.com/33cn/plugin/plugin/dapp/privacy/executor"
privacytypes
"github.com/33cn/plugin/plugin/dapp/privacy/types"
)
var
(
pubsByte
[
10
][]
byte
secsByte
[
10
][]
byte
pubsByte
[
10
][]
byte
secsByte
[
10
][]
byte
chainTestCfg
=
types
.
NewChain33Config
(
types
.
GetDefaultCfgstring
())
)
...
...
@@ -57,7 +57,7 @@ func init() {
secsByte
[
i
],
_
=
common
.
FromHex
(
secstrs
[
i
])
}
pexec
.
Init
(
privacytypes
.
PrivacyX
,
chainTestCfg
,
nil
)
pexec
.
Init
(
privacytypes
.
PrivacyX
,
chainTestCfg
,
nil
)
}
func
TestGenerateKeyImage1
(
t
*
testing
.
T
)
{
...
...
plugin/dapp/privacy/wallet/privacy_test.go
View file @
3b38b667
...
...
@@ -5,19 +5,21 @@
package
wallet
import
(
"bytes"
"encoding/hex"
"sync"
"time"
"unsafe"
"github.com/33cn/chain33/common"
"github.com/33cn/chain33/common/address"
"github.com/33cn/chain33/common/crypto"
_
"github.com/33cn/chain33/system"
"github.com/33cn/chain33/types"
wcom
"github.com/33cn/chain33/wallet/common"
"github.com/33cn/plugin/plugin/dapp/privacy/crypto"
privacy
"github.com/33cn/plugin/plugin/dapp/privacy/crypto"
ty
"github.com/33cn/plugin/plugin/dapp/privacy/types"
"encoding/hex"
"bytes"
"unsafe"
"github.com/33cn/chain33/common/address"
"time"
)
type
PrivacyMock
struct
{
...
...
plugin/dapp/relay/cmd/relayd/main.go
View file @
3b38b667
...
...
@@ -16,13 +16,13 @@ import (
"github.com/33cn/chain33/common/limits"
clog
"github.com/33cn/chain33/common/log"
log
"github.com/33cn/chain33/common/log/log15"
"github.com/33cn/plugin/plugin/dapp/relay/cmd/relayd/relayd"
"github.com/33cn/chain33/types"
"github.com/33cn/plugin/plugin/dapp/relay/cmd/relayd/relayd"
)
var
(
cpuNum
=
runtime
.
NumCPU
()
configPath
=
flag
.
String
(
"f"
,
"relayd.toml"
,
"configfile"
)
cpuNum
=
runtime
.
NumCPU
()
configPath
=
flag
.
String
(
"f"
,
"relayd.toml"
,
"configfile"
)
chain33ConfigPath
=
flag
.
String
(
"chain33flie"
,
""
,
"chain33configfile"
)
)
...
...
plugin/dapp/relay/executor/relay.go
View file @
3b38b667
...
...
@@ -16,7 +16,6 @@ var relaylog = log.New("module", "execs.relay")
var
driverName
=
"relay"
// Init relay register driver
func
Init
(
name
string
,
cfg
*
types
.
Chain33Config
,
sub
[]
byte
)
{
drivers
.
Register
(
cfg
,
GetName
(),
newRelay
,
cfg
.
GetDappFork
(
driverName
,
"Enable"
))
//TODO: ForkV18Relay
...
...
plugin/dapp/relay/executor/relay_test.go
View file @
3b38b667
...
...
@@ -7,6 +7,7 @@ package executor
import
(
"testing"
apimock
"github.com/33cn/chain33/client/mocks"
"github.com/33cn/chain33/common/address"
"github.com/33cn/chain33/common/db"
"github.com/33cn/chain33/common/db/mocks"
...
...
@@ -14,7 +15,6 @@ import (
ty
"github.com/33cn/plugin/plugin/dapp/relay/types"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/suite"
apimock
"github.com/33cn/chain33/client/mocks"
_
"github.com/33cn/chain33/system"
)
...
...
plugin/dapp/relay/executor/relaydb.go
View file @
3b38b667
...
...
@@ -10,12 +10,12 @@ import (
"strconv"
"github.com/33cn/chain33/account"
"github.com/33cn/chain33/client"
"github.com/33cn/chain33/common"
dbm
"github.com/33cn/chain33/common/db"
"github.com/33cn/chain33/system/dapp"
"github.com/33cn/chain33/types"
ty
"github.com/33cn/plugin/plugin/dapp/relay/types"
"github.com/33cn/chain33/client"
)
const
(
...
...
plugin/dapp/relay/executor/relaydb_test.go
View file @
3b38b667
...
...
@@ -7,6 +7,7 @@ package executor
import
(
"testing"
apimock
"github.com/33cn/chain33/client/mocks"
"github.com/33cn/chain33/common"
"github.com/33cn/chain33/common/address"
"github.com/33cn/chain33/common/crypto"
...
...
@@ -17,7 +18,6 @@ import (
"github.com/gogo/protobuf/proto"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/suite"
apimock
"github.com/33cn/chain33/client/mocks"
)
type
suiteRelayLog
struct
{
...
...
plugin/dapp/retrieve/executor/retrieve_unit_test.go
View file @
3b38b667
...
...
@@ -11,15 +11,16 @@ import (
"math/rand"
"testing"
"strings"
"github.com/33cn/chain33/client"
"github.com/33cn/chain33/common/address"
"github.com/33cn/chain33/common/crypto"
"github.com/33cn/chain33/queue"
drivers
"github.com/33cn/chain33/system/dapp"
"github.com/33cn/chain33/types"
"github.com/33cn/chain33/util"
rt
"github.com/33cn/plugin/plugin/dapp/retrieve/types"
"github.com/33cn/chain33/queue"
"github.com/33cn/chain33/client"
"strings"
)
var
(
...
...
@@ -50,7 +51,6 @@ func init() {
retrieve
=
constructRetrieveInstance
()
}
func
TestExecBackup
(
t
*
testing
.
T
)
{
var
targetReceipt
types
.
Receipt
var
targetErr
error
...
...
@@ -248,7 +248,7 @@ func TestExecDelLocalBackup(t *testing.T) {
}
func
constructRetrieveInstance
()
drivers
.
Driver
{
cfgstring
:=
strings
.
Replace
(
types
.
GetDefaultCfgstring
(),
"Title=
\"
local
\"
"
,
"Title=
\"
chain33
\"
"
,
1
)
cfgstring
:=
strings
.
Replace
(
types
.
GetDefaultCfgstring
(),
"Title=
\"
local
\"
"
,
"Title=
\"
chain33
\"
"
,
1
)
chainTestCfg
:=
types
.
NewChain33Config
(
cfgstring
)
Init
(
rt
.
RetrieveX
,
chainTestCfg
,
nil
)
q
:=
queue
.
New
(
"channel"
)
...
...
plugin/dapp/retrieve/executor/retrievedb.go
View file @
3b38b667
...
...
@@ -13,9 +13,9 @@ import (
"github.com/33cn/chain33/types"
//log "github.com/33cn/chain33/common/log/log15"
"github.com/33cn/chain33/client"
"github.com/33cn/chain33/system/dapp"
rt
"github.com/33cn/plugin/plugin/dapp/retrieve/types"
"github.com/33cn/chain33/client"
)
const
(
...
...
plugin/dapp/ticket/executor/ticketdb.go
View file @
3b38b667
...
...
@@ -14,6 +14,7 @@ import (
"strings"
"github.com/33cn/chain33/account"
"github.com/33cn/chain33/client"
"github.com/33cn/chain33/common"
"github.com/33cn/chain33/common/address"
dbm
"github.com/33cn/chain33/common/db"
...
...
@@ -21,7 +22,6 @@ import (
"github.com/33cn/chain33/system/dapp"
"github.com/33cn/chain33/types"
ty
"github.com/33cn/plugin/plugin/dapp/ticket/types"
"github.com/33cn/chain33/client"
)
var
tlog
=
log
.
New
(
"module"
,
"ticket.db"
)
...
...
plugin/dapp/ticket/rpc/rpc.go
View file @
3b38b667
...
...
@@ -37,7 +37,7 @@ func (g *channelClient) CreateBindMiner(ctx context.Context, in *ty.ReqBindMiner
return
nil
,
err
}
cfg
:=
g
.
GetConfig
()
cfg
:=
g
.
GetConfig
()
if
in
.
CheckBalance
{
header
,
err
:=
g
.
GetLastHeader
()
if
err
!=
nil
{
...
...
plugin/dapp/ticket/rpc/rpc_real_test.go
View file @
3b38b667
...
...
@@ -10,11 +10,11 @@ import (
rpctypes
"github.com/33cn/chain33/rpc/types"
_
"github.com/33cn/chain33/system"
"github.com/33cn/chain33/types"
"github.com/33cn/chain33/util/testnode"
_
"github.com/33cn/plugin/plugin"
ty
"github.com/33cn/plugin/plugin/dapp/ticket/types"
"github.com/stretchr/testify/assert"
"github.com/33cn/chain33/types"
"github.com/33cn/chain33/util/testnode"
)
func
TestNewTicket
(
t
*
testing
.
T
)
{
...
...
plugin/dapp/token/executor/token_new_test.go
View file @
3b38b667
...
...
@@ -13,6 +13,8 @@ import (
"testing"
"time"
"strings"
"github.com/33cn/chain33/common"
"github.com/33cn/chain33/common/address"
"github.com/33cn/chain33/common/crypto"
...
...
@@ -20,7 +22,6 @@ import (
pty
"github.com/33cn/plugin/plugin/dapp/token/types"
"github.com/stretchr/testify/assert"
"google.golang.org/grpc"
"strings"
)
var
(
...
...
@@ -423,7 +424,7 @@ func getprivkey(key string) crypto.PrivKey {
}
func
TestToken_validSymbolWithHeight
(
t
*
testing
.
T
)
{
cfg
:=
types
.
NewChain33Config
(
strings
.
Replace
(
types
.
GetDefaultCfgstring
(),
"Title=
\"
local
\"
"
,
"Title=
\"
chain33
\"
"
,
1
))
cfg
:=
types
.
NewChain33Config
(
strings
.
Replace
(
types
.
GetDefaultCfgstring
(),
"Title=
\"
local
\"
"
,
"Title=
\"
chain33
\"
"
,
1
))
forkBadTokenSymbol
:=
cfg
.
GetDappFork
(
pty
.
TokenX
,
pty
.
ForkBadTokenSymbolX
)
forkTokenSymbolWithNumber
:=
cfg
.
GetDappFork
(
pty
.
TokenX
,
pty
.
ForkTokenSymbolWithNumberX
)
t
.
Log
(
"x"
,
"1"
,
forkBadTokenSymbol
,
"2"
,
forkTokenSymbolWithNumber
)
...
...
plugin/dapp/token/executor/token_test.go
View file @
3b38b667
...
...
@@ -13,10 +13,12 @@ import (
dbm
"github.com/33cn/chain33/common/db"
pty
"github.com/33cn/plugin/plugin/dapp/token/types"
"github.com/stretchr/testify/assert"
//"github.com/33cn/chain33/types/jsonpb"
"strings"
"github.com/stretchr/testify/mock"
apimock
"github.com/33cn/chain33/client/mocks"
"github.com/stretchr/testify/mock"
)
type
execEnv
struct
{
...
...
@@ -43,7 +45,7 @@ var (
)
func
TestToken
(
t
*
testing
.
T
)
{
cfg
:=
types
.
NewChain33Config
(
strings
.
Replace
(
types
.
GetDefaultCfgstring
(),
"Title=
\"
local
\"
"
,
"Title=
\"
chain33
\"
"
,
1
))
cfg
:=
types
.
NewChain33Config
(
strings
.
Replace
(
types
.
GetDefaultCfgstring
(),
"Title=
\"
local
\"
"
,
"Title=
\"
chain33
\"
"
,
1
))
Init
(
pty
.
TokenX
,
cfg
,
nil
)
tokenTotal
:=
int64
(
10000
*
1e8
)
tokenBurn
:=
int64
(
10
*
1e8
)
...
...
plugin/dapp/token/executor/tokendb.go
View file @
3b38b667
...
...
@@ -10,12 +10,12 @@ import (
"strings"
"github.com/33cn/chain33/account"
"github.com/33cn/chain33/client"
"github.com/33cn/chain33/common/address"
dbm
"github.com/33cn/chain33/common/db"
"github.com/33cn/chain33/system/dapp"
"github.com/33cn/chain33/types"
pty
"github.com/33cn/plugin/plugin/dapp/token/types"
"github.com/33cn/chain33/client"
)
type
tokenDB
struct
{
...
...
plugin/dapp/trade/executor/exec_test.go
View file @
3b38b667
...
...
@@ -7,7 +7,10 @@ package executor
import
(
"testing"
"strings"
"github.com/33cn/chain33/account"
apimock
"github.com/33cn/chain33/client/mocks"
"github.com/33cn/chain33/common"
"github.com/33cn/chain33/common/address"
"github.com/33cn/chain33/common/crypto"
...
...
@@ -17,8 +20,6 @@ import (
pty
"github.com/33cn/plugin/plugin/dapp/trade/types"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
apimock
"github.com/33cn/chain33/client/mocks"
"strings"
)
type
execEnv
struct
{
...
...
@@ -53,7 +54,7 @@ var (
[]
byte
(
"1NLHPEcbTWWxxU3dGUZBhayjrCHD3psX7k"
),
[]
byte
(
"1MCftFynyvG2F4ED5mdHYgziDxx6vDrScs"
),
}
chain33TestCfg
=
types
.
NewChain33Config
(
strings
.
Replace
(
types
.
GetDefaultCfgstring
(),
"Title=
\"
local
\"
"
,
"Title=
\"
chain33
\"
"
,
1
))
chain33TestCfg
=
types
.
NewChain33Config
(
strings
.
Replace
(
types
.
GetDefaultCfgstring
(),
"Title=
\"
local
\"
"
,
"Title=
\"
chain33
\"
"
,
1
))
)
func
init
()
{
...
...
plugin/dapp/trade/executor/tradedb.go
View file @
3b38b667
...
...
@@ -278,7 +278,6 @@ func (action *tradeAction) tradeSell(sell *pty.TradeForSell) (*types.Receipt, er
return
nil
,
pty
.
ErrAssetAndPriceSame
}
accDB
,
err
:=
createAccountDB
(
cfg
,
action
.
height
,
action
.
db
,
sell
.
AssetExec
,
sell
.
TokenSymbol
)
if
err
!=
nil
{
return
nil
,
err
...
...
plugin/dapp/trade/rpc/rpc_test.go
View file @
3b38b667
...
...
@@ -10,9 +10,9 @@ import (
"github.com/33cn/chain33/client/mocks"
rpctypes
"github.com/33cn/chain33/rpc/types"
"github.com/33cn/chain33/types"
ptypes
"github.com/33cn/plugin/plugin/dapp/trade/types"
"github.com/stretchr/testify/assert"
"github.com/33cn/chain33/types"
"github.com/stretchr/testify/mock"
)
...
...
plugin/dapp/trade/types/trade_test.go
View file @
3b38b667
...
...
@@ -7,8 +7,8 @@ package types
import
(
"testing"
"github.com/stretchr/testify/assert"
"github.com/33cn/chain33/types"
"github.com/stretchr/testify/assert"
)
func
TestTradeType_GetName
(
t
*
testing
.
T
)
{
...
...
plugin/dapp/unfreeze/executor/exec_test.go
View file @
3b38b667
...
...
@@ -11,7 +11,10 @@ import (
"encoding/hex"
"strings"
"github.com/33cn/chain33/account"
apimock
"github.com/33cn/chain33/client/mocks"
"github.com/33cn/chain33/common"
"github.com/33cn/chain33/common/address"
"github.com/33cn/chain33/common/crypto"
...
...
@@ -19,9 +22,7 @@ import (
"github.com/33cn/chain33/types"
"github.com/33cn/chain33/util"
pty
"github.com/33cn/plugin/plugin/dapp/unfreeze/types"
"strings"
"github.com/stretchr/testify/mock"
apimock
"github.com/33cn/chain33/client/mocks"
)
type
execEnv
struct
{
...
...
@@ -45,7 +46,7 @@ var (
[]
byte
(
"1NLHPEcbTWWxxU3dGUZBhayjrCHD3psX7k"
),
[]
byte
(
"1MCftFynyvG2F4ED5mdHYgziDxx6vDrScs"
),
}
chain33TestCfg
=
types
.
NewChain33Config
(
strings
.
Replace
(
types
.
GetDefaultCfgstring
(),
"Title=
\"
local
\"
"
,
"Title=
\"
chain33
\"
"
,
1
))
chain33TestCfg
=
types
.
NewChain33Config
(
strings
.
Replace
(
types
.
GetDefaultCfgstring
(),
"Title=
\"
local
\"
"
,
"Title=
\"
chain33
\"
"
,
1
))
)
func
init
()
{
...
...
plugin/dapp/valnode/rpc/rpc_test.go
View file @
3b38b667
...
...
@@ -11,15 +11,16 @@ import (
"encoding/hex"
"testing"
"strings"
"github.com/33cn/chain33/client"
"github.com/33cn/chain33/client/mocks"
rpctypes
"github.com/33cn/chain33/rpc/types"
"github.com/33cn/chain33/types"
vt
"github.com/33cn/plugin/plugin/dapp/valnode/types"
"github.com/stretchr/testify/assert"
"golang.org/x/net/context"
"strings"
"github.com/stretchr/testify/mock"
"golang.org/x/net/context"
)
func
newGrpc
(
api
client
.
QueueProtocolAPI
)
*
channelClient
{
...
...
@@ -33,7 +34,7 @@ func newJrpc(api client.QueueProtocolAPI) *Jrpc {
}
func
TestChannelClient_IsSync
(
t
*
testing
.
T
)
{
cfg
:=
types
.
NewChain33Config
(
strings
.
Replace
(
types
.
GetDefaultCfgstring
(),
"Title=
\"
local
\"
"
,
"Title=
\"
chain33
\"
"
,
1
))
cfg
:=
types
.
NewChain33Config
(
strings
.
Replace
(
types
.
GetDefaultCfgstring
(),
"Title=
\"
local
\"
"
,
"Title=
\"
chain33
\"
"
,
1
))
api
:=
new
(
mocks
.
QueueProtocolAPI
)
api
.
On
(
"GetConfig"
,
mock
.
Anything
)
.
Return
(
cfg
,
nil
)
client
:=
newGrpc
(
api
)
...
...
@@ -57,7 +58,7 @@ func TestJrpc_IsSync(t *testing.T) {
}
func
TestChannelClient_GetNodeInfo
(
t
*
testing
.
T
)
{
cfg
:=
types
.
NewChain33Config
(
strings
.
Replace
(
types
.
GetDefaultCfgstring
(),
"Title=
\"
local
\"
"
,
"Title=
\"
chain33
\"
"
,
1
))
cfg
:=
types
.
NewChain33Config
(
strings
.
Replace
(
types
.
GetDefaultCfgstring
(),
"Title=
\"
local
\"
"
,
"Title=
\"
chain33
\"
"
,
1
))
api
:=
new
(
mocks
.
QueueProtocolAPI
)
api
.
On
(
"GetConfig"
,
mock
.
Anything
)
.
Return
(
cfg
,
nil
)
client
:=
newGrpc
(
api
)
...
...
plugin/mempool/para/base.go
View file @
3b38b667
...
...
@@ -8,8 +8,8 @@ import (
log
"github.com/33cn/chain33/common/log/log15"
"github.com/33cn/chain33/queue"
"github.com/33cn/chain33/types"
"github.com/33cn/chain33/rpc/grpcclient"
"github.com/33cn/chain33/types"
)
var
mlog
=
log
.
New
(
"module"
,
"mempool.para"
)
...
...
@@ -61,7 +61,7 @@ func (mem *Mempool) SetQueueClient(client queue.Client) {
}()
}
func
(
mem
*
Mempool
)
setMainGrpcCli
(
cfg
*
types
.
Chain33Config
)
{
func
(
mem
*
Mempool
)
setMainGrpcCli
(
cfg
*
types
.
Chain33Config
)
{
if
cfg
!=
nil
&&
cfg
.
IsPara
()
{
grpcCli
,
err
:=
grpcclient
.
NewMainChainClient
(
cfg
,
""
)
if
err
!=
nil
{
...
...
plugin/store/kvmvccmavl/kvmvcc_mavl_test.go
View file @
3b38b667
...
...
@@ -610,7 +610,7 @@ func TestPruning(t *testing.T) {
store
:=
New
(
storeCfg
,
nil
,
nil
)
.
(
*
KVmMavlStore
)
assert
.
NotNil
(
t
,
store
)
kvmvccStore
:=
NewKVMVCC
(
&
subKVMVCCConfig
{
PruneHeight
:
10
},
store
.
GetDB
())
kvmvccStore
:=
NewKVMVCC
(
&
subKVMVCCConfig
{
PruneHeight
:
10
},
store
.
GetDB
())
var
kv
[]
*
types
.
KeyValue
var
key
string
...
...
@@ -646,7 +646,7 @@ func TestPruning(t *testing.T) {
hashes
=
append
(
hashes
,
hash
)
}
pruningMVCC
(
store
.
GetDB
(),
99
,
&
KVMCCCConfig
{
PruneHeight
:
10
})
pruningMVCC
(
store
.
GetDB
(),
99
,
&
KVMCCCConfig
{
PruneHeight
:
10
})
//check
getDatas
:=
&
types
.
StoreGet
{
...
...
plugin/store/kvmvccmavl/kvmvccdb.go
View file @
3b38b667
...
...
@@ -25,7 +25,7 @@ const (
onceScanCount
=
10000
// 单次扫描数目
onceCount
=
1000
// 容器长度
levelPruningHeight
=
100
*
10000
defaultPruneHeight
=
10000
// 每个10000裁剪一次
defaultPruneHeight
=
10000
// 每个10000裁剪一次
)
var
(
...
...
@@ -52,11 +52,11 @@ type KVMCCCConfig struct {
// KVMVCCStore provide kvmvcc store interface implementation
type
KVMVCCStore
struct
{
db
dbm
.
DB
mvcc
dbm
.
MVCC
kvsetmap
map
[
string
][]
*
types
.
KeyValue
sync
bool
kvmvccCfg
*
KVMCCCConfig
db
dbm
.
DB
mvcc
dbm
.
MVCC
kvsetmap
map
[
string
][]
*
types
.
KeyValue
sync
bool
kvmvccCfg
*
KVMCCCConfig
}
// NewKVMVCC construct KVMVCCStore module
...
...
@@ -75,9 +75,9 @@ func NewKVMVCC(sub *subKVMVCCConfig, db dbm.DB) *KVMVCCStore {
}
if
kvmvccCfg
.
EnableMVCCIter
{
kvs
=
&
KVMVCCStore
{
db
,
dbm
.
NewMVCCIter
(
db
),
make
(
map
[
string
][]
*
types
.
KeyValue
),
false
,
kvmvccCfg
}
kvs
=
&
KVMVCCStore
{
db
,
dbm
.
NewMVCCIter
(
db
),
make
(
map
[
string
][]
*
types
.
KeyValue
),
false
,
kvmvccCfg
}
}
else
{
kvs
=
&
KVMVCCStore
{
db
,
dbm
.
NewMVCC
(
db
),
make
(
map
[
string
][]
*
types
.
KeyValue
),
false
,
kvmvccCfg
}
kvs
=
&
KVMVCCStore
{
db
,
dbm
.
NewMVCC
(
db
),
make
(
map
[
string
][]
*
types
.
KeyValue
),
false
,
kvmvccCfg
}
}
return
kvs
}
...
...
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