Skip to content

Commit ab3679c

Browse files
committed
Merge branch 'develop' into feature/fix-get-token-recursion
2 parents 0d6de7d + 9dd5506 commit ab3679c

File tree

8 files changed

+119
-70
lines changed

8 files changed

+119
-70
lines changed

api/controller.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ public function getPoolAddresses(){
597597
public function getPoolLastTransactions(){
598598
$result = array();
599599
$poolId = $this->getRequest('poolId', FALSE);
600-
$period = max(min(abs((int)$this->getRequest('period', 86400)), 864000), 1);
600+
$period = max(min(abs((int)$this->getRequest('period', 600)), 864000), 1);
601601
if($poolId){
602602
$result = $this->db->getPoolLastTransactions($poolId, $period);
603603
}
@@ -613,7 +613,7 @@ public function getPoolLastTransactions(){
613613
public function getPoolLastOperations(){
614614
$result = array();
615615
$poolId = $this->getRequest('poolId', FALSE);
616-
$period = max(min(abs((int)$this->getRequest('period', 86400)), 864000), 1);
616+
$period = max(min(abs((int)$this->getRequest('period', 600)), 864000), 1);
617617
if($poolId){
618618
$result = $this->db->getPoolLastOperations($poolId, $period);
619619
}

api/widget.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1406,7 +1406,7 @@ ethplorerWidget.Type['tokenHistoryGrouped'] = function(element, options, templat
14061406
title: 'Token operations',
14071407
format: '#,### K',
14081408
viewWindow: {
1409-
max: 1000
1409+
max: 1250
14101410
},
14111411
},
14121412
1: {
@@ -1714,7 +1714,7 @@ ethplorerWidget.Type['tokenPriceHistoryGrouped'] = function(element, options, te
17141714
rangeStart = new Date(strFirstDate);
17151715
var date = stDate.getDate();
17161716
fnDate.setDate(date - this.options.period + 1);
1717-
rangeStart.setDate(date - (this.options.period > 60 ? 60 : this.options.period) + 1);
1717+
rangeStart.setDate(date - (this.options.period > 90 ? 90 : this.options.period) + 1);
17181718

17191719
// prepare data
17201720
var aCountData = {};
@@ -1750,7 +1750,7 @@ ethplorerWidget.Type['tokenPriceHistoryGrouped'] = function(element, options, te
17501750
if(!priceNotFound){
17511751
noPrice = false;
17521752
aData.push(['Day', 'Low', 'Open', 'Close', 'High', {type: 'string', role: 'tooltip', 'p': {'html': true}}, 'Token operations', {role: 'style'}, {type: 'string', role: 'tooltip', 'p': {'html': true}}, 'Volume', {role: 'style'}, {type: 'string', role: 'tooltip', 'p': {'html': true}}]);
1753-
if(this.options.period > 60){
1753+
if(this.options.period > 90){
17541754
fnDate = startPriceDate;
17551755
}
17561756
}

bin/cache_top.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
* limitations under the License.
1616
*/
1717

18+
ini_set('memory_limit', '512M');
19+
1820
require dirname(__FILE__) . '/../service/lib/ethplorer.php';
1921
$aConfig = require_once dirname(__FILE__) . '/../service/config.php';
2022

index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
require dirname(__FILE__) . '/service/lib/ethplorer.php';
1919
$es = Ethplorer::db(array());
2020

21-
$codeVersion = isset($aConfig['codeVersion']) ? $aConfig['codeVersion'] : "215";
21+
$codeVersion = isset($aConfig['codeVersion']) ? $aConfig['codeVersion'] : "217";
2222

2323
$error = TRUE;
2424
$header = "";

js/ethplorer.js

Lines changed: 103 additions & 57 deletions
Large diffs are not rendered by default.

service/lib/ethplorer.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class Ethplorer {
110110
*
111111
* @var string
112112
*/
113-
protected $showTx = self::SHOW_TX_TOKENS;
113+
protected $showTx = self::SHOW_TX_ALL;
114114

115115
/**
116116
* Cache for getTokens
@@ -475,6 +475,7 @@ public function getAddressDetails($address, $limit = 50){
475475
if($out < 0){
476476
$in = $result['balance'];
477477
$out = 0;
478+
$result['hideBalanceOut'] = true;
478479
}
479480
$result['balanceOut'] = $out;
480481
$result['balanceIn'] = $in;
@@ -795,7 +796,7 @@ private function getTokenOperationData($input, $decimals = 18) {
795796
$ten = Decimal::create(10);
796797
$dec = Decimal::create($decimals);
797798
$value = Decimal::create(hexdec($operation['value']));
798-
$operation['value'] = '' . $value->div($ten->pow($dec), 4);
799+
$operation['value'] = (string)$value;
799800

800801
return $operation;
801802
}
@@ -1245,7 +1246,7 @@ public function getContract($address, $calculateTransactions = TRUE){
12451246
* @param string $address Contract address
12461247
* @return int
12471248
*/
1248-
public function countOperations($address, $useFilter = TRUE, $showTx = self::SHOW_TX_TOKENS){
1249+
public function countOperations($address, $useFilter = TRUE, $showTx = self::SHOW_TX_ALL){
12491250
evxProfiler::checkpoint('countOperations', 'START', 'address=' . $address . ', useFilter = ' . ($useFilter ? 'ON' : 'OFF'));
12501251
$cache = 'countOperations-' . $address . '-' . $showTx;
12511252
$result = $this->oCache->get($cache, false, true, 30);
@@ -1488,7 +1489,7 @@ public function getLastTransfers(array $options = array(), $showEth = FALSE){
14881489
* @param int $limit Maximum number of records
14891490
* @return array
14901491
*/
1491-
public function getAddressOperations($address, $limit = 10, $offset = FALSE, array $aTypes = NULL, $showTx = self::SHOW_TX_TOKENS){
1492+
public function getAddressOperations($address, $limit = 10, $offset = FALSE, array $aTypes = NULL, $showTx = self::SHOW_TX_ALL){
14921493
evxProfiler::checkpoint('getAddressOperations', 'START', 'address=' . $address . ', limit=' . $limit . ', offset=' . (is_array($offset) ? print_r($offset, TRUE) : (int)$offset));
14931494

14941495
$result = array();

tests/apiTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,4 +771,4 @@ protected function getCommandLineParameter($param, $default){
771771
}
772772
return $default;
773773
}
774-
}
774+
}

tests/serviceTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
require "vendor/autoload.php";
3-
require_once '../service/lib/ethplorer.php';
3+
require_once __DIR__ . '/../service/lib/ethplorer.php';
44

55
use EverexIO\PHPUnitIterator\TestCase;
66

@@ -15,7 +15,7 @@ class serviceTest extends TestCase
1515

1616
protected function setUp()
1717
{
18-
$this->config = include('../service/config.php');
18+
$this->config = include(__DIR__ . '/../service/config.php');
1919
$this->ethplorer = Ethplorer::db($this->config);
2020
}
2121

0 commit comments

Comments
 (0)