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
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
62 additions
and
69 deletions
+62
-69
main.go
cli/fork_config/main.go
+43
-48
round_state.go
plugin/consensus/tendermint/types/round_state.go
+3
-3
certutils.go
...rt/authority/tools/cryptogen/generator/utils/certutils.go
+6
-6
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
import
(
"fmt"
"os"
"sort"
"strings"
_
"github.com/33cn/chain33/system"
_
"github.com/33cn/plugin/plugin"
)
...
...
@@ -35,46 +30,46 @@ func main() {
[fork.sub.store-kvmvccmavl]
ForkKvmvccmavl=2270000 # store-kvmvccmavl.ForkKvmvccmavl=1870000
*/
func
fmtForks
(
forks
map
[
string
]
int64
)
{
systemFork
:=
make
(
map
[
string
]
int64
)
subFork
:=
make
(
map
[
string
]
map
[
string
]
int64
)
for
k
,
v
:=
range
forks
{
if
strings
.
Contains
(
k
,
"."
)
{
str2
:=
strings
.
SplitN
(
k
,
"."
,
2
)
if
len
(
str2
)
!=
2
{
fmt
.
Fprintf
(
os
.
Stderr
,
"can't deal key=%s "
,
k
)
continue
}
_
,
ok
:=
subFork
[
str2
[
0
]]
if
!
ok
{
subFork
[
str2
[
0
]]
=
make
(
map
[
string
]
int64
)
}
subFork
[
str2
[
0
]][
str2
[
1
]]
=
v
}
else
{
systemFork
[
k
]
=
v
}
}
fmt
.
Println
(
"[fork.system]"
)
for
k
,
v
:=
range
systemFork
{
fmt
.
Printf
(
"%s=%d
\n
"
,
k
,
v
)
}
fmt
.
Println
(
""
)
plugins
:=
make
([]
string
,
0
)
for
plugin
:=
range
subFork
{
plugins
=
append
(
plugins
,
plugin
)
}
sort
.
Strings
(
plugins
)
for
_
,
plugin
:=
range
plugins
{
fmt
.
Printf
(
"[fork.sub.%s]
\n
"
,
plugin
)
forks
:=
subFork
[
plugin
]
for
k
,
v
:=
range
forks
{
fmt
.
Printf
(
"%s=%d
\n
"
,
k
,
v
)
}
fmt
.
Println
(
""
)
}
}
//
func fmtForks(forks map[string]int64) {
//
systemFork := make(map[string]int64)
//
subFork := make(map[string]map[string]int64)
//
for k, v := range forks {
//
if strings.Contains(k, ".") {
//
str2 := strings.SplitN(k, ".", 2)
//
if len(str2) != 2 {
//
fmt.Fprintf(os.Stderr, "can't deal key=%s ", k)
//
continue
//
}
//
_, ok := subFork[str2[0]]
//
if !ok {
//
subFork[str2[0]] = make(map[string]int64)
//
}
//
subFork[str2[0]][str2[1]] = v
//
} else {
//
systemFork[k] = v
//
}
//
//
}
//
//
fmt.Println("[fork.system]")
//
for k, v := range systemFork {
//
fmt.Printf("%s=%d\n", k, v)
//
}
//
fmt.Println("")
//
//
plugins := make([]string, 0)
//
for plugin := range subFork {
//
plugins = append(plugins, plugin)
//
}
//
sort.Strings(plugins)
//
//
for _, plugin := range plugins {
//
fmt.Printf("[fork.sub.%s]\n", plugin)
//
forks := subFork[plugin]
//
for k, v := range forks {
//
fmt.Printf("%s=%d\n", k, v)
//
}
//
fmt.Println("")
//
}
//
//
}
plugin/consensus/tendermint/types/round_state.go
View file @
c9646540
...
...
@@ -119,9 +119,9 @@ type RoundState struct {
// RoundStateMessage ...
func
(
rs
*
RoundState
)
RoundStateMessage
()
*
tmtypes
.
NewRoundStepMsg
{
return
&
tmtypes
.
NewRoundStepMsg
{
Height
:
rs
.
Height
,
Round
:
int32
(
rs
.
Round
),
Step
:
int32
(
rs
.
Step
),
Height
:
rs
.
Height
,
Round
:
int32
(
rs
.
Round
),
Step
:
int32
(
rs
.
Step
),
SecondsSinceStartTime
:
int32
(
time
.
Since
(
rs
.
StartTime
)
.
Seconds
()),
LastCommitRound
:
int32
(
rs
.
LastCommit
.
Round
()),
}
...
...
plugin/dapp/cert/authority/tools/cryptogen/generator/utils/certutils.go
View file @
c9646540
...
...
@@ -73,9 +73,9 @@ func ParseX509CertificateToSm2(x509Cert *x509.Certificate) *sm2.Certificate {
UnknownExtKeyUsage
:
x509Cert
.
UnknownExtKeyUsage
,
BasicConstraintsValid
:
x509Cert
.
BasicConstraintsValid
,
IsCA
:
x509Cert
.
IsCA
,
MaxPathLen
:
x509Cert
.
MaxPathLen
,
MaxPathLenZero
:
x509Cert
.
MaxPathLenZero
,
IsCA
:
x509Cert
.
IsCA
,
MaxPathLen
:
x509Cert
.
MaxPathLen
,
MaxPathLenZero
:
x509Cert
.
MaxPathLenZero
,
SubjectKeyId
:
x509Cert
.
SubjectKeyId
,
AuthorityKeyId
:
x509Cert
.
AuthorityKeyId
,
...
...
@@ -136,9 +136,9 @@ func ParseSm2CertificateToX509(sm2Cert *sm2.Certificate) *x509.Certificate {
UnknownExtKeyUsage
:
sm2Cert
.
UnknownExtKeyUsage
,
BasicConstraintsValid
:
sm2Cert
.
BasicConstraintsValid
,
IsCA
:
sm2Cert
.
IsCA
,
MaxPathLen
:
sm2Cert
.
MaxPathLen
,
MaxPathLenZero
:
sm2Cert
.
MaxPathLenZero
,
IsCA
:
sm2Cert
.
IsCA
,
MaxPathLen
:
sm2Cert
.
MaxPathLen
,
MaxPathLenZero
:
sm2Cert
.
MaxPathLenZero
,
SubjectKeyId
:
sm2Cert
.
SubjectKeyId
,
AuthorityKeyId
:
sm2Cert
.
AuthorityKeyId
,
...
...
plugin/dapp/paracross/executor/paracross_test.go
View file @
c9646540
...
...
@@ -55,7 +55,6 @@ var (
TokenSymbol
=
"X"
MainBlockHeightForTransfer
=
int64
(
9
)
tempTitle
=
""
chain33TestCfg
=
types
.
NewChain33Config
(
testnode
.
DefaultConfig
)
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 (
"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"
)
...
...
plugin/dapp/trade/types/trade.go
View file @
c9646540
...
...
@@ -36,15 +36,15 @@ var (
}
)
func
(
t
*
t
radeType
)
GetName
()
string
{
func
(
t
*
T
radeType
)
GetName
()
string
{
return
TradeX
}
func
(
t
*
t
radeType
)
GetTypeMap
()
map
[
string
]
int32
{
func
(
t
*
T
radeType
)
GetTypeMap
()
map
[
string
]
int32
{
return
actionName
}
func
(
t
*
t
radeType
)
GetLogMap
()
map
[
int64
]
*
types
.
LogInfo
{
func
(
t
*
T
radeType
)
GetLogMap
()
map
[
int64
]
*
types
.
LogInfo
{
return
logInfo
}
...
...
@@ -67,23 +67,23 @@ func InitExecutor(cfg *types.Chain33Config) {
types
.
RegistorExecutor
(
TradeX
,
NewType
(
cfg
))
}
type
t
radeType
struct
{
type
T
radeType
struct
{
types
.
ExecTypeBase
}
func
NewType
(
cfg
*
types
.
Chain33Config
)
*
t
radeType
{
c
:=
&
t
radeType
{}
func
NewType
(
cfg
*
types
.
Chain33Config
)
*
T
radeType
{
c
:=
&
T
radeType
{}
c
.
SetChild
(
c
)
c
.
SetConfig
(
cfg
)
return
c
}
func
(
t
*
t
radeType
)
GetPayload
()
types
.
Message
{
func
(
t
*
T
radeType
)
GetPayload
()
types
.
Message
{
return
&
Trade
{}
}
//ActionName :
func
(
t
*
t
radeType
)
ActionName
(
tx
*
types
.
Transaction
)
string
{
func
(
t
*
T
radeType
)
ActionName
(
tx
*
types
.
Transaction
)
string
{
var
action
Trade
err
:=
types
.
Decode
(
tx
.
Payload
,
&
action
)
if
err
!=
nil
{
...
...
@@ -105,7 +105,7 @@ func (t *tradeType) ActionName(tx *types.Transaction) string {
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
var
trade
Trade
err
:=
types
.
Decode
(
tx
.
GetPayload
(),
&
trade
)
...
...
@@ -123,7 +123,7 @@ func (t *tradeType) Amount(tx *types.Transaction) (int64, error) {
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
cfg
:=
t
.
GetConfig
()
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