Skip to content

Commit

Permalink
Merge pull request #173 from ArkEcosystem/release/v1.4.0
Browse files Browse the repository at this point in the history
release: 1.4.0
  • Loading branch information
faustbrian committed Feb 14, 2020
2 parents 7a8f72f + 48d20d7 commit 392ad9a
Show file tree
Hide file tree
Showing 42 changed files with 1,632 additions and 211 deletions.
17 changes: 0 additions & 17 deletions .appveyor.yml

This file was deleted.

11 changes: 8 additions & 3 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
ignore:
- "test"
- "extras"
- "src/lib"
- "cmake/"
- "docs/"
- "examples/"
- "extern/"
- "extras/"
- "test/"
- "src/api/**/*.cpp" # hide mocked api
- "src/include/cpp-client/api/**/*.h" # hide mocked api
35 changes: 35 additions & 0 deletions .github/workflows/codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Coverage

on:
push:
branches:
- 'master'
- 'develop'

jobs:
codeclimate:
runs-on: macOS-latest

steps:
- uses: actions/checkout@v1
- name: Set compiler to clang++
run: COMPILER=clang++
- name: Install Dependencies
run: brew install cmake lcov
- name: Make scripts executable
run: sudo chmod +x ./.github/workflows/test/clang_tidy.sh
- name: Setup Code Climate test-reporter
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-darwin-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
- name: Build & Run Coverage Tests
run: |
./cc-test-reporter before-build
cmake -DCMAKE_BUILD_TYPE=Coverage -DUNIT_TEST=ON .
cmake --build .
./test/ark_cpp_client_tests
lcov --directory . --include "*/src/*" --include "*/test/*" --exclude "*/src/lib/*" --exclude "*/extern/*" --capture --output-file coverage.info --ignore-errors gcov
./cc-test-reporter format-coverage --input-type lcov coverage.info
./cc-test-reporter upload-coverage
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
27 changes: 0 additions & 27 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,6 @@ on:
types: [ready_for_review, synchronize, opened]

jobs:
codeclimate:
runs-on: macOS-latest

steps:
- uses: actions/checkout@v1
- name: Set compiler to clang++
run: COMPILER=clang++
- name: Install Dependencies
run: brew install cmake lcov
- name: Make scripts executable
run: sudo chmod +x ./.github/workflows/test/clang_tidy.sh
- name: Setup Code Climate test-reporter
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-darwin-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
- name: Build & Run Coverage Tests
run: |
./cc-test-reporter before-build
cmake -DCMAKE_BUILD_TYPE=Coverage -DUNIT_TEST=ON .
cmake --build .
./test/ark_cpp_client_tests
lcov --directory . --include "*/src/*" --include "*/test/*" --exclude "*/src/lib/*" --exclude "*/extern/*" --capture --output-file coverage.info --ignore-errors gcov
./cc-test-reporter format-coverage --input-type lcov coverage.info
./cc-test-reporter upload-coverage
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}

codecov:
runs-on: ubuntu-latest

Expand Down
Empty file modified .github/workflows/test/clang_format.sh
100644 → 100755
Empty file.
Empty file modified .github/workflows/test/clang_tidy.sh
100644 → 100755
Empty file.
4 changes: 3 additions & 1 deletion .github/workflows/test/install_arduino.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ sudo ln -s /usr/local/share/arduino-cli /usr/local/bin/arduino-cli

printf "board_manager:
additional_urls:
- https://dl.espressif.com/dl/package_esp32_index.json" >> .cli-config.yml
- https://dl.espressif.com/dl/package_esp32_index.json
- http://arduino.esp8266.com/stable/package_esp8266com_index.json" >> .cli-config.yml
sudo mv .cli-config.yml /usr/local/share/

