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
e74637e8
Commit
e74637e8
authored
Mar 16, 2019
by
vipwzw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixbug fee
parent
25edc591
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
25 additions
and
12 deletions
+25
-12
para_test.go
plugin/consensus/para/para_test.go
+1
-1
paracommitmsg.go
plugin/consensus/para/paracommitmsg.go
+1
-1
paracross_test.go
plugin/dapp/paracross/executor/paracross_test.go
+1
-1
execenv.go
vendor/github.com/33cn/chain33/executor/execenv.go
+2
-2
client.go
vendor/github.com/33cn/chain33/rpc/client.go
+1
-1
jrpchandler_test.go
vendor/github.com/33cn/chain33/rpc/jrpchandler_test.go
+1
-1
bty.go
vendor/github.com/33cn/chain33/system/dapp/commands/bty.go
+1
-1
driver.go
vendor/github.com/33cn/chain33/system/dapp/driver.go
+1
-1
cfg.go
vendor/github.com/33cn/chain33/types/cfg.go
+2
-0
config.go
vendor/github.com/33cn/chain33/types/config.go
+7
-0
bityuan.toml
vendor/github.com/33cn/chain33/types/testdata/bityuan.toml
+2
-0
chain33.toml
vendor/github.com/33cn/chain33/types/testdata/chain33.toml
+2
-0
tx_test.go
vendor/github.com/33cn/chain33/types/tx_test.go
+3
-3
No files found.
plugin/consensus/para/para_test.go
View file @
e74637e8
...
...
@@ -219,7 +219,7 @@ func createTxsGroup(txs []*types.Transaction) ([]*types.Transaction, error) {
if
err
!=
nil
{
return
nil
,
err
}
err
=
group
.
Check
(
0
,
types
.
GInt
(
"MinFee"
),
types
.
GInt
(
"Max
Tx
Fee"
))
err
=
group
.
Check
(
0
,
types
.
GInt
(
"MinFee"
),
types
.
GInt
(
"MaxFee"
))
if
err
!=
nil
{
return
nil
,
err
}
...
...
plugin/consensus/para/paracommitmsg.go
View file @
e74637e8
...
...
@@ -225,7 +225,7 @@ func (client *commitMsgClient) getTxsGroup(txsArr *types.Transactions) (*types.T
plog
.
Error
(
"para CreateTxGroup"
,
"err"
,
err
.
Error
())
return
nil
,
err
}
err
=
group
.
Check
(
0
,
types
.
GInt
(
"MinFee"
),
types
.
GInt
(
"Max
Tx
Fee"
))
err
=
group
.
Check
(
0
,
types
.
GInt
(
"MinFee"
),
types
.
GInt
(
"MaxFee"
))
if
err
!=
nil
{
plog
.
Error
(
"para CheckTxGroup"
,
"err"
,
err
.
Error
())
return
nil
,
err
...
...
plugin/dapp/paracross/executor/paracross_test.go
View file @
e74637e8
...
...
@@ -523,7 +523,7 @@ func createTxsGroup(s suite.Suite, txs []*types.Transaction) ([]*types.Transacti
if
err
!=
nil
{
return
nil
,
err
}
err
=
group
.
Check
(
0
,
types
.
GInt
(
"MinFee"
),
types
.
GInt
(
"Max
Tx
Fee"
))
err
=
group
.
Check
(
0
,
types
.
GInt
(
"MinFee"
),
types
.
GInt
(
"MaxFee"
))
if
err
!=
nil
{
return
nil
,
err
}
...
...
vendor/github.com/33cn/chain33/executor/execenv.go
View file @
e74637e8
...
...
@@ -138,7 +138,7 @@ func (e *executor) checkTx(tx *types.Transaction, index int) error {
//如果已经过期
return
types
.
ErrTxExpire
}
if
err
:=
tx
.
Check
(
e
.
height
,
types
.
GInt
(
"MinFee"
),
types
.
GInt
(
"Max
Tx
Fee"
));
err
!=
nil
{
if
err
:=
tx
.
Check
(
e
.
height
,
types
.
GInt
(
"MinFee"
),
types
.
GInt
(
"MaxFee"
));
err
!=
nil
{
return
err
}
//允许重写的情况
...
...
@@ -166,7 +166,7 @@ func (e *executor) checkTxGroup(txgroup *types.Transactions, index int) error {
//如果已经过期
return
types
.
ErrTxExpire
}
if
err
:=
txgroup
.
Check
(
e
.
height
,
types
.
GInt
(
"MinFee"
),
types
.
GInt
(
"Max
Tx
Fee"
));
err
!=
nil
{
if
err
:=
txgroup
.
Check
(
e
.
height
,
types
.
GInt
(
"MinFee"
),
types
.
GInt
(
"MaxFee"
));
err
!=
nil
{
return
err
}
return
nil
...
...
vendor/github.com/33cn/chain33/rpc/client.go
View file @
e74637e8
...
...
@@ -129,7 +129,7 @@ func (c *channelClient) CreateNoBalanceTransaction(in *types.NoBalanceTx) (*type
if
err
!=
nil
{
return
nil
,
err
}
err
=
group
.
Check
(
0
,
types
.
GInt
(
"MinFee"
),
types
.
GInt
(
"Max
Tx
Fee"
))
err
=
group
.
Check
(
0
,
types
.
GInt
(
"MinFee"
),
types
.
GInt
(
"MaxFee"
))
if
err
!=
nil
{
return
nil
,
err
}
...
...
vendor/github.com/33cn/chain33/rpc/jrpchandler_test.go
View file @
e74637e8
...
...
@@ -456,7 +456,7 @@ func TestChain33_CreateTxGroup(t *testing.T) {
t
.
Error
(
"Test createtxgroup failed"
)
return
}
err
=
tx
.
Check
(
0
,
types
.
GInt
(
"MinFee"
),
types
.
GInt
(
"Max
Tx
Fee"
))
err
=
tx
.
Check
(
0
,
types
.
GInt
(
"MinFee"
),
types
.
GInt
(
"MaxFee"
))
assert
.
Nil
(
t
,
err
)
}
...
...
vendor/github.com/33cn/chain33/system/dapp/commands/bty.go
View file @
e74637e8
...
...
@@ -300,7 +300,7 @@ func createTxGroup(cmd *cobra.Command, args []string) {
fmt
.
Fprintln
(
os
.
Stderr
,
err
)
return
}
err
=
group
.
Check
(
0
,
types
.
GInt
(
"MinFee"
),
types
.
GInt
(
"Max
Tx
Fee"
))
err
=
group
.
Check
(
0
,
types
.
GInt
(
"MinFee"
),
types
.
GInt
(
"MaxFee"
))
if
err
!=
nil
{
fmt
.
Fprintln
(
os
.
Stderr
,
err
)
return
...
...
vendor/github.com/33cn/chain33/system/dapp/driver.go
View file @
e74637e8
...
...
@@ -373,7 +373,7 @@ func (d *DriverBase) GetTxGroup(index int) ([]*types.Transaction, error) {
for
i
:=
index
;
i
>=
0
&&
i
>=
index
-
c
;
i
--
{
if
bytes
.
Equal
(
d
.
txs
[
i
]
.
Header
,
d
.
txs
[
i
]
.
Hash
())
{
//find header
txgroup
:=
types
.
Transactions
{
Txs
:
d
.
txs
[
i
:
i
+
c
]}
err
:=
txgroup
.
Check
(
d
.
GetHeight
(),
types
.
GInt
(
"MinFee"
),
types
.
GInt
(
"Max
Tx
Fee"
))
err
:=
txgroup
.
Check
(
d
.
GetHeight
(),
types
.
GInt
(
"MinFee"
),
types
.
GInt
(
"MaxFee"
))
if
err
!=
nil
{
return
nil
,
err
}
...
...
vendor/github.com/33cn/chain33/types/cfg.go
View file @
e74637e8
...
...
@@ -200,6 +200,8 @@ type RPC struct {
type
Exec
struct
{
// 执行器执行所需最小费用,低于Mempool和Wallet设置的MinFee,在minExecFee = 0 的情况下,isFree = true才会生效
MinExecFee
int64
`protobuf:"varint,1,opt,name=minExecFee" json:"minExecFee,omitempty"`
// 执行器执行所需最大费用,这个值必须大于mempool 和 wallet 的值
MaxExecFee
int64
`protobuf:"varint,1,opt,name=maxExecFee" json:"maxExecFee,omitempty"`
// 执行器执行是否免费
IsFree
bool
`protobuf:"varint,2,opt,name=isFree" json:"isFree,omitempty"`
// 是否开启stat插件
...
...
vendor/github.com/33cn/chain33/types/config.go
View file @
e74637e8
...
...
@@ -256,8 +256,14 @@ func Init(t string, cfg *Config) {
if
cfg
.
Exec
.
MinExecFee
>
cfg
.
Mempool
.
MinTxFee
||
cfg
.
Mempool
.
MinTxFee
>
cfg
.
Wallet
.
MinFee
{
panic
(
"config must meet: wallet.minFee >= mempool.minTxFee >= exec.minExecFee"
)
}
if
cfg
.
Exec
.
MaxExecFee
<
cfg
.
Mempool
.
MaxTxFee
{
panic
(
"config must meet: mempool.maxTxFee <= exec.maxExecFee"
)
}
setMinFee
(
cfg
.
Exec
.
MinExecFee
)
setChainConfig
(
"FixTime"
,
cfg
.
FixTime
)
if
cfg
.
Exec
.
MaxExecFee
>
0
{
setChainConfig
(
"MaxFee"
,
cfg
.
Exec
.
MaxExecFee
)
}
}
//local 只用于单元测试
if
isLocal
()
{
...
...
@@ -355,6 +361,7 @@ func setMinFee(fee int64) {
panic
(
"fee less than zero"
)
}
setChainConfig
(
"MinFee"
,
fee
)
setChainConfig
(
"MaxFee"
,
fee
*
10000
)
setChainConfig
(
"MinBalanceTransfer"
,
fee
*
10
)
}
...
...
vendor/github.com/33cn/chain33/types/testdata/bityuan.toml
View file @
e74637e8
...
...
@@ -66,6 +66,7 @@ keyFile="key.pem"
poolCacheSize
=
102400
minTxFee
=
100000
maxTxNumPerAccount
=
100
maxTxFee
=
1000000000
[consensus]
name
=
"ticket"
...
...
@@ -145,6 +146,7 @@ minerwhitelist=["*"]
[exec]
isFree
=
false
minExecFee
=
100000
maxExecFee
=
1000000000
enableStat
=
false
enableMVCC
=
false
...
...
vendor/github.com/33cn/chain33/types/testdata/chain33.toml
View file @
e74637e8
...
...
@@ -65,6 +65,7 @@ grpcFuncWhitelist=["*"]
poolCacheSize
=
10240
minTxFee
=
100000
maxTxNumPerAccount
=
10000
maxTxFee
=
1000000000
[consensus]
name
=
"ticket"
...
...
@@ -119,6 +120,7 @@ minerwhitelist=["*"]
[exec]
isFree
=
false
minExecFee
=
100000
maxExecFee
=
1000000000
enableStat
=
false
enableMVCC
=
false
alias
=
["token1:token","token2:token","token3:token"]
...
...
vendor/github.com/33cn/chain33/types/tx_test.go
View file @
e74637e8
...
...
@@ -34,7 +34,7 @@ func TestCreateGroupTx(t *testing.T) {
t
.
Error
(
err
)
return
}
err
=
group
.
Check
(
0
,
GInt
(
"MinFee"
),
GInt
(
"Max
Tx
Fee"
))
err
=
group
.
Check
(
0
,
GInt
(
"MinFee"
),
GInt
(
"MaxFee"
))
if
err
!=
nil
{
for
i
:=
0
;
i
<
len
(
group
.
Txs
);
i
++
{
t
.
Log
(
group
.
Txs
[
i
]
.
JSON
())
...
...
@@ -80,7 +80,7 @@ func TestCreateGroupTxWithSize(t *testing.T) {
return
}
err
=
group
.
Check
(
0
,
GInt
(
"MinFee"
),
GInt
(
"Max
Tx
Fee"
))
err
=
group
.
Check
(
0
,
GInt
(
"MinFee"
),
GInt
(
"MaxFee"
))
if
err
!=
nil
{
for
i
:=
0
;
i
<
len
(
group
.
Txs
);
i
++
{
t
.
Log
(
group
.
Txs
[
i
]
.
JSON
())
...
...
@@ -163,7 +163,7 @@ func TestSignGroupTx(t *testing.T) {
return
}
}
err
=
group
.
Check
(
0
,
GInt
(
"MinFee"
),
GInt
(
"Max
Tx
Fee"
))
err
=
group
.
Check
(
0
,
GInt
(
"MinFee"
),
GInt
(
"MaxFee"
))
if
err
!=
nil
{
t
.
Error
(
err
)
return
...
...
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