Skip to content

Commit 9a4397b

Browse files
authored
Merge pull request #2085 from ArkEcosystem/develop
2 parents 90f4014 + 9a6dc91 commit 9a4397b

File tree

55 files changed

+386
-170
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+386
-170
lines changed

.circleci/config.yml

+12-12
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ jobs:
33
test-node10-0:
44
working_directory: ~/core
55
environment:
6-
CORE_DB_DATABASE: core_development
6+
CORE_DB_DATABASE: core_unitnet
77
CORE_DB_USERNAME: core
88
docker:
99
- image: 'circleci/node:10-browsers'
1010
- image: 'postgres:alpine'
1111
environment:
1212
POSTGRES_PASSWORD: password
13-
POSTGRES_DB: core_development
13+
POSTGRES_DB: core_unitnet
1414
POSTGRES_USER: core
1515
steps:
1616
- checkout
@@ -113,14 +113,14 @@ jobs:
113113
test-node11-0:
114114
working_directory: ~/core
115115
environment:
116-
CORE_DB_DATABASE: core_development
116+
CORE_DB_DATABASE: core_unitnet
117117
CORE_DB_USERNAME: core
118118
docker:
119119
- image: 'circleci/node:11-browsers'
120120
- image: 'postgres:alpine'
121121
environment:
122122
POSTGRES_PASSWORD: password
123-
POSTGRES_DB: core_development
123+
POSTGRES_DB: core_unitnet
124124
POSTGRES_USER: core
125125
steps:
126126
- checkout
@@ -223,14 +223,14 @@ jobs:
223223
test-node10-1:
224224
working_directory: ~/core
225225
environment:
226-
CORE_DB_DATABASE: core_development
226+
CORE_DB_DATABASE: core_unitnet
227227
CORE_DB_USERNAME: core
228228
docker:
229229
- image: 'circleci/node:10-browsers'
230230
- image: 'postgres:alpine'
231231
environment:
232232
POSTGRES_PASSWORD: password
233-
POSTGRES_DB: core_development
233+
POSTGRES_DB: core_unitnet
234234
POSTGRES_USER: core
235235
steps:
236236
- checkout
@@ -343,14 +343,14 @@ jobs:
343343
test-node10-2:
344344
working_directory: ~/core
345345
environment:
346-
CORE_DB_DATABASE: core_development
346+
CORE_DB_DATABASE: core_unitnet
347347
CORE_DB_USERNAME: core
348348
docker:
349349
- image: 'circleci/node:10-browsers'
350350
- image: 'postgres:alpine'
351351
environment:
352352
POSTGRES_PASSWORD: password
353-
POSTGRES_DB: core_development
353+
POSTGRES_DB: core_unitnet
354354
POSTGRES_USER: core
355355
steps:
356356
- checkout
@@ -458,14 +458,14 @@ jobs:
458458
test-node11-1:
459459
working_directory: ~/core
460460
environment:
461-
CORE_DB_DATABASE: core_development
461+
CORE_DB_DATABASE: core_unitnet
462462
CORE_DB_USERNAME: core
463463
docker:
464464
- image: 'circleci/node:11-browsers'
465465
- image: 'postgres:alpine'
466466
environment:
467467
POSTGRES_PASSWORD: password
468-
POSTGRES_DB: core_development
468+
POSTGRES_DB: core_unitnet
469469
POSTGRES_USER: core
470470
steps:
471471
- checkout
@@ -578,14 +578,14 @@ jobs:
578578
test-node11-2:
579579
working_directory: ~/core
580580
environment:
581-
CORE_DB_DATABASE: core_development
581+
CORE_DB_DATABASE: core_unitnet
582582
CORE_DB_USERNAME: core
583583
docker:
584584
- image: 'circleci/node:11-browsers'
585585
- image: 'postgres:alpine'
586586
environment:
587587
POSTGRES_PASSWORD: password
588-
POSTGRES_DB: core_development
588+
POSTGRES_DB: core_unitnet
589589
POSTGRES_USER: core
590590
steps:
591591
- checkout