arduino-cli core update-index
arduino-cli core install esp32:esp32
arduino-cli core install esp8266:esp8266
Empty file modified .github/workflows/test/install_platform_io.sh
100644 → 100755
Empty file.
2 changes: 2 additions & 0 deletions .github/workflows/test/script_arduino.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ mkdir -p ~/Arduino/libraries/cpp-client/
mv ${GITHUB_WORKSPACE}/* ~/Arduino/libraries/cpp-client

arduino-cli compile --output temp.bin -b esp32:esp32:esp32 ~/Arduino/libraries/cpp-client/examples/arduino/ESP32/ESP32.ino --debug

arduino-cli compile --output temp.bin -b esp8266:esp8266:nodemcu ~/Arduino/libraries/cpp-client/examples/arduino/ESP8266/ESP8266.ino --debug
Empty file modified .github/workflows/test/script_desktop.sh
100644 → 100755
Empty file.
Empty file modified .github/workflows/test/script_platform_io.sh
100644 → 100755
Empty file.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.4.0] - 2020-02-13

## [1.4.0-arduino] - 2020-02-13

### Added
- added Core 2.6 endpoints ([#159])

## [1.3.0] - 2019-10-09

## [1.3.0-arduino] - 2019-10-09
Expand Down Expand Up @@ -75,3 +82,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
[#140]: https://github.com/ArkEcosystem/cpp-client/pull/140
[1.3.0-arduino]: https://github.com/ArkEcosystem/cpp-client/compare/1.2.0-arduino...1.3.0-arduino
[1.3.0]: https://github.com/ArkEcosystem/cpp-client/compare/1.2.0...1.3.0
[#159]: https://github.com/ArkEcosystem/cpp-client/pull/159
[1.4.0]: https://github.com/ArkEcosystem/cpp-client/compare/1.3.0...1.4.0
[1.4.0]: https://github.com/ArkEcosystem/cpp-client/compare/1.3.0-arduino...1.4.0-arduino
3 changes: 3 additions & 0 deletions cmake/extern/CURL.txt.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

cmake_minimum_required(VERSION 3.2)

project(curl-download)

include(ExternalProject)

# ------------------------------------------------------------------------------
Expand All @@ -10,6 +12,7 @@ include(ExternalProject)
ExternalProject_Add(CURL
GIT_REPOSITORY https://github.com/curl/curl
GIT_TAG curl-7_66_0
GIT_CONFIG advice.detachedHead=false
SOURCE_DIR "${EXTERNAL_LIBRARY_DIR}/curl/src"
BINARY_DIR "${EXTERNAL_LIBRARY_DIR}/curl/build"
CONFIGURE_COMMAND ""
Expand Down
3 changes: 3 additions & 0 deletions cmake/extern/GTest.txt.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

cmake_minimum_required(VERSION 3.2)

project(googletest-download)

include(ExternalProject)

# ------------------------------------------------------------------------------
Expand All @@ -10,6 +12,7 @@ include(ExternalProject)
ExternalProject_Add(GoogleTest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG v1.10.x
GIT_CONFIG advice.detachedHead=false
SOURCE_DIR "${EXTERNAL_LIBRARY_DIR}/googletest/src"
BINARY_DIR "${EXTERNAL_LIBRARY_DIR}/googletest/build"
CONFIGURE_COMMAND ""
Expand Down
2 changes: 1 addition & 1 deletion examples/arduino/ESP32/ESP32.ino
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ void checkAPI() {
// }
// ]
// }
const auto topWallets = connection.api.wallets.top("limit=1&page=1");
const auto topWallets = connection.api.wallets.top("?limit=1&page=1");
Serial.print("\nTop Wallets: ");
Serial.println(topWallets.c_str());
};
Expand Down
15 changes: 15 additions & 0 deletions extras/ARDUINO_IDE.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ SRC_API_DIR=${SRC_DIR}/api

INCLUDE_BLOCKCHAIN_DIR=${INCLUDE_DIR}/api/blockchain
INCLUDE_BLOCKS_DIR=${INCLUDE_DIR}/api/blocks
INCLUDE_BUSINESSES_DIR=${INCLUDE_DIR}/api/businesses
INCLUDE_BRIDGECHAINS_DIR=${INCLUDE_DIR}/api/bridgechains
INCLUDE_DELEGATES_DIR=${INCLUDE_DIR}/api/delegates
INCLUDE_LOCKS_DIR=${INCLUDE_DIR}/api/locks
INCLUDE_NODE_DIR=${INCLUDE_DIR}/api/node
INCLUDE_PEERS_DIR=${INCLUDE_DIR}/api/peers
INCLUDE_ROUNDS_DIR=${INCLUDE_DIR}/api/rounds
Expand All @@ -47,7 +50,10 @@ INCLUDE_WALLETS_DIR=${INCLUDE_DIR}/api/wallets

SRC_BLOCKCHAIN_DIR=${SRC_DIR}/api/blockchain
SRC_BLOCKS_DIR=${SRC_DIR}/api/blocks
SRC_BUSINESSES_DIR=${SRC_DIR}/api/businesses
SRC_BRIDGECHAINS_DIR=${SRC_DIR}/api/bridgechains
SRC_DELEGATES_DIR=${SRC_DIR}/api/delegates
SRC_LOCKS_DIR=${SRC_DIR}/api/locks
SRC_NODE_DIR=${SRC_DIR}/api/node
SRC_PEERS_DIR=${SRC_DIR}/api/peers
SRC_ROUNDS_DIR=${SRC_DIR}/api/rounds
Expand Down Expand Up @@ -111,7 +117,10 @@ if [[ -d ${INCLUDE_DIR} ]]; then

mv ${INCLUDE_BLOCKCHAIN_DIR}/blockchain.hpp ${SRC_BLOCKCHAIN_DIR}
mv ${INCLUDE_BLOCKS_DIR}/blocks.h ${SRC_BLOCKS_DIR}
mv ${INCLUDE_BUSINESSES_DIR}/businesses.h ${SRC_BUSINESSES_DIR}
mv ${INCLUDE_BRIDGECHAINS_DIR}/bridgechains.h ${SRC_BRIDGECHAINS_DIR}
mv ${INCLUDE_DELEGATES_DIR}/delegates.h ${SRC_DELEGATES_DIR}
mv ${INCLUDE_LOCKS_DIR}/locks.h ${SRC_LOCKS_DIR}
mv ${INCLUDE_NODE_DIR}/node.h ${SRC_NODE_DIR}
mv ${INCLUDE_PEERS_DIR}/peers.h ${SRC_PEERS_DIR}
mv ${INCLUDE_ROUNDS_DIR}/rounds.h ${SRC_ROUNDS_DIR}
Expand Down Expand Up @@ -155,7 +164,10 @@ else
mkdir ${INCLUDE_API_DIR}
mkdir ${INCLUDE_BLOCKCHAIN_DIR}
mkdir ${INCLUDE_BLOCKS_DIR}
mkdir ${INCLUDE_BUSINESSES_DIR}
mkdir ${INCLUDE_BRIDGECHAINS_DIR}
mkdir ${INCLUDE_DELEGATES_DIR}
mkdir ${INCLUDE_LOCKS_DIR}
mkdir ${INCLUDE_NODE_DIR}
mkdir ${INCLUDE_PEERS_DIR}
mkdir ${INCLUDE_ROUNDS_DIR}
Expand All @@ -171,7 +183,10 @@ else

mv ${SRC_BLOCKCHAIN_DIR}/blockchain.hpp ${INCLUDE_BLOCKCHAIN_DIR}
mv ${SRC_BLOCKS_DIR}/blocks.h ${INCLUDE_BLOCKS_DIR}
mv ${SRC_BUSINESSES_DIR}/businesses.h ${INCLUDE_BUSINESSES_DIR}
mv ${SRC_BRIDGECHAINS_DIR}/bridgechains.h ${INCLUDE_BRIDGECHAINS_DIR}
mv ${SRC_DELEGATES_DIR}/delegates.h ${INCLUDE_DELEGATES_DIR}
mv ${SRC_LOCKS_DIR}/locks.h ${INCLUDE_LOCKS_DIR}
mv ${SRC_NODE_DIR}/node.h ${INCLUDE_NODE_DIR}
mv ${SRC_PEERS_DIR}/peers.h ${INCLUDE_PEERS_DIR}
mv ${SRC_ROUNDS_DIR}/rounds.h ${INCLUDE_ROUNDS_DIR}
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"type": "git",
"url": "https://github.com/ArkEcosystem/Cpp-Client.git"
},
"version": "1.3.0",
"version": "1.4.0",
"authors": [
{
"name": "Ark Ecosystem",
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Ark-Cpp-Client
version=1.3.0
version=1.4.0
author=Ark Ecosystem
maintainer=Ark Ecosystem
sentence=A simple API client implementation in C++ for the ARK Blockchain.
Expand Down
3 changes: 3 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ set(PATHS_SRC api/paths.cpp)
set(API_SRC
api/blockchain/blockchain.cpp
api/blocks/blocks.cpp
api/businesses/businesses.cpp
api/bridgechains/bridgechains.cpp
api/delegates/delegates.cpp
api/locks/locks.cpp
api/node/node.cpp
api/peers/peers.cpp
api/rounds/rounds.cpp
Expand Down
40 changes: 40 additions & 0 deletions src/api/bridgechains/bridgechains.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* This file is part of Ark Cpp Client.
*
* (c) Ark Ecosystem <info@ark.io>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
**/

