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
c9646540
Commit
c9646540
authored
Oct 22, 2019
by
liuyuhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify linter
parent
0acec943
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
53 additions
and
60 deletions
+53
-60
main.go
cli/fork_config/main.go
+43
-48
round_state.go
plugin/consensus/tendermint/types/round_state.go
+0
-0
certutils.go
...rt/authority/tools/cryptogen/generator/utils/certutils.go
+0
-0
paracross_test.go
plugin/dapp/paracross/executor/paracross_test.go
+0
-1
privacy_test.go
plugin/dapp/privacy/wallet/privacy_test.go
+0
-1
trade.go
plugin/dapp/trade/types/trade.go
+10
-10
No files found.
cli/fork_config/main.go
View file @
c9646540
package
main
package
main
import
(
import
(
"fmt"
"os"
"sort"
"strings"
_
"github.com/33cn/chain33/system"
_
"github.com/33cn/chain33/system"
_
"github.com/33cn/plugin/plugin"
_
"github.com/33cn/plugin/plugin"
)
)
...
@@ -35,46 +30,46 @@ func main() {
...
@@ -35,46 +30,46 @@ func main() {
[fork.sub.store-kvmvccmavl]
[fork.sub.store-kvmvccmavl]
ForkKvmvccmavl=2270000 # store-kvmvccmavl.ForkKvmvccmavl=1870000
ForkKvmvccmavl=2270000 # store-kvmvccmavl.ForkKvmvccmavl=1870000
*/
*/
func
fmtForks
(
forks
map
[
string
]
int64
)
{
//
func fmtForks(forks map[string]int64) {
systemFork
:=
make
(
map
[
string
]
int64
)
//
systemFork := make(map[string]int64)
subFork
:=
make
(
map
[
string
]
map
[
string
]
int64
)
//
subFork := make(map[string]map[string]int64)
for
k
,
v
:=
range
forks
{
//
for k, v := range forks {
if
strings
.
Contains
(
k
,
"."
)
{
//
if strings.Contains(k, ".") {
str2
:=
strings
.
SplitN
(
k
,
"."
,
2
)
//
str2 := strings.SplitN(k, ".", 2)
if
len
(
str2
)
!=
2
{
//
if len(str2) != 2 {
fmt
.
Fprintf
(
os
.
Stderr
,
"can't deal key=%s "
,
k
)
//
fmt.Fprintf(os.Stderr, "can't deal key=%s ", k)
continue
//
continue
}
//
}
_
,
ok
:=
subFork
[
str2
[
0
]]
//
_, ok := subFork[str2[0]]
if
!
ok
{
//
if !ok {
subFork
[
str2
[
0
]]
=
make
(
map
[
string
]
int64
)
//
subFork[str2[0]] = make(map[string]int64)
}
//
}
subFork
[
str2
[
0
]][
str2
[
1
]]
=
v
//
subFork[str2[0]][str2[1]] = v
}
else
{
//
} else {
systemFork
[
k
]
=
v
//
systemFork[k] = v
}
//
}
//
}
//
}
//
fmt
.
Println
(
"[fork.system]"
)
//
fmt.Println("[fork.system]")
for
k
,
v
:=
range
systemFork
{
//
for k, v := range systemFork {
fmt
.
Printf
(
"%s=%d
\n
"
,
k
,
v
)
//
fmt.Printf("%s=%d\n", k, v)
}
//
}
fmt
.
Println
(
""
)
//
fmt.Println("")
//
plugins
:=
make
([]
string
,
0
)
//
plugins := make([]string, 0)
for
plugin
:=
range
subFork
{
//
for plugin := range subFork {
plugins
=
append
(
plugins
,
plugin
)
//
plugins = append(plugins, plugin)
}
//
}
sort
.
Strings
(
plugins
)
//
sort.Strings(plugins)
//
for
_
,
plugin
:=
range
plugins
{
//
for _, plugin := range plugins {
fmt
.
Printf
(
"[fork.sub.%s]
\n
"
,
plugin
)
//
fmt.Printf("[fork.sub.%s]\n", plugin)
forks
:=
subFork
[
plugin
]
//
forks := subFork[plugin]
for
k
,
v
:=
range
forks
{
//
for k, v := range forks {
fmt
.
Printf
(
"%s=%d
\n
"
,
k
,
v
)
//
fmt.Printf("%s=%d\n", k, v)
}
//
}
fmt
.
Println
(
""
)
//
fmt.Println("")
}
//
}
//
}
//
}
plugin/consensus/tendermint/types/round_state.go
View file @
c9646540
plugin/dapp/cert/authority/tools/cryptogen/generator/utils/certutils.go
View file @
c9646540
plugin/dapp/paracross/executor/paracross_test.go
View file @
c9646540
...
@@ -55,7 +55,6 @@ var (
...
@@ -55,7 +55,6 @@ var (
TokenSymbol
=
"X"
TokenSymbol
=
"X"
MainBlockHeightForTransfer
=
int64
(
9
)
MainBlockHeightForTransfer
=
int64
(
9
)
tempTitle
=
""
chain33TestCfg
=
types
.
NewChain33Config
(
testnode
.
DefaultConfig
)
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
))
)
)
...
...
plugin/dapp/privacy/wallet/privacy_test.go
View file @
c9646540
...
@@ -18,7 +18,6 @@ import (
...
@@ -18,7 +18,6 @@ import (
"github.com/33cn/chain33/types"
"github.com/33cn/chain33/types"
wcom
"github.com/33cn/chain33/wallet/common"
wcom
"github.com/33cn/chain33/wallet/common"
"github.com/33cn/plugin/plugin/dapp/privacy/crypto"
"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"
ty
"github.com/33cn/plugin/plugin/dapp/privacy/types"
)
)
...
...
plugin/dapp/trade/types/trade.go
View file @
c9646540
...
@@ -36,15 +36,15 @@ var (
...
@@ -36,15 +36,15 @@ var (
}
}
)
)
func
(
t
*
t
radeType
)
GetName
()
string
{
func
(
t
*
T
radeType
)
GetName
()
string
{
return
TradeX
return
TradeX
}
}
func
(
t
*
t
radeType
)
GetTypeMap
()
map
[
string
]
int32
{
func
(
t
*
T
radeType
)
GetTypeMap
()
map
[
string
]
int32
{
return
actionName
return
actionName
}
}
func
(
t
*
t
radeType
)
GetLogMap
()
map
[
int64
]
*
types
.
LogInfo
{
func
(
t
*
T
radeType
)
GetLogMap
()
map
[
int64
]
*
types
.
LogInfo
{
return
logInfo
return
logInfo
}
}
...
@@ -67,23 +67,23 @@ func InitExecutor(cfg *types.Chain33Config) {
...
@@ -67,23 +67,23 @@ func InitExecutor(cfg *types.Chain33Config) {
types
.
RegistorExecutor
(
TradeX
,
NewType
(
cfg
))
types
.
RegistorExecutor
(
TradeX
,
NewType
(
cfg
))
}
}
type
t
radeType
struct
{
type
T
radeType
struct
{
types
.
ExecTypeBase
types
.
ExecTypeBase
}
}
func
NewType
(
cfg
*
types
.
Chain33Config
)
*
t
radeType
{
func
NewType
(
cfg
*
types
.
Chain33Config
)
*
T
radeType
{
c
:=
&
t
radeType
{}
c
:=
&
T
radeType
{}
c
.
SetChild
(
c
)
c
.
SetChild
(
c
)
c
.
SetConfig
(
cfg
)
c
.
SetConfig
(
cfg
)
return
c
return
c
}
}
func
(
t
*
t
radeType
)
GetPayload
()
types
.
Message
{
func
(
t
*
T
radeType
)
GetPayload
()
types
.
Message
{
return
&
Trade
{}
return
&
Trade
{}
}
}
//ActionName :
//ActionName :
func
(
t
*
t
radeType
)
ActionName
(
tx
*
types
.
Transaction
)
string
{
func
(
t
*
T
radeType
)
ActionName
(
tx
*
types
.
Transaction
)
string
{
var
action
Trade
var
action
Trade
err
:=
types
.
Decode
(
tx
.
Payload
,
&
action
)
err
:=
types
.
Decode
(
tx
.
Payload
,
&
action
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -105,7 +105,7 @@ func (t *tradeType) ActionName(tx *types.Transaction) string {
...
@@ -105,7 +105,7 @@ func (t *tradeType) ActionName(tx *types.Transaction) string {
return
"unknown"
return
"unknown"
}
}
func
(
t
*
t
radeType
)
Amount
(
tx
*
types
.
Transaction
)
(
int64
,
error
)
{
func
(
t
*
T
radeType
)
Amount
(
tx
*
types
.
Transaction
)
(
int64
,
error
)
{
//TODO: 补充和完善token和trade分支的amount的计算, added by hzj
//TODO: 补充和完善token和trade分支的amount的计算, added by hzj
var
trade
Trade
var
trade
Trade
err
:=
types
.
Decode
(
tx
.
GetPayload
(),
&
trade
)
err
:=
types
.
Decode
(
tx
.
GetPayload
(),
&
trade
)
...
@@ -123,7 +123,7 @@ func (t *tradeType) Amount(tx *types.Transaction) (int64, error) {
...
@@ -123,7 +123,7 @@ func (t *tradeType) Amount(tx *types.Transaction) (int64, error) {
return
0
,
nil
return
0
,
nil
}
}
func
(
t
*
t
radeType
)
CreateTx
(
action
string
,
message
json
.
RawMessage
)
(
*
types
.
Transaction
,
error
)
{
func
(
t
*
T
radeType
)
CreateTx
(
action
string
,
message
json
.
RawMessage
)
(
*
types
.
Transaction
,
error
)
{
//var tx *types.Transaction
//var tx *types.Transaction
cfg
:=
t
.
GetConfig
()
cfg
:=
t
.
GetConfig
()
if
action
==
"TradeSellLimit"
{
if
action
==
"TradeSellLimit"
{
...
...
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