Skip to content

Commit

Permalink
Merge branch 'develop' into 'master'
Browse files Browse the repository at this point in the history
Develop

See merge request in3/c/in3-core!180
  • Loading branch information
simon-jentzsch committed Mar 10, 2020
2 parents 684fbce + 169780b commit 071573b
Show file tree
Hide file tree
Showing 267 changed files with 4,376 additions and 2,631 deletions.
3 changes: 3 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ BasedOnStyle: LLVM
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignTrailingComments: true
AlignAfterOpenBracket: Align
AlignEscapedNewlines: Right
AlignOperands: true
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ _build
**/.vscode/ipch/
**/.DS_Store
/.metadata/
/build.gradle
.DS_Store
/RemoteSystemsTempFiles/
cmake-build-debug/
Expand Down
123 changes: 94 additions & 29 deletions .gitlab-ci.yml

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Debug (Attach)",
"request": "attach",
"hostName": "localhost",
"port": "5005"
},
{
"type": "lldb",
"request": "launch",
Expand Down
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is part of the Incubed project.
# Sources: https://github.com/slockit/in3-c
#
# Copyright (C) 2018-2019 slock.it GmbH, Blockchains LLC
# Copyright (C) 2018-2020 slock.it GmbH, Blockchains LLC
#
#
# COMMERCIAL LICENSE USAGE
Expand Down Expand Up @@ -45,6 +45,7 @@ option(ETH_NANO "build minimal eth verification.(eth_getTransactionReceipt)" ON)
option(ETH_BASIC "build basic eth verification.(all rpc-calls except eth_call)" ON)
option(ETH_FULL "build full eth verification.(including eth_call)" ON)
option(IPFS "build IPFS verification" ON)
option(COLOR "Enable color codes for debug" ON)
option(BTC "if true, the bitcoin verifiers will be build" OFF)
option(IN3API "build the USN-API which offer better interfaces and additional functions on top of the pure verification" ON)
option(USE_PRECOMPUTED_EC "if true the secp256k1 curve uses precompiled tables to boost performance. turning this off makes ecrecover slower, but saves about 37kb." ON)
Expand Down Expand Up @@ -99,6 +100,11 @@ if(IPFS)
set(IN3_VERIFIER ${IN3_VERIFIER} ipfs)
endif()

if(COLOR AND NOT (MSVC OR MSYS OR MINGW))
ADD_DEFINITIONS(-DLOG_USE_COLOR)
endif()


if(CMAKE_BUILD_TYPE MATCHES Debug)
ADD_DEFINITIONS(-DDEBUG)
endif(CMAKE_BUILD_TYPE MATCHES Debug)
Expand Down Expand Up @@ -150,7 +156,6 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
if(TEST)
MESSAGE(STATUS "Build Tests and add debug infos")
ADD_DEFINITIONS(-DTEST)
ADD_DEFINITIONS(-DLOG_USE_COLOR)
ADD_DEFINITIONS(-DIN3_DONT_HASH_KEYS)
ADD_DEFINITIONS(-DIN3_EXPORT_TEST=)
ADD_DEFINITIONS(-DIN3_IMPORT_TEST=extern)
Expand All @@ -159,6 +164,7 @@ if(TEST)
enable_testing()
add_subdirectory(c/test)
add_custom_target(ptest COMMAND ${CMAKE_CTEST_COMMAND} -j 8)
add_custom_target(rtest COMMAND ${CMAKE_CTEST_COMMAND} -V )
endif(TEST)


Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is part of the Incubed project.
# Sources: https://github.com/slockit/in3-c
#
# Copyright (C) 2018-2019 slock.it GmbH, Blockchains LLC
# Copyright (C) 2018-2020 slock.it GmbH, Blockchains LLC
#
#
# COMMERCIAL LICENSE USAGE
Expand Down
7 changes: 5 additions & 2 deletions c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is part of the Incubed project.
# Sources: https://github.com/slockit/in3-c
#
# Copyright (C) 2018-2019 slock.it GmbH, Blockchains LLC
# Copyright (C) 2018-2020 slock.it GmbH, Blockchains LLC
#
#
# COMMERCIAL LICENSE USAGE
Expand Down Expand Up @@ -41,10 +41,13 @@ add_subdirectory(src/core)
add_subdirectory(src/transport)
add_subdirectory(src/verifier)
add_subdirectory(src/api)
add_subdirectory(src/cmd)
IF (ETH_FULL)
add_subdirectory(src/cmd)
endif()
add_subdirectory(docs)



# create the library
if (IN3_LIB)
set(IN3_LIBS
Expand Down
6 changes: 5 additions & 1 deletion c/compiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ if(MSVC)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -funsigned-char -std=c99 -D__FILENAME__=none")
else(MSVC)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -Wall -funsigned-char -Wextra -std=c99")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -funsigned-char -Wextra -std=c99 -D__FILENAME__='\"$(subst ${CMAKE_SOURCE_DIR}/,,$(abspath $<))\"'")
if (NOT DEFINED ANDROID_ABI)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -funsigned-char -Wextra -std=c99 -D__FILENAME__='\"$(subst ${CMAKE_SOURCE_DIR}/,,$(abspath $<))\"'")
else()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -funsigned-char -Wextra -std=c99 -D__FILENAME__=none")
endif()
endif(MSVC)
if (WASM)
set (CMAKE_C_FLAGS "-Wall -funsigned-char -Wextra -std=c99")
Expand Down
2 changes: 1 addition & 1 deletion c/include/in3/api_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file is part of the Incubed project.
* Sources: https://github.com/slockit/in3-c
*
* Copyright (C) 2018-2019 slock.it GmbH, Blockchains LLC
* Copyright (C) 2018-2020 slock.it GmbH, Blockchains LLC
*
*
* COMMERCIAL LICENSE USAGE
Expand Down
2 changes: 1 addition & 1 deletion c/include/in3/bytes.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file is part of the Incubed project.
* Sources: https://github.com/slockit/in3-c
*
* Copyright (C) 2018-2019 slock.it GmbH, Blockchains LLC
* Copyright (C) 2018-2020 slock.it GmbH, Blockchains LLC
*
*
* COMMERCIAL LICENSE USAGE
Expand Down
2 changes: 1 addition & 1 deletion c/include/in3/chainspec.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file is part of the Incubed project.
* Sources: https://github.com/slockit/in3-c
*
* Copyright (C) 2018-2019 slock.it GmbH, Blockchains LLC
* Copyright (C) 2018-2020 slock.it GmbH, Blockchains LLC
*
*
* COMMERCIAL LICENSE USAGE
Expand Down
2 changes: 1 addition & 1 deletion c/include/in3/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file is part of the Incubed project.
* Sources: https://github.com/slockit/in3-c
*
* Copyright (C) 2018-2019 slock.it GmbH, Blockchains LLC
* Copyright (C) 2018-2020 slock.it GmbH, Blockchains LLC
*
*
* COMMERCIAL LICENSE USAGE
Expand Down
4 changes: 2 additions & 2 deletions c/include/in3/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file is part of the Incubed project.
* Sources: https://github.com/slockit/in3-c
*
* Copyright (C) 2018-2019 slock.it GmbH, Blockchains LLC
* Copyright (C) 2018-2020 slock.it GmbH, Blockchains LLC
*
*
* COMMERCIAL LICENSE USAGE
Expand Down Expand Up @@ -38,11 +38,11 @@
* This is used for each request holding request and response-pointers but also controls the execution process.
* */

#include "client.h"
#include "data.h"
#include "scache.h"
#include "stringbuilder.h"
#include "utils.h"
#include "client.h"
#include <stdbool.h>
#include <stdint.h>
#ifndef CONTEXT_H
Expand Down
2 changes: 1 addition & 1 deletion c/include/in3/data.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file is part of the Incubed project.
* Sources: https://github.com/slockit/in3-c
*
* Copyright (C) 2018-2019 slock.it GmbH, Blockchains LLC
* Copyright (C) 2018-2020 slock.it GmbH, Blockchains LLC
*
*
* COMMERCIAL LICENSE USAGE
Expand Down
2 changes: 1 addition & 1 deletion c/include/in3/error.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file is part of the Incubed project.
* Sources: https://github.com/slockit/in3-c
*
* Copyright (C) 2018-2019 slock.it GmbH, Blockchains LLC
* Copyright (C) 2018-2020 slock.it GmbH, Blockchains LLC
*
*
* COMMERCIAL LICENSE USAGE
Expand Down
4 changes: 2 additions & 2 deletions c/include/in3/eth_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file is part of the Incubed project.
* Sources: https://github.com/slockit/in3-c
*
* Copyright (C) 2018-2019 slock.it GmbH, Blockchains LLC
* Copyright (C) 2018-2020 slock.it GmbH, Blockchains LLC
*
*
* COMMERCIAL LICENSE USAGE
Expand Down Expand Up @@ -42,8 +42,8 @@
#ifndef ETH_API_H
#define ETH_API_H

#include "client.h"
#include "api_utils.h"
#include "client.h"
#include <stdarg.h>

/** Initializer macros for eth_blknum_t */
Expand Down
2 changes: 1 addition & 1 deletion c/include/in3/eth_basic.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file is part of the Incubed project.
* Sources: https://github.com/slockit/in3-c
*
* Copyright (C) 2018-2019 slock.it GmbH, Blockchains LLC
* Copyright (C) 2018-2020 slock.it GmbH, Blockchains LLC
*
*
* COMMERCIAL LICENSE USAGE
Expand Down
2 changes: 1 addition & 1 deletion c/include/in3/eth_full.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file is part of the Incubed project.
* Sources: https://github.com/slockit/in3-c
*
* Copyright (C) 2018-2019 slock.it GmbH, Blockchains LLC
* Copyright (C) 2018-2020 slock.it GmbH, Blockchains LLC
*
*
* COMMERCIAL LICENSE USAGE
Expand Down
2 changes: 1 addition & 1 deletion c/include/in3/eth_nano.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file is part of the Incubed project.
* Sources: https://github.com/slockit/in3-c
*
* Copyright (C) 2018-2019 slock.it GmbH, Blockchains LLC
* Copyright (C) 2018-2020 slock.it GmbH, Blockchains LLC
*
*
* COMMERCIAL LICENSE USAGE
Expand Down
2 changes: 1 addition & 1 deletion c/include/in3/in3_curl.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file is part of the Incubed project.
* Sources: https://github.com/slockit/in3-c
*
* Copyright (C) 2018-2019 slock.it GmbH, Blockchains LLC
* Copyright (C) 2018-2020 slock.it GmbH, Blockchains LLC
*
*
* COMMERCIAL LICENSE USAGE
Expand Down
2 changes: 1 addition & 1 deletion c/include/in3/in3_http.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file is part of the Incubed project.
* Sources: https://github.com/slockit/in3-c
*
* Copyright (C) 2018-2019 slock.it GmbH, Blockchains LLC
* Copyright (C) 2018-2020 slock.it GmbH, Blockchains LLC
*
*
* COMMERCIAL LICENSE USAGE
Expand Down
2 changes: 1 addition & 1 deletion c/include/in3/ipfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file is part of the Incubed project.
* Sources: https://github.com/slockit/in3-c
*
* Copyright (C) 2018-2019 slock.it GmbH, Blockchains LLC
* Copyright (C) 2018-2020 slock.it GmbH, Blockchains LLC
*
*
* COMMERCIAL LICENSE USAGE
Expand Down
4 changes: 2 additions & 2 deletions c/include/in3/ipfs_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file is part of the Incubed project.
* Sources: https://github.com/slockit/in3-c
*
* Copyright (C) 2018-2019 slock.it GmbH, Blockchains LLC
* Copyright (C) 2018-2020 slock.it GmbH, Blockchains LLC
*
*
* COMMERCIAL LICENSE USAGE
Expand Down Expand Up @@ -42,8 +42,8 @@
#ifndef IN3_IPFS_API_H
#define IN3_IPFS_API_H

#include "client.h"
#include "bytes.h"
#include "client.h"

char* ipfs_put(in3_t* in3, const bytes_t* content); /**< Returns the IPFS multihash of stored content on success OR NULL on error (check api_last_error()). Result must be freed by caller. */
bytes_t* ipfs_get(in3_t* in3, const char* multihash); /**< Returns the content associated with specified multihash on success OR NULL on error (check api_last_error()). Result must be freed by caller. */
Expand Down
2 changes: 1 addition & 1 deletion c/include/in3/rpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file is part of the Incubed project.
* Sources: https://github.com/slockit/in3-c
*
* Copyright (C) 2018-2019 slock.it GmbH, Blockchains LLC
* Copyright (C) 2018-2020 slock.it GmbH, Blockchains LLC
*
*
* COMMERCIAL LICENSE USAGE
Expand Down
2 changes: 1 addition & 1 deletion c/include/in3/scache.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file is part of the Incubed project.
* Sources: https://github.com/slockit/in3-c
*
* Copyright (C) 2018-2019 slock.it GmbH, Blockchains LLC
* Copyright (C) 2018-2020 slock.it GmbH, Blockchains LLC
*
*
* COMMERCIAL LICENSE USAGE
Expand Down
2 changes: 1 addition & 1 deletion c/include/in3/signer.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file is part of the Incubed project.
* Sources: https://github.com/slockit/in3-c
*
* Copyright (C) 2018-2019 slock.it GmbH, Blockchains LLC
* Copyright (C) 2018-2020 slock.it GmbH, Blockchains LLC
*
*
* COMMERCIAL LICENSE USAGE
Expand Down
2 changes: 1 addition & 1 deletion c/include/in3/stringbuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file is part of the Incubed project.
* Sources: https://github.com/slockit/in3-c
*
* Copyright (C) 2018-2019 slock.it GmbH, Blockchains LLC
* Copyright (C) 2018-2020 slock.it GmbH, Blockchains LLC
*
*
* COMMERCIAL LICENSE USAGE
Expand Down
2 changes: 1 addition & 1 deletion c/include/in3/usn_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file is part of the Incubed project.
* Sources: https://github.com/slockit/in3-c
*
* Copyright (C) 2018-2019 slock.it GmbH, Blockchains LLC
* Copyright (C) 2018-2020 slock.it GmbH, Blockchains LLC
*
*
* COMMERCIAL LICENSE USAGE
Expand Down
2 changes: 1 addition & 1 deletion c/include/in3/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file is part of the Incubed project.
* Sources: https://github.com/slockit/in3-c
*
* Copyright (C) 2018-2019 slock.it GmbH, Blockchains LLC
* Copyright (C) 2018-2020 slock.it GmbH, Blockchains LLC
*
*
* COMMERCIAL LICENSE USAGE
Expand Down
6 changes: 3 additions & 3 deletions c/include/in3/verifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file is part of the Incubed project.
* Sources: https://github.com/slockit/in3-c
*
* Copyright (C) 2018-2019 slock.it GmbH, Blockchains LLC
* Copyright (C) 2018-2020 slock.it GmbH, Blockchains LLC
*
*
* COMMERCIAL LICENSE USAGE
Expand Down Expand Up @@ -38,11 +38,11 @@
* This context is passed to the verifier.
* */

#include "client.h"
#include "context.h"
#include "data.h"
#include "stringbuilder.h"
#include "utils.h"
#include "client.h"
#include "context.h"
#include <stdbool.h>
#include <stdint.h>

Expand Down
2 changes: 1 addition & 1 deletion c/src/api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is part of the Incubed project.
# Sources: https://github.com/slockit/in3-c
#
# Copyright (C) 2018-2019 slock.it GmbH, Blockchains LLC
# Copyright (C) 2018-2020 slock.it GmbH, Blockchains LLC
#
#
# COMMERCIAL LICENSE USAGE
Expand Down
2 changes: 1 addition & 1 deletion c/src/api/eth1/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is part of the Incubed project.
# Sources: https://github.com/slockit/in3-c
#
# Copyright (C) 2018-2019 slock.it GmbH, Blockchains LLC
# Copyright (C) 2018-2020 slock.it GmbH, Blockchains LLC
#
#
# COMMERCIAL LICENSE USAGE
Expand Down
2 changes: 1 addition & 1 deletion c/src/api/eth1/abi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* This file is part of the Incubed project.
* Sources: https://github.com/slockit/in3
*
* Copyright (C) 2018-2019 slock.it GmbH, Blockchains LLC
* Copyright (C) 2018-2020 slock.it GmbH, Blockchains LLC
*
*
* COMMERCIAL LICENSE USAGE
Expand Down
Loading

0 comments on commit 071573b

Please sign in to comment.