.circleci/configTemplate.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"test-node10-0": {
55
"working_directory": "~/core",
66
"environment": {
7-
"CORE_DB_DATABASE": "core_development",
7+
"CORE_DB_DATABASE": "core_unitnet",
88
"CORE_DB_USERNAME": "core"
99
},
1010
"docker": [
@@ -15,7 +15,7 @@
1515
"image": "postgres:alpine",
1616
"environment": {
1717
"POSTGRES_PASSWORD": "password",
18-
"POSTGRES_DB": "core_development",
18+
"POSTGRES_DB": "core_unitnet",
1919
"POSTGRES_USER": "core"
2020
}
2121
}
@@ -87,7 +87,7 @@
8787
"test-node11-0": {
8888
"working_directory": "~/core",
8989
"environment": {
90-
"CORE_DB_DATABASE": "core_development",
90+
"CORE_DB_DATABASE": "core_unitnet",
9191
"CORE_DB_USERNAME": "core"
9292
},
9393
"docker": [
@@ -98,7 +98,7 @@
9898
"image": "postgres:alpine",
9999
"environment": {
100100
"POSTGRES_PASSWORD": "password",
101-
"POSTGRES_DB": "core_development",
101+
"POSTGRES_DB": "core_unitnet",
102102
"POSTGRES_USER": "core"
103103
}
104104
}

.circleci/rebuild-db.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ tables='rounds blocks transactions wallets'
33
for table in $tables
44
do
55
dropcmd=$(echo "drop table if exists ${table};")
6-
psql -h localhost -U core -d core_development -c "${dropcmd}"
6+
psql -h localhost -U core -d core_unitnet -c "${dropcmd}"
77
done
88

99
cd ../packages/core-database-postgres/src/migrations/
1010

1111
for sqlFile in ./*.sql
1212
do
1313
sqlcmd=$(cat $sqlFile | sed 's/${schema~}\.//g')
14-
psql -h localhost -U core -d core_development -c "${sqlcmd}"
15-
done
14+
psql -h localhost -U core -d core_unitnet -c "${sqlcmd}"
15+
done

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,6 @@ docker/development
6565

6666
#Webstorm/Intellij
6767
.idea
68+
69+
# Vagrant
70+
.vagrant

CHANGELOG.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## [Unreleased]
99

10+
## [2.1.1] - 2019-02-12
11+
12+
### Fixed
13+
14+
- Configuration endpoint does not show dynamic fees ([#2082])
15+
- Return the correct supply for the legacy API ([#2083])
16+
1017
## [2.1.0] - 2019-02-11
1118

1219
### Added
@@ -177,7 +184,8 @@ Closed security vulnerabilities:
177184

178185
- Initial Release
179186

180-
[unreleased]: https://github.com/ArkEcosystem/core/compare/2.0.19...develop
187+
[unreleased]: https://github.com/ArkEcosystem/core/compare/2.1.1...develop
188+
[2.1.1]: https://github.com/ArkEcosystem/core/compare/2.1.0..2.1.1
181189
[2.1.0]: https://github.com/ArkEcosystem/core/compare/2.0.19...2.1.0
182190
[2.0.19]: https://github.com/ArkEcosystem/core/compare/2.0.18...2.0.19
183191
[2.0.18]: https://github.com/ArkEcosystem/core/compare/2.0.17...2.0.18
@@ -270,3 +278,5 @@ Closed security vulnerabilities:
270278
[#2058]: https://github.com/ArkEcosystem/core/pull/2058
271279
[#2061]: https://github.com/ArkEcosystem/core/pull/2061
272280
[#2080]: https://github.com/ArkEcosystem/core/pull/2080
281+
[#2082]: https://github.com/ArkEcosystem/core/pull/2082
282+
[#2083]: https://github.com/ArkEcosystem/core/pull/2083

CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @faustbrian @kristjank @supaiku0

install.sh

+1-77
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
#!/usr/bin/env bash
22

3-
# -----------------------------------
4-
# TYPOGRAPHY
5-
# -----------------------------------
6-
3+
# Typography
74
red=$(tput setaf 1)
85
green=$(tput setaf 2)
96
yellow=$(tput setaf 3)
@@ -13,19 +10,9 @@ blue=$(tput setaf 6)
1310
white=$(tput setaf 7)
1411
black=$(tput setaf 8)
1512

16-
bg_red=$(tput setab 1)
17-
bg_green=$(tput setab 2)
18-
bg_yellow=$(tput setab 3)
19-
bg_lila=$(tput setab 4)
20-
bg_pink=$(tput setab 5)
21-
bg_blue=$(tput setab 6)
22-
bg_white=$(tput setab 7)
23-
bg_black=$(tput setab 8)
24-
2513
bold=$(tput bold)
2614
reset=$(tput sgr0)
2715

28-
# Indicators
2916
heading ()
3017
{
3118
echo " ${lila}==>${reset}${bold} $1${reset}"
@@ -51,69 +38,6 @@ error ()
5138
echo " ${red}==>${reset}${bold} $1${reset}"
5239
}
5340

54-
# Colored Text
55-
text_red ()
56-
{
57-
echo "${red}$1${reset}"
58-
}
59-
60-
text_green ()
61-
{
62-
echo "${green}$1${reset}"
63-
}
64-
65-
text_yellow ()
66-
{
67-
echo "${yellow}$1${reset}"
68-
}
69-
70-
text_lila ()
71-
{
72-
echo "${lila}$1${reset}"
73-
}
74-
75-
text_pink ()
76-
{
77-
echo "${pink}$1${reset}"
78-
}
79-
80-
text_blue ()
81-
{
82-
echo "${blue}$1${reset}"
83-
}
84-
85-
text_white ()
86-
{
87-
echo "${white}$1${reset}"
88-
}
89-
90-
text_black ()
91-
{
92-
echo "${black}$1${reset}"
93-
}
94-
95-
# Styles
96-
text_bold ()
97-
{
98-
echo "${bold}"
99-
}
100-
101-
text_reset ()
102-
{
103-
echo "${reset}"
104-
}
105-
106-
# Helpers
107-
divider ()
108-
{
109-
text_lila " ==============================================================="
110-
}
111-
112-
paragraph ()
113-
{
114-
text_white "$1" | fold -w67 | paste -sd'\n' -
115-
}
116-
11741
# Detect pkg type
11842
DEB=$(which apt-get)
11943
RPM=$(which yum)

lerna.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
"npmClient": "yarn",
44
"packages": ["packages/*", "plugins/*"],
55
"useWorkspaces": true,
6-
"version": "2.1.0"
6+
"version": "2.1.1"
77
}

packages/core-api/__tests__/v2/handlers/node.test.ts

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import "@arkecosystem/core-test-utils";
2+
3+
import { app } from "@arkecosystem/core-container";
24
import { setUp, tearDown } from "../../__support__/setup";
35
import { utils } from "../utils";
46

@@ -51,7 +53,7 @@ describe("API 2.0 - Loader", () => {
5153
"using the %s header",
5254
(header, request) => {
5355
it("should GET the node configuration", async () => {
54-
const response = await utils[request]("GET", "node/configuration");
56+
let response = await utils[request]("GET", "node/configuration");
5557
expect(response).toBeSuccessfulResponse();
5658
expect(response.data.data).toBeObject();
5759

@@ -60,6 +62,16 @@ describe("API 2.0 - Loader", () => {
6062
expect(response.data.data.symbol).toBeString();
6163
expect(response.data.data.explorer).toBeString();
6264
expect(response.data.data.version).toBeNumber();
65+
66+
const dynamicFees = app.resolveOptions("transactionPool").dynamicFees;
67+
expect(response.data.data.transactionPool.dynamicFees).toEqual(dynamicFees);
68+
69+
app.resolveOptions("transactionPool").dynamicFees.enabled = false;
70+
71+
response = await utils[request]("GET", "node/configuration");
72+
expect(response.data.data.transactionPool.dynamicFees).toEqual({ enabled: false });
73+
74+
app.resolveOptions("transactionPool").dynamicFees.enabled = true;
6375
});
6476
},
6577
);

packages/core-api/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@arkecosystem/core-api",
33
"description": "Public API for Ark Core",
4-
"version": "2.1.0",
4+
"version": "2.1.1",
55
"contributors": [
66
"Kristjan Košič <kristjan@ark.io>",
77
"Brian Faust <brian@ark.io>"
@@ -13,7 +13,7 @@
1313
"dist"
1414
],
1515
"scripts": {
16-
"prepublishOnly": "yarn test && yarn build",
16+
"prepublishOnly": "yarn build",
1717
"pretest": "bash ../../scripts/pre-test.sh",
1818
"compile": "../../node_modules/typescript/bin/tsc",
1919
"build": "yarn clean && yarn compile",

packages/core-api/src/versions/1/blocks/controller.ts

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { supplyCalculator } from "@arkecosystem/core-utils";
12
import { bignumify } from "@arkecosystem/core-utils";
23
import Boom from "boom";
34
import Hapi from "hapi";
@@ -105,14 +106,8 @@ export class BlocksController extends Controller {
105106

106107
public async supply(request: Hapi.Request, h: Hapi.ResponseToolkit) {
107108
try {
108-
const lastBlock = this.blockchain.getLastBlock();
109-
const constants = this.config.getMilestone(lastBlock.data.height);
110-
const rewards = bignumify(constants.reward).times(lastBlock.data.height - constants.height);
111-
112109
return super.respondWith({
113-
supply: +bignumify(this.config.get("genesisBlock.totalAmount"))
114-
.plus(rewards)
115-
.toFixed(),
110+
supply: supplyCalculator.calculate(this.blockchain.getLastBlock().data.height),
116111
});
117112
} catch (error) {
118113
return Boom.badImplementation(error);

packages/core-api/src/versions/2/node/controller.ts

+2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ export class NodeController extends Controller {
4545
const feeStatisticsData = await transactionsRepository.getFeeStatistics();
4646

4747
const network = this.config.get("network");
48+
const dynamicFees = app.resolveOptions("transactionPool").dynamicFees;
4849

4950
return {
5051
data: {
@@ -58,6 +59,7 @@ export class NodeController extends Controller {
5859
feeStatistics: super.toCollection(request, feeStatisticsData, "fee-statistics"),
5960
transactionPool: {
6061
maxTransactionAge: app.resolveOptions("transactionPool").maxTransactionAge,
62+
dynamicFees: dynamicFees.enabled ? dynamicFees : { enabled: false },
6163
},
6264
},
6365
};

0 commit comments

Comments
 (0)