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
37ee074c
Commit
37ee074c
authored
Nov 01, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
f
parent
11f9ce15
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
40 deletions
+46
-40
IssueCoinController.php
api/controllers/IssueCoinController.php
+7
-2
CoinIssueChainRecord.php
common/models/psources/CoinIssueChainRecord.php
+1
-1
CrossChainController.php
console/controllers/CrossChainController.php
+0
-31
IssueChainTransferController.php
console/controllers/IssueChainTransferController.php
+38
-6
No files found.
api/controllers/IssueCoinController.php
View file @
37ee074c
...
...
@@ -51,7 +51,8 @@ class IssueCoinController extends BaseController
}
$pre_create_tx
=
isset
(
$result
[
'pre_create_tx'
])
?
$result
[
'pre_create_tx'
]
:
''
;
if
(
false
==
$pre_create_tx
)
{
$pre_send_transaction
=
isset
(
$result
[
'pre_send_transaction'
])
?
$result
[
'pre_send_transaction'
]
:
''
;
if
(
false
==
$pre_create_tx
||
false
==
$pre_send_transaction
)
{
$msg
=
'预签名错误'
;
$code
=
-
1
;
goto
doEnd
;
...
...
@@ -81,7 +82,11 @@ class IssueCoinController extends BaseController
$params
=
[
'pre_create_tx'
=>
$pre_create_tx
,
'finish_tx'
=>
'0'
,
'pre_send_transaction'
=>
$pre_send_transaction
,
'pre_query_transaction'
=>
'standby'
,
'finish_tx'
=>
'standby'
,
'finish_send_transaction'
=>
'standby'
,
'finish_query_transaction'
=>
'standby'
,
'issue_coin_id'
=>
$data
,
];
$transfer_model
=
new
CoinIssueChainRecord
();
...
...
common/models/psources/CoinIssueChainRecord.php
View file @
37ee074c
...
...
@@ -31,7 +31,7 @@ class CoinIssueChainRecord extends CommonActiveRecord
public
function
scenarios
()
{
$scenarios
=
[
self
::
SCENARIOS_PRE_CREATE
=>
[
'pre_create_tx'
,
'
issue_coin_id'
,
'finish_tx
'
],
self
::
SCENARIOS_PRE_CREATE
=>
[
'pre_create_tx'
,
'
pre_send_transaction'
,
'pre_query_transaction'
,
'finish_tx'
,
'finish_send_transaction'
,
'finish_query_transaction'
,
'issue_coin_id
'
],
];
return
array_merge
(
parent
::
scenarios
(),
$scenarios
);
}
...
...
console/controllers/CrossChainController.php
View file @
37ee074c
...
...
@@ -207,36 +207,5 @@ class CrossChainController extends Controller
$this
->
queryTransaction
(
$node_params
,
$result
[
'result'
][
'tx'
][
'next'
]);
}
return
$result
;
// if (isset($result['result']['actionName']) && 'unknown' == $result['result']['actionName']) {
// if (isset($result['result']['tx']['next'])) {
// $this->queryTransaction($node_params, $result['result']['tx']['next']);
// }
// }
//
// if (isset($result['result']['receipt']['ty']) && 2 == $result['result']['receipt']['ty']){
// if (isset($result['result']['tx']['next'])) {
// $this->queryTransaction($node_params, $result['result']['tx']['next']);
// }
// }
//
// return $result;
// if (isset($result['result']['receipt']) && is_array($result['result']['receipt']['logs'])){
// foreach ($result['result']['receipt']['logs'] as $log) {
// if (isset($log['tyName']) && 'logerr' == strtolower($log['tyName'])){
// return $result;
// }
// }
// }
// static $result = [];
// $service = new Chain33Service($node_params);
// $result = $service->QueryTransaction($send_result);
// echo json_encode($result) . PHP_EOL;
// if (isset($result['result']['tx']['next'])) {
// $this->queryTransaction($node_params, $result['result']['tx']['next']);
// }
// return $result;
}
}
console/controllers/IssueChainTransferController.php
View file @
37ee074c
...
...
@@ -14,8 +14,8 @@ class IssueChainTransferController extends Controller
if
(
1
==
$step
)
{
$columns
=
[
'id'
,
'pre_create_tx'
,
'issue_coin_id'
];
$condition
=
[
'pre_send_transaction'
=>
'
0
'
,
'pre_query_transaction'
=>
'
0
'
'pre_send_transaction'
=>
'
standby
'
,
'pre_query_transaction'
=>
'
standby
'
];
}
...
...
@@ -23,8 +23,8 @@ class IssueChainTransferController extends Controller
$columns
=
[
'id'
,
'finish_tx'
,
'issue_coin_id'
];
$condition
=
[
'pre_query_transaction'
=>
'success'
,
'finish_send_transaction'
=>
'
0
'
,
'finish_query_transaction'
=>
'
0
'
'finish_send_transaction'
=>
'
standby
'
,
'finish_query_transaction'
=>
'
standby
'
];
}
...
...
@@ -62,11 +62,11 @@ class IssueChainTransferController extends Controller
public
function
actionQueryTransaction
(
$step
)
{
if
(
1
==
$step
)
{
$model
=
CoinIssueChainRecord
::
find
()
->
where
([
'<>'
,
'pre_send_transaction'
,
'
0
'
])
->
all
();
$model
=
CoinIssueChainRecord
::
find
()
->
where
([
'<>'
,
'pre_send_transaction'
,
'
standby
'
])
->
all
();
}
if
(
2
==
$step
)
{
$model
=
CoinIssueChainRecord
::
find
()
->
where
([
'<>'
,
'pre_send_transaction'
,
'
0'
])
->
andWhere
([
'<>'
,
'finish_send_transaction'
,
'0
'
])
->
all
();
$model
=
CoinIssueChainRecord
::
find
()
->
where
([
'<>'
,
'pre_send_transaction'
,
'
standby'
])
->
andWhere
([
'<>'
,
'finish_send_transaction'
,
'standby
'
])
->
all
();
}
if
(
false
==
$model
)
{
...
...
@@ -74,7 +74,39 @@ class IssueChainTransferController extends Controller
return
0
;
}
$node
=
\Yii
::
$app
->
params
[
'chain_parallel'
][
'primary'
];
$service
=
new
Chain33Service
(
$node
);
foreach
(
$model
as
$val
)
{
if
(
1
==
$step
)
{
$result
=
$service
->
QueryTransaction
(
$val
->
pre_send_transaction
);
}
if
(
2
==
$step
)
{
$result
=
$service
->
QueryTransaction
(
$val
->
finish_send_transaction
);
}
if
(
isset
(
$result
[
'result'
][
'actionName'
])
&&
'unknown'
==
$result
[
'result'
][
'actionName'
])
{
$query_result
=
'success'
;
$msg
=
'success'
;
goto
doEnd
;
}
else
if
(
isset
(
$result
[
'result'
][
'receipt'
][
'ty'
])
&&
2
==
$result
[
'result'
][
'receipt'
][
'ty'
])
{
$query_result
=
'success'
;
$msg
=
'success'
;
goto
doEnd
;
}
else
{
if
(
isset
(
$result
[
'result'
][
'receipt'
][
'logs'
]))
{
foreach
(
$result
[
'result'
][
'receipt'
][
'logs'
]
as
$log
)
{
if
(
isset
(
$log
[
'tyName'
])
&&
'LogErr'
==
$log
[
'tyName'
])
{
$msg
=
$log
[
'tyName'
];
break
;
}
}
}
else
{
$msg
=
$result
[
'msg'
];
}
$query_result
=
$result
[
'code'
];
goto
doEnd
;
}
doEnd
:
}
}
...
...
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