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
428c7583
Commit
428c7583
authored
Dec 03, 2018
by
linj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make ; make fmt
parent
5f25c6a4
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
28 additions
and
23 deletions
+28
-23
unfreeze.go
plugin/dapp/unfreeze/commands/unfreeze.go
+9
-7
exec.go
plugin/dapp/unfreeze/executor/exec.go
+5
-4
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
exec_test.go
plugin/dapp/unfreeze/executor/exec_test.go
+3
-2
means.go
plugin/dapp/unfreeze/executor/means.go
+1
-1
query.go
plugin/dapp/unfreeze/executor/query.go
+1
-1
unfreeze.go
plugin/dapp/unfreeze/executor/unfreeze.go
+1
-1
plugin.go
plugin/dapp/unfreeze/plugin.go
+1
-1
rpc.go
plugin/dapp/unfreeze/rpc/rpc.go
+2
-1
types.go
plugin/dapp/unfreeze/types/types.go
+1
-1
No files found.
plugin/dapp/unfreeze/commands/unfreeze.go
View file @
428c7583
...
...
@@ -8,13 +8,15 @@ import (
"encoding/hex"
"encoding/json"
"fmt"
"github.com/spf13/cobra"
"github.com/33cn/chain33/rpc/jsonclient"
"os"
"strings"
pty
"github.com/33cn/plugin/plugin/dapp/unfreeze/types"
"github.com/33cn/chain33/rpc/jsonclient"
rpctypes
"github.com/33cn/chain33/rpc/types"
"github.com/spf13/cobra"
"github.com/33cn/chain33/types"
pty
"github.com/33cn/plugin/plugin/dapp/unfreeze/types"
)
func
Cmd
()
*
cobra
.
Command
{
...
...
@@ -230,10 +232,10 @@ func queryWithdraw(cmd *cobra.Command, args []string) {
return
}
param
:=
&
types
.
Query4Cli
{
param
:=
&
rpctypes
.
Query4Jrpc
{
Execer
:
getRealExecName
(
paraName
,
pty
.
UnfreezeX
),
FuncName
:
"QueryWithdraw"
,
Payload
:
types
.
ReqString
{
Data
:
id
}
,
Payload
:
types
.
MustPBToJSON
(
&
types
.
ReqString
{
Data
:
id
})
,
}
var
resp
pty
.
ReplyQueryUnfreezeWithdraw
err
=
cli
.
Call
(
"Chain33.Query"
,
param
,
&
resp
)
...
...
@@ -260,10 +262,10 @@ func show(cmd *cobra.Command, args []string) {
return
}
param
:=
&
types
.
Query4Cli
{
param
:=
&
rpctypes
.
Query4Jrpc
{
Execer
:
getRealExecName
(
paraName
,
pty
.
UnfreezeX
),
FuncName
:
"GetUnfreeze"
,
Payload
:
types
.
ReqString
{
Data
:
id
}
,
Payload
:
types
.
MustPBToJSON
(
&
types
.
ReqString
{
Data
:
id
})
,
}
var
resp
pty
.
Unfreeze
err
=
cli
.
Call
(
"Chain33.Query"
,
param
,
&
resp
)
...
...
plugin/dapp/unfreeze/executor/exec.go
View file @
428c7583
...
...
@@ -7,9 +7,9 @@ package executor
import
(
"github.com/33cn/chain33/account"
dbm
"github.com/33cn/chain33/common/db"
pty
"github.com/33cn/plugin/plugin/dapp/unfreeze/types"
"github.com/33cn/chain33/system/dapp"
"github.com/33cn/chain33/types"
pty
"github.com/33cn/plugin/plugin/dapp/unfreeze/types"
)
func
(
u
*
Unfreeze
)
Exec_Create
(
payload
*
pty
.
UnfreezeCreate
,
tx
*
types
.
Transaction
,
index
int
)
(
*
types
.
Receipt
,
error
)
{
...
...
@@ -145,7 +145,8 @@ func (u *Unfreeze) create(unfreeze *pty.Unfreeze) (*types.Receipt, error) {
}
receiptLog
:=
getUnfreezeLog
(
nil
,
unfreeze
)
return
&
types
.
Receipt
{
KV
:
[]
*
types
.
KeyValue
{{
k
,
v
}},
Logs
:
[]
*
types
.
ReceiptLog
{
receiptLog
}},
nil
return
&
types
.
Receipt
{
Ty
:
types
.
ExecOk
,
KV
:
[]
*
types
.
KeyValue
{{
Key
:
k
,
Value
:
v
}},
Logs
:
[]
*
types
.
ReceiptLog
{
receiptLog
}},
nil
}
func
MergeReceipt
(
r1
*
types
.
Receipt
,
r2
*
types
.
Receipt
)
(
*
types
.
Receipt
,
error
)
{
...
...
@@ -185,7 +186,7 @@ func (u *Unfreeze) withdraw(unfreeze *pty.Unfreeze) (int64, *types.Receipt, erro
return
0
,
nil
,
err
}
return
amount
,
&
types
.
Receipt
{
Ty
:
types
.
ExecOk
,
KV
:
[]
*
types
.
KeyValue
{{
k
,
v
}},
return
amount
,
&
types
.
Receipt
{
Ty
:
types
.
ExecOk
,
KV
:
[]
*
types
.
KeyValue
{{
Key
:
k
,
Value
:
v
}},
Logs
:
[]
*
types
.
ReceiptLog
{
receiptLog
}},
nil
}
...
...
@@ -207,7 +208,7 @@ func (u *Unfreeze) terminator(unfreeze *pty.Unfreeze) (int64, *types.Receipt, er
return
0
,
nil
,
err
}
return
amount
,
&
types
.
Receipt
{
Ty
:
types
.
ExecOk
,
KV
:
[]
*
types
.
KeyValue
{{
k
,
v
}},
return
amount
,
&
types
.
Receipt
{
Ty
:
types
.
ExecOk
,
KV
:
[]
*
types
.
KeyValue
{{
Key
:
k
,
Value
:
v
}},
Logs
:
[]
*
types
.
ReceiptLog
{
receiptLog
}},
nil
}
...
...
plugin/dapp/unfreeze/executor/exec_del_local.go
View file @
428c7583
...
...
@@ -5,8 +5,8 @@
package
executor
import
(
uf
"github.com/33cn/plugin/plugin/dapp/unfreeze/types"
"github.com/33cn/chain33/types"
uf
"github.com/33cn/plugin/plugin/dapp/unfreeze/types"
)
func
(
u
*
Unfreeze
)
execDelLocal
(
receiptData
*
types
.
ReceiptData
)
(
*
types
.
LocalDBSet
,
error
)
{
...
...
plugin/dapp/unfreeze/executor/exec_local.go
View file @
428c7583
...
...
@@ -5,8 +5,8 @@
package
executor
import
(
uf
"github.com/33cn/plugin/plugin/dapp/unfreeze/types"
"github.com/33cn/chain33/types"
uf
"github.com/33cn/plugin/plugin/dapp/unfreeze/types"
)
func
(
u
*
Unfreeze
)
execLocal
(
receiptData
*
types
.
ReceiptData
)
(
*
types
.
LocalDBSet
,
error
)
{
...
...
@@ -44,8 +44,8 @@ func (u *Unfreeze) ExecLocal_Terminate(payload *uf.UnfreezeTerminate, tx *types.
}
func
localKeys
(
res
*
uf
.
ReceiptUnfreeze
,
value
[]
byte
)
(
kvs
[]
*
types
.
KeyValue
)
{
kvs
=
append
(
kvs
,
&
types
.
KeyValue
{
initKey
(
res
.
Current
.
Initiator
),
value
})
kvs
=
append
(
kvs
,
&
types
.
KeyValue
{
beneficiaryKey
(
res
.
Current
.
Beneficiary
),
value
})
kvs
=
append
(
kvs
,
&
types
.
KeyValue
{
Key
:
initKey
(
res
.
Current
.
Initiator
),
Value
:
value
})
kvs
=
append
(
kvs
,
&
types
.
KeyValue
{
Key
:
beneficiaryKey
(
res
.
Current
.
Beneficiary
),
Value
:
value
})
return
}
...
...
plugin/dapp/unfreeze/executor/exec_test.go
View file @
428c7583
...
...
@@ -5,16 +5,17 @@
package
executor
import
(
"github.com/stretchr/testify/assert"
"testing"
"github.com/stretchr/testify/assert"
"github.com/33cn/chain33/account"
"github.com/33cn/chain33/common"
"github.com/33cn/chain33/common/address"
"github.com/33cn/chain33/common/crypto"
dbm
"github.com/33cn/chain33/common/db"
pty
"github.com/33cn/plugin/plugin/dapp/unfreeze/types"
"github.com/33cn/chain33/types"
pty
"github.com/33cn/plugin/plugin/dapp/unfreeze/types"
)
type
execEnv
struct
{
...
...
plugin/dapp/unfreeze/executor/means.go
View file @
428c7583
...
...
@@ -5,8 +5,8 @@
package
executor
import
(
pty
"github.com/33cn/plugin/plugin/dapp/unfreeze/types"
"github.com/33cn/chain33/types"
pty
"github.com/33cn/plugin/plugin/dapp/unfreeze/types"
)
type
Means
interface
{
...
...
plugin/dapp/unfreeze/executor/query.go
View file @
428c7583
...
...
@@ -8,8 +8,8 @@ import (
"time"
dbm
"github.com/33cn/chain33/common/db"
pty
"github.com/33cn/plugin/plugin/dapp/unfreeze/types"
"github.com/33cn/chain33/types"
pty
"github.com/33cn/plugin/plugin/dapp/unfreeze/types"
)
func
(
u
*
Unfreeze
)
Query_GetUnfreezeWithdraw
(
in
*
types
.
ReqString
)
(
types
.
Message
,
error
)
{
...
...
plugin/dapp/unfreeze/executor/unfreeze.go
View file @
428c7583
...
...
@@ -6,9 +6,9 @@ package executor
import
(
log
"github.com/33cn/chain33/common/log/log15"
uf
"github.com/33cn/plugin/plugin/dapp/unfreeze/types"
drivers
"github.com/33cn/chain33/system/dapp"
"github.com/33cn/chain33/types"
uf
"github.com/33cn/plugin/plugin/dapp/unfreeze/types"
)
var
uflog
=
log
.
New
(
"module"
,
"execs.unfreeze"
)
...
...
plugin/dapp/unfreeze/plugin.go
View file @
428c7583
...
...
@@ -5,11 +5,11 @@
package
unfreeze
import
(
"github.com/33cn/chain33/pluginmgr"
"github.com/33cn/plugin/plugin/dapp/unfreeze/commands"
"github.com/33cn/plugin/plugin/dapp/unfreeze/executor"
"github.com/33cn/plugin/plugin/dapp/unfreeze/rpc"
uf
"github.com/33cn/plugin/plugin/dapp/unfreeze/types"
"github.com/33cn/chain33/pluginmgr"
)
func
init
()
{
...
...
plugin/dapp/unfreeze/rpc/rpc.go
View file @
428c7583
...
...
@@ -7,8 +7,9 @@ package rpc
import
(
"context"
"encoding/hex"
pty
"github.com/33cn/plugin/plugin/dapp/unfreeze/types"
"github.com/33cn/chain33/types"
pty
"github.com/33cn/plugin/plugin/dapp/unfreeze/types"
)
func
(
c
*
channelClient
)
GetUnfreeze
(
ctx
context
.
Context
,
in
*
types
.
ReqString
)
(
*
pty
.
Unfreeze
,
error
)
{
...
...
plugin/dapp/unfreeze/types/types.go
View file @
428c7583
...
...
@@ -10,8 +10,8 @@ import (
"reflect"
"time"
log
"github.com/33cn/chain33/common/log/log15"
"github.com/33cn/chain33/common/address"
log
"github.com/33cn/chain33/common/log/log15"
"github.com/33cn/chain33/types"
)
...
...
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