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
5d527518
Commit
5d527518
authored
Jan 25, 2019
by
vipwzw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto ci
parent
3ffe01ad
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
33 deletions
+29
-33
unfreeze.go
plugin/dapp/unfreeze/commands/unfreeze.go
+8
-10
exec_del_local.go
plugin/dapp/unfreeze/executor/exec_del_local.go
+1
-1
exec_local.go
plugin/dapp/unfreeze/executor/exec_local.go
+3
-3
localdb.go
plugin/dapp/unfreeze/executor/localdb.go
+1
-2
means.go
plugin/dapp/unfreeze/executor/means.go
+0
-1
query.go
plugin/dapp/unfreeze/executor/query.go
+16
-16
No files found.
plugin/dapp/unfreeze/commands/unfreeze.go
View file @
5d527518
...
...
@@ -348,7 +348,6 @@ func jsonOutput(resp types.Message) {
fmt
.
Println
(
buf
.
String
())
}
func
listUnfreezeCmd
()
*
cobra
.
Command
{
cmd
:=
&
cobra
.
Command
{
Use
:
"list"
,
...
...
@@ -359,7 +358,6 @@ func listUnfreezeCmd() *cobra.Command {
cmd
.
Flags
()
.
Int32P
(
"count"
,
""
,
10
,
"list count"
)
cmd
.
Flags
()
.
Int32P
(
"direction"
,
"d"
,
0
,
"list direction: 0/1"
)
cmd
.
Flags
()
.
StringP
(
"create"
,
"c"
,
""
,
"list by creator"
)
cmd
.
Flags
()
.
StringP
(
"beneficiary"
,
"b"
,
""
,
"list by beneficiary"
)
...
...
@@ -381,16 +379,16 @@ func listUnfreeze(cmd *cobra.Command, args []string) {
funcName
=
"ListUnfreezeByCreator"
}
direction
,
err
:=
cmd
.
Flags
()
.
GetInt32
(
"direction"
)
count
,
_
:=
cmd
.
Flags
()
.
GetInt32
(
"count"
)
last_key
,
_
:=
cmd
.
Flags
()
.
GetString
(
"last_key"
)
direction
,
err
:=
cmd
.
Flags
()
.
GetInt32
(
"direction"
)
count
,
_
:=
cmd
.
Flags
()
.
GetInt32
(
"count"
)
last_key
,
_
:=
cmd
.
Flags
()
.
GetString
(
"last_key"
)
req
:=
&
pty
.
ReqUnfreezes
{
Direction
:
direction
,
Count
:
count
,
FromKey
:
last_key
,
Initiator
:
create
,
Beneficiary
:
beneficiary
,
Direction
:
direction
,
Count
:
count
,
FromKey
:
last_key
,
Initiator
:
create
,
Beneficiary
:
beneficiary
,
}
param
:=
&
rpctypes
.
Query4Jrpc
{
...
...
plugin/dapp/unfreeze/executor/exec_del_local.go
View file @
5d527518
...
...
@@ -5,9 +5,9 @@
package
executor
import
(
"github.com/33cn/chain33/system/dapp"
"github.com/33cn/chain33/types"
uf
"github.com/33cn/plugin/plugin/dapp/unfreeze/types"
"github.com/33cn/chain33/system/dapp"
)
func
(
u
*
Unfreeze
)
execDelLocal
(
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
...
...
plugin/dapp/unfreeze/executor/exec_local.go
View file @
5d527518
...
...
@@ -5,9 +5,9 @@
package
executor
import
(
"github.com/33cn/chain33/system/dapp"
"github.com/33cn/chain33/types"
uf
"github.com/33cn/plugin/plugin/dapp/unfreeze/types"
"github.com/33cn/chain33/system/dapp"
)
func
(
u
*
Unfreeze
)
execLocal
(
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
...
...
@@ -37,8 +37,8 @@ func (u *Unfreeze) execLocal(receiptData *types.ReceiptData, index int) (*types.
return
nil
,
err
}
u
:=
uf
.
LocalUnfreeze
{
Unfreeze
:
receipt
.
Current
,
TxIndex
:
txIndex
,
Unfreeze
:
receipt
.
Current
,
TxIndex
:
txIndex
,
}
err
=
table
.
Add
(
&
u
)
if
err
!=
nil
{
...
...
plugin/dapp/unfreeze/executor/localdb.go
View file @
5d527518
...
...
@@ -77,7 +77,7 @@ func NewAddrTable(kvdb dbm.KV) *table.Table {
return
t
}
func
update
(
ldb
*
table
.
Table
,
unfreeze
*
pty
.
Unfreeze
)
(
error
)
{
func
update
(
ldb
*
table
.
Table
,
unfreeze
*
pty
.
Unfreeze
)
error
{
xs
,
err
:=
ldb
.
ListIndex
(
"id"
,
[]
byte
(
unfreeze
.
UnfreezeID
),
nil
,
1
,
0
)
if
err
!=
nil
||
len
(
xs
)
!=
1
{
return
nil
...
...
@@ -91,7 +91,6 @@ func update(ldb *table.Table, unfreeze *pty.Unfreeze) (error) {
return
ldb
.
Update
([]
byte
(
u
.
TxIndex
),
u
)
}
func
list
(
db
dbm
.
KVDB
,
indexName
string
,
data
*
pty
.
LocalUnfreeze
,
count
,
direction
int32
)
([]
*
table
.
Row
,
error
)
{
query
:=
NewAddrTable
(
db
)
.
GetQuery
(
db
)
var
primary
[]
byte
...
...
plugin/dapp/unfreeze/executor/means.go
View file @
5d527518
...
...
@@ -97,7 +97,6 @@ func withdraw(unfreeze *pty.Unfreeze, frozen int64) (*pty.Unfreeze, int64) {
return
unfreeze
,
amount
}
type
fixAmountV2
struct
{
}
...
...
plugin/dapp/unfreeze/executor/query.go
View file @
5d527518
...
...
@@ -8,9 +8,9 @@ import (
"time"
dbm
"github.com/33cn/chain33/common/db"
"github.com/33cn/chain33/common/db/table"
"github.com/33cn/chain33/types"
pty
"github.com/33cn/plugin/plugin/dapp/unfreeze/types"
"github.com/33cn/chain33/common/db/table"
)
// Query_GetUnfreezeWithdraw 查询合约可提币量
...
...
@@ -87,7 +87,7 @@ func ListUnfreezeByCreator(ldb dbm.KVDB, req *pty.ReqUnfreezes) (types.Message,
rows
,
err
:=
list
(
ldb
,
"init"
,
u
,
req
.
Count
,
req
.
Direction
)
if
err
!=
nil
{
uflog
.
Error
(
"ListUnfreezeByCreator "
,
"err"
,
err
,
"params"
,
req
)
uflog
.
Error
(
"ListUnfreezeByCreator "
,
"err"
,
err
,
"params"
,
req
)
return
nil
,
err
}
...
...
@@ -107,7 +107,7 @@ func ListUnfreezeByBeneficiary(ldb dbm.KVDB, req *pty.ReqUnfreezes) (types.Messa
rows
,
err
:=
list
(
ldb
,
"beneficiary"
,
u
,
req
.
Count
,
req
.
Direction
)
if
err
!=
nil
{
uflog
.
Error
(
"ListUnfreezeByBeneficiary "
,
"err"
,
err
,
"params"
,
req
)
uflog
.
Error
(
"ListUnfreezeByBeneficiary "
,
"err"
,
err
,
"params"
,
req
)
return
nil
,
err
}
...
...
@@ -119,21 +119,21 @@ func fmtLocalUnfreeze(rows []*table.Row) (*pty.ReplyUnfreezes, error) {
for
_
,
row
:=
range
rows
{
r
,
ok
:=
row
.
Data
.
(
*
pty
.
LocalUnfreeze
)
if
!
ok
{
uflog
.
Error
(
"ListUnfreeze"
,
"err"
,
"bad row type"
)
uflog
.
Error
(
"ListUnfreeze"
,
"err"
,
"bad row type"
)
return
nil
,
types
.
ErrDecode
}
v
:=
&
pty
.
ReplyUnfreeze
{
UnfreezeID
:
r
.
Unfreeze
.
UnfreezeID
,
StartTime
:
r
.
Unfreeze
.
StartTime
,
AssetExec
:
r
.
Unfreeze
.
AssetExec
,
AssetSymbol
:
r
.
Unfreeze
.
AssetSymbol
,
TotalCount
:
r
.
Unfreeze
.
TotalCount
,
Initiator
:
r
.
Unfreeze
.
Initiator
,
Beneficiary
:
r
.
Unfreeze
.
Beneficiary
,
Remaining
:
r
.
Unfreeze
.
Remaining
,
Means
:
r
.
Unfreeze
.
Means
,
Terminated
:
r
.
Unfreeze
.
Terminated
,
Key
:
r
.
TxIndex
,
v
:=
&
pty
.
ReplyUnfreeze
{
UnfreezeID
:
r
.
Unfreeze
.
UnfreezeID
,
StartTime
:
r
.
Unfreeze
.
StartTime
,
AssetExec
:
r
.
Unfreeze
.
AssetExec
,
AssetSymbol
:
r
.
Unfreeze
.
AssetSymbol
,
TotalCount
:
r
.
Unfreeze
.
TotalCount
,
Initiator
:
r
.
Unfreeze
.
Initiator
,
Beneficiary
:
r
.
Unfreeze
.
Beneficiary
,
Remaining
:
r
.
Unfreeze
.
Remaining
,
Means
:
r
.
Unfreeze
.
Means
,
Terminated
:
r
.
Unfreeze
.
Terminated
,
Key
:
r
.
TxIndex
,
}
if
v
.
Means
==
pty
.
FixAmountX
{
v
.
MeansOpt
=
&
pty
.
ReplyUnfreeze_FixAmount
{
FixAmount
:
r
.
Unfreeze
.
GetFixAmount
()}
...
...
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