Skip to content

Commit

Permalink
Merge pull request #3 from eosrio/develop
Browse files Browse the repository at this point in the history
merge into master
  • Loading branch information
igorls authored Jun 10, 2021
2 parents 0989c96 + 12a7155 commit e4e81dd
Show file tree
Hide file tree
Showing 93 changed files with 35,176 additions and 3,042 deletions.
6 changes: 0 additions & 6 deletions .gitmodules

This file was deleted.

35 changes: 35 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
cmake_minimum_required (VERSION 3.11)
project(node_abieos VERSION 2.1 LANGUAGES CXX C)

add_definitions(-DNAPI_VERSION=6)
add_definitions(-DNAPI_EXPERIMENTAL)

include_directories(${CMAKE_JS_INC})

set(default_build_type "Release")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS ON)

option(ABIEOS_NO_INT128 "disable use of __int128" OFF)

find_package(Threads)

add_library(abieos STATIC src/abi.cpp src/crypto.cpp include/eosio/fpconv.c)
target_include_directories(abieos PUBLIC include)

if(ABIEOS_NO_INT128)
target_compile_definitions(abieos PUBLIC ABIEOS_NO_INT128)
endif()

set_target_properties(abieos PROPERTIES POSITION_INDEPENDENT_CODE ON)

add_library(${PROJECT_NAME} SHARED src/main.cpp src/abieos.cpp)
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "" SUFFIX ".node")
target_link_libraries(${PROJECT_NAME} ${CMAKE_JS_LIB};abieos;${CMAKE_THREAD_LIBS_INIT})
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Wno-unused-parameter -fcolor-diagnostics)

execute_process(COMMAND node -p "require('node-addon-api').include" WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE NODE_ADDON_API_DIR)
string(REPLACE "\n" "" NODE_ADDON_API_DIR ${NODE_ADDON_API_DIR})
string(REPLACE "\"" "" NODE_ADDON_API_DIR ${NODE_ADDON_API_DIR})
target_include_directories(${PROJECT_NAME} PRIVATE ${NODE_ADDON_API_DIR})
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Node.js native binding for [abieos](https://github.com/EOSIO/abieos), with some

- Contracts can be directly updated on the map
- Added `abieos_delete_contract`
- Avoid throwing error on _extra data_ (should be handled by the application)

Made with ♥ by [EOS Rio](https://eosrio.io/)

Expand Down
39 changes: 0 additions & 39 deletions binding.gyp

This file was deleted.

Binary file modified dist/abieos.node
Binary file not shown.
4 changes: 2 additions & 2 deletions examples/basic.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const nodeAbieos = require('@eosrio/node-abieos');
const eosio_abi = require('@eosrio/node-abieos/eosio.json');
const nodeAbieos = require('../abieos');
const eosio_abi = require('../eosio.json');

// abort if not on linux
if (!nodeAbieos) {
Expand Down
1 change: 0 additions & 1 deletion external/date
Submodule date deleted from 2cb4c3
1 change: 0 additions & 1 deletion external/rapidjson
Submodule rapidjson deleted from 663f07
76 changes: 76 additions & 0 deletions include/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
BasedOnStyle: LLVM
IndentWidth: 3
UseTab: Never
ColumnLimit: 120

---
Language: Cpp
# always align * and & to the type
DerivePointerAlignment: false
PointerAlignment: Left

# regroup includes to these classes
IncludeCategories:
- Regex: '(<|"(eosio)/)'
Priority: 4
- Regex: '(<|"(boost)/)'
Priority: 3
- Regex: '(<|"(llvm|llvm-c|clang|clang-c)/'
Priority: 3
- Regex: '<[[:alnum:]]+>'
Priority: 2
- Regex: '.*'
Priority: 1

#IncludeBlocks: Regroup

# set indent for public, private and protected
#AccessModifierOffset: 3

# make line continuations twice the normal indent
ContinuationIndentWidth: 6

# add missing namespace comments
FixNamespaceComments: true

# add spaces to braced list i.e. int* foo = { 0, 1, 2 }; instead of int* foo = {0,1,2};
Cpp11BracedListStyle: false
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignOperands: true
AlignTrailingComments: true
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
AllowShortBlocksOnASingleLine: true
#AllowShortIfStatementsOnASingleLine: WithoutElse
#AllowShortIfStatementsOnASingleLine: true
#AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: true
AlwaysBreakTemplateDeclarations: true

BinPackParameters: true
### use this with clang9
BreakBeforeBraces: Custom
BraceWrapping:
#AfterCaseLabel: true
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false

BreakConstructorInitializers: BeforeColon
CompactNamespaces: true
IndentCaseLabels: true
IndentPPDirectives: AfterHash
NamespaceIndentation: Inner
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
---
Loading

0 comments on commit e4e81dd

Please sign in to comment.