#include "api/bridgechains/bridgechains.h"

namespace Ark {
namespace Client {
namespace api {

std::string Bridgechains::get(const char* bridgechainId) {
return http_->get(paths::Bridgechains::get(this->host_, bridgechainId).c_str());
}

/**/

std::string Bridgechains::all(const char* const query) {
return http_->get(paths::Bridgechains::all(this->host_, query).c_str());
}

/**/

std::string Bridgechains::search(
const std::map<std::string, std::string> &bodyParameters,
const char* const query) {
const auto searchPathPair = paths::Bridgechains::search(this->host_,
bodyParameters,
query);
return http_->post(searchPathPair.first.c_str(),
searchPathPair.second.c_str());
}

} // namespace api
} // namespace Client
} // namespace Ark
49 changes: 49 additions & 0 deletions src/api/businesses/businesses.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/**
* This file is part of Ark Cpp Client.
*
* (c) Ark Ecosystem <info@ark.io>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
**/

#include "api/businesses/businesses.h"

namespace Ark {
namespace Client {
namespace api {

std::string Businesses::get(const char* businessId) {
return http_->get(paths::Businesses::get(this->host_, businessId).c_str());
}

/**/

std::string Businesses::all(const char* const query) {
return http_->get(paths::Businesses::all(this->host_, query).c_str());
}

/**/

std::string Businesses::bridgechains(const char* businessId,
const char* const query) {
return http_->get(paths::Businesses::bridgechains(this->host_,
businessId,
query).c_str());
}

/**/

std::string Businesses::search(
const std::map<std::string, std::string> &bodyParameters,
const char* const query) {
const auto searchPathPair = paths::Businesses::search(this->host_,
bodyParameters,
query);
return http_->post(searchPathPair.first.c_str(),
searchPathPair.second.c_str());
}

} // namespace api
} // namespace Client
} // namespace Ark
Loading

0 comments on commit 392ad9a

Please sign in to comment.