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
bd063a54
Commit
bd063a54
authored
Jan 22, 2019
by
jiangpeng
Committed by
vipwzw
Jan 23, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除隐私集成发送的rpc
parent
f940942f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
110 deletions
+0
-110
rpc.go
plugin/dapp/privacy/rpc/rpc.go
+0
-62
rpc_channel_test.go
plugin/dapp/privacy/rpc/rpc_channel_test.go
+0
-48
No files found.
plugin/dapp/privacy/rpc/rpc.go
View file @
bd063a54
...
...
@@ -33,33 +33,6 @@ func (g *channelClient) CreateUTXOs(ctx context.Context, in *pty.ReqCreateUTXOs)
return
data
.
(
*
types
.
Reply
),
nil
}
// 将资金从公开到隐私转移
func
(
g
*
channelClient
)
MakeTxPublic2Privacy
(
ctx
context
.
Context
,
in
*
pty
.
ReqPub2Pri
)
(
*
types
.
Reply
,
error
)
{
data
,
err
:=
g
.
ExecWalletFunc
(
pty
.
PrivacyX
,
"Public2Privacy"
,
in
)
if
err
!=
nil
{
return
nil
,
err
}
return
data
.
(
*
types
.
Reply
),
nil
}
// 将资产从隐私到隐私进行转移
func
(
g
*
channelClient
)
MakeTxPrivacy2Privacy
(
ctx
context
.
Context
,
in
*
pty
.
ReqPri2Pri
)
(
*
types
.
Reply
,
error
)
{
data
,
err
:=
g
.
ExecWalletFunc
(
pty
.
PrivacyX
,
"Privacy2Privacy"
,
in
)
if
err
!=
nil
{
return
nil
,
err
}
return
data
.
(
*
types
.
Reply
),
nil
}
// 将资产从隐私到公开进行转移
func
(
g
*
channelClient
)
MakeTxPrivacy2Public
(
ctx
context
.
Context
,
in
*
pty
.
ReqPri2Pub
)
(
*
types
.
Reply
,
error
)
{
data
,
err
:=
g
.
ExecWalletFunc
(
pty
.
PrivacyX
,
"Privacy2Public"
,
in
)
if
err
!=
nil
{
return
nil
,
err
}
return
data
.
(
*
types
.
Reply
),
nil
}
// 扫描UTXO以及获取扫描UTXO后的状态
func
(
g
*
channelClient
)
RescanUtxos
(
ctx
context
.
Context
,
in
*
pty
.
ReqRescanUtxos
)
(
*
pty
.
RepRescanUtxos
,
error
)
{
data
,
err
:=
g
.
ExecWalletFunc
(
pty
.
PrivacyX
,
"RescanUtxos"
,
in
)
...
...
@@ -122,41 +95,6 @@ func (c *Jrpc) ShowPrivacykey(in *types.ReqString, result *json.RawMessage) erro
return
err
}
// MakeTxPublic2privacy create public to privacy trasaction for json rpc
func
(
c
*
Jrpc
)
MakeTxPublic2privacy
(
in
*
pty
.
ReqPub2Pri
,
result
*
interface
{})
error
{
reply
,
err
:=
c
.
cli
.
MakeTxPublic2Privacy
(
context
.
Background
(),
in
)
if
err
!=
nil
{
return
err
}
*
result
=
rpctypes
.
ReplyHash
{
Hash
:
common
.
ToHex
(
reply
.
GetMsg
())}
return
nil
}
// MakeTxPrivacy2privacy create privacy to privacy transaction
func
(
c
*
Jrpc
)
MakeTxPrivacy2privacy
(
in
*
pty
.
ReqPri2Pri
,
result
*
interface
{})
error
{
reply
,
err
:=
c
.
cli
.
MakeTxPrivacy2Privacy
(
context
.
Background
(),
in
)
if
err
!=
nil
{
return
err
}
*
result
=
rpctypes
.
ReplyHash
{
Hash
:
common
.
ToHex
(
reply
.
GetMsg
())}
return
nil
}
// MakeTxPrivacy2public make privacy to public trasaction
func
(
c
*
Jrpc
)
MakeTxPrivacy2public
(
in
*
pty
.
ReqPri2Pub
,
result
*
interface
{})
error
{
reply
,
err
:=
c
.
cli
.
MakeTxPrivacy2Public
(
context
.
Background
(),
in
)
if
err
!=
nil
{
return
err
}
*
result
=
rpctypes
.
ReplyHash
{
Hash
:
common
.
ToHex
(
reply
.
GetMsg
())}
return
nil
}
// CreateUTXOs create utxos for json rpc
func
(
c
*
Jrpc
)
CreateUTXOs
(
in
*
pty
.
ReqCreateUTXOs
,
result
*
interface
{})
error
{
...
...
plugin/dapp/privacy/rpc/rpc_channel_test.go
View file @
bd063a54
...
...
@@ -45,10 +45,6 @@ func TestRPCChannel(t *testing.T) {
{
fn
:
testShowPrivacyKey
},
{
fn
:
testShowPrivacyAccountInfo
},
{
fn
:
testShowPrivacyAccountSpend
},
{
fn
:
testPublic2Privacy
},
{
fn
:
testPrivacy2Privacy
},
{
fn
:
testPrivacy2Public
},
{
fn
:
testPrivacy2Public
},
{
fn
:
testShowAmountsOfUTXO
},
{
fn
:
testShowUTXOs4SpecifiedAmount
},
{
fn
:
testCreateUTXOs
},
...
...
@@ -98,50 +94,6 @@ func testShowPrivacyAccountSpend(t *testing.T, jrpc *jsonclient.JSONClient) erro
return
err
}
func
testPublic2Privacy
(
t
*
testing
.
T
,
jrpc
*
jsonclient
.
JSONClient
)
error
{
params
:=
pty
.
ReqPub2Pri
{
Sender
:
"13cS5G1BDN2YfGudsxRxr7X25yu6ZdgxMU"
,
Pubkeypair
:
"92fe6cfec2e19cd15f203f83b5d440ddb63d0cb71559f96dc81208d819fea85886b08f6e874fca15108d244b40f9086d8c03260d4b954a40dfb3cbe41ebc7389"
,
Amount
:
1234
,
Note
:
"for test"
,
Tokenname
:
types
.
BTY
,
Expire
:
int64
(
time
.
Hour
),
}
var
res
rpctypes
.
ReplyHash
err
:=
jrpc
.
Call
(
"privacy.MakeTxPublic2privacy"
,
params
,
&
res
)
return
err
}
func
testPrivacy2Privacy
(
t
*
testing
.
T
,
jrpc
*
jsonclient
.
JSONClient
)
error
{
params
:=
pty
.
ReqPri2Pri
{
Sender
:
"13cS5G1BDN2YfGudsxRxr7X25yu6ZdgxMU"
,
Pubkeypair
:
"92fe6cfec2e19cd15f203f83b5d440ddb63d0cb71559f96dc81208d819fea85886b08f6e874fca15108d244b40f9086d8c03260d4b954a40dfb3cbe41ebc7389"
,
Amount
:
234567
,
Mixin
:
16
,
Note
:
"for test"
,
Tokenname
:
types
.
BTY
,
Expire
:
int64
(
time
.
Hour
),
}
var
res
rpctypes
.
ReplyHash
err
:=
jrpc
.
Call
(
"privacy.MakeTxPrivacy2privacy"
,
params
,
&
res
)
return
err
}
func
testPrivacy2Public
(
t
*
testing
.
T
,
jrpc
*
jsonclient
.
JSONClient
)
error
{
params
:=
pty
.
ReqPri2Pub
{
Sender
:
"13cS5G1BDN2YfGudsxRxr7X25yu6ZdgxMU"
,
Receiver
:
"1EDDghAtgBsamrNEtNmYdQzC1QEhLkr87t"
,
Amount
:
123456
,
Note
:
"for test"
,
Tokenname
:
types
.
BTY
,
Mixin
:
16
,
Expire
:
int64
(
time
.
Hour
),
}
var
res
rpctypes
.
ReplyHash
err
:=
jrpc
.
Call
(
"privacy.MakeTxPrivacy2public"
,
params
,
&
res
)
return
err
}
func
testShowAmountsOfUTXO
(
t
*
testing
.
T
,
jrpc
*
jsonclient
.
JSONClient
)
error
{
reqPrivacyToken
:=
pty
.
ReqPrivacyToken
{
Token
:
types
.
BTY
}
...
...
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