Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
token
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
wallet
token
Commits
1d33f3e2
Commit
1d33f3e2
authored
Nov 05, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
撤消交易
parent
a84ae5da
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
7 deletions
+59
-7
CoinIssueCoin.php
common/models/psources/CoinIssueCoin.php
+9
-7
Chain33Service.php
common/service/chain33/Chain33Service.php
+9
-0
IssueChainTransferController.php
console/controllers/IssueChainTransferController.php
+41
-0
No files found.
common/models/psources/CoinIssueCoin.php
View file @
1d33f3e2
...
@@ -14,13 +14,15 @@ class CoinIssueCoin extends CommonActiveRecord
...
@@ -14,13 +14,15 @@ class CoinIssueCoin extends CommonActiveRecord
const
ALLOW_PAY
=
1
;
const
ALLOW_PAY
=
1
;
const
SUCCESS_PAY
=
2
;
const
SUCCESS_PAY
=
2
;
const
UN_AUDIT
=
0
;
const
UN_AUDIT
=
0
;
//允许发行(管理员)
const
ALLOW_ISSUE
=
1
;
const
ALLOW_ISSUE
=
1
;
//允许发行(管理员)
const
REFUSE_ISSUE
=
2
;
const
REFUSE_ISSUE
=
2
;
//拒绝发行
const
SUCCESS_ISSUE
=
3
;
const
SUCCESS_ISSUE
=
3
;
//发行成功
const
FAIL_ISSUE
=
4
;
const
FAIL_ISSUE
=
4
;
//发行失败
const
CANCEL_ISSUE
=
5
;
const
CANCEL_ISSUE
=
5
;
//已撤消
const
ALLOWED_ISSUE
=
6
;
const
ALLOWED_ISSUE
=
6
;
//允许发行(申请者)
const
CANCEL_SUCCESS
=
7
;
//撤消成功
const
CANCEL_FAIL
=
8
;
//撤消失败
//定义场景
//定义场景
const
SCENARIOS_CREATE
=
'create'
;
const
SCENARIOS_CREATE
=
'create'
;
...
...
common/service/chain33/Chain33Service.php
View file @
1d33f3e2
...
@@ -322,6 +322,15 @@ class Chain33Service
...
@@ -322,6 +322,15 @@ class Chain33Service
return
$this
->
send
(
$params
,
'token.CreateRawTokenFinishTx'
);
return
$this
->
send
(
$params
,
'token.CreateRawTokenFinishTx'
);
}
}
public
function
createRawTokenRevokeTx
(
$symbol
,
$owner
)
{
$params
=
[
'symbol'
=>
$symbol
,
'owner'
=>
$owner
];
return
$this
->
send
(
$params
,
'token.CreateRawTokenRevokeTx'
);
}
public
function
getBlock2MainInfo
(
$start
,
$end
)
public
function
getBlock2MainInfo
(
$start
,
$end
)
{
{
$params
=
[
$params
=
[
...
...
console/controllers/IssueChainTransferController.php
View file @
1d33f3e2
...
@@ -215,6 +215,47 @@ class IssueChainTransferController extends Controller
...
@@ -215,6 +215,47 @@ class IssueChainTransferController extends Controller
return
0
;
return
0
;
}
}
public
function
actionCancel
()
{
$issue_coin_model
=
CoinIssueCoin
::
find
()
->
where
([
'status'
=>
CoinIssueCoin
::
CANCEL_ISSUE
])
->
all
();
if
(
false
==
$issue_coin_model
)
{
echo
date
(
'Y-m-d H:i:s'
)
.
'暂无需要撤消的发行'
.
PHP_EOL
;
return
0
;
}
$node
=
Yii
::
$app
->
params
[
'chain_nodes'
][
'STO'
];
$chain_service
=
new
Chain33Service
(
$node
);
foreach
(
$issue_coin_model
as
$val
)
{
$data
=
[];
$result
=
$chain_service
->
createRawTokenRevokeTx
(
$val
->
symbol
,
$val
->
owner
);
if
(
null
==
$val
->
transfer
)
{
$status
=
CoinIssueCoin
::
CANCEL_FAIL
;
goto
doEnd
;
}
if
(
null
!=
$result
[
'error'
])
{
$status
=
CoinIssueCoin
::
CANCEL_FAIL
;
$data
=
[
'pre_query_transaction'
=>
$result
[
'error'
]
];
goto
doEnd
;
}
$status
=
CoinIssueCoin
::
CANCEL_SUCCESS
;
$data
=
[
'pre_query_transaction'
=>
$result
[
'result'
]
];
doEnd
:
CoinIssueCoin
::
updateAll
([
'status'
=>
$status
],
[
'id'
=>
$val
->
id
,
]);
if
(
false
!=
$data
)
{
CoinIssueChainRecord
::
updateAll
(
$data
,
[
'issue_coin_id'
=>
$val
->
id
,
]);
}
}
echo
date
(
'Y-m-d H:i:s'
)
.
'已撤消'
.
PHP_EOL
;
return
0
;
}
public
function
syncCoin
(
$params
=
[])
public
function
syncCoin
(
$params
=
[])
{
{
...
...
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