Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Merge pull request #5239 from EOSIO/develop
Browse files Browse the repository at this point in the history
Version 1.2.0
  • Loading branch information
heifner committed Aug 15, 2018
2 parents 4f4e5c2 + b27c4c6 commit 4da680b
Show file tree
Hide file tree
Showing 123 changed files with 3,174 additions and 3,152 deletions.
4 changes: 2 additions & 2 deletions .buildkite/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
steps:
- command: |
echo "--- :hammer: Building" && \
/usr/bin/cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=clang++-4.0 -DCMAKE_C_COMPILER=clang-4.0 -DWASM_ROOT=/root/opt/wasm -DOPENSSL_ROOT_DIR=/usr/include/openssl -DBUILD_MONGO_DB_PLUGIN=true -DENABLE_COVERAGE_TESTING=true -DBUILD_DOXYGEN=false && \
/usr/bin/cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=clang++-4.0 -DCMAKE_C_COMPILER=clang-4.0 -DBOOST_ROOT="${BOOST_ROOT}" -DWASM_ROOT="${WASM_ROOT}" -DOPENSSL_ROOT_DIR="${OPENSSL_ROOT_DIR}" -DBUILD_MONGO_DB_PLUGIN=true -DENABLE_COVERAGE_TESTING=true -DBUILD_DOXYGEN=false && \
/usr/bin/ninja
echo "--- :spiral_note_pad: Generating Code Coverage Report" && \
/usr/bin/ninja EOSIO_ut_coverage && \
Expand All @@ -21,7 +21,7 @@ steps:
mounts:
- /etc/buildkite-agent/config:/config
environment:
- BOOST_ROOT=/root/opt/boost_1_67_0
- BOOST_ROOT=/root/opt/boost
- OPENSSL_ROOT_DIR=/usr/include/openssl
- WASM_ROOT=/root/opt/wasm
- PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/opt/wasm/bin
Expand Down
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ set( CMAKE_CXX_EXTENSIONS ON )
set( CXX_STANDARD_REQUIRED ON)

set(VERSION_MAJOR 1)
set(VERSION_MINOR 1)
set(VERSION_PATCH 4)
set(VERSION_MINOR 2)
set(VERSION_PATCH 0)

set( CLI_CLIENT_EXECUTABLE_NAME cleos )
set( NODE_EXECUTABLE_NAME nodeos )
set( KEY_STORE_EXECUTABLE_NAME keosd )
set( GUI_CLIENT_EXECUTABLE_NAME eosio )
set( CUSTOM_URL_SCHEME "gcs" )
set( INSTALLER_APP_ID "68ad7005-8eee-49c9-95ce-9eed97e5b347" )
Expand Down
97 changes: 0 additions & 97 deletions CMakeModules/FindSoci.cmake

This file was deleted.

13 changes: 13 additions & 0 deletions CMakeModules/additionalPlugins.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
macro(eosio_additional_plugin)
set(ADDITIONAL_PLUGINS_TARGET "${ADDITIONAL_PLUGINS_TARGET};${ARGN}" PARENT_SCOPE)
endmacro()

foreach(ADDITIONAL_PLUGIN_SOURCE_DIR ${EOSIO_ADDITIONAL_PLUGINS})
string(UUID ADDITIONAL_PLUGIN_SOURCE_DIR_MD5 NAMESPACE "00000000-0000-0000-0000-000000000000" NAME ${ADDITIONAL_PLUGIN_SOURCE_DIR} TYPE MD5)
message(STATUS "[Additional Plugin] ${ADDITIONAL_PLUGIN_SOURCE_DIR} => ${CMAKE_BINARY_DIR}/additional_plugins/${ADDITIONAL_PLUGIN_SOURCE_DIR_MD5}")
add_subdirectory(${ADDITIONAL_PLUGIN_SOURCE_DIR} ${CMAKE_BINARY_DIR}/additional_plugins/${ADDITIONAL_PLUGIN_SOURCE_DIR_MD5})
endforeach()

foreach(ADDITIONAL_PLUGIN_TARGET ${ADDITIONAL_PLUGINS_TARGET})
target_link_libraries( nodeos PRIVATE -Wl,${whole_archive_flag} ${ADDITIONAL_PLUGIN_TARGET} -Wl,${no_whole_archive_flag} )
endforeach()
4 changes: 2 additions & 2 deletions Docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ cd eos/Docker
docker build . -t eosio/eos
```

The above will build off the most recent commit to the master branch by default. If you would like to target a specific branch/tag, you may use a build argument. For example, if you wished to generate a docker image based off of the v1.1.4 tag, you could do the following:
The above will build off the most recent commit to the master branch by default. If you would like to target a specific branch/tag, you may use a build argument. For example, if you wished to generate a docker image based off of the v1.2.0 tag, you could do the following:

```bash
docker build -t eosio/eos:v1.1.4 --build-arg branch=v1.1.4 .
docker build -t eosio/eos:v1.2.0 --build-arg branch=v1.2.0 .
```

By default, the symbol in eosio.system is set to SYS. You can override this using the symbol argument while building the docker image.
Expand Down
1 change: 1 addition & 0 deletions contracts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ add_subdirectory(noop)
add_subdirectory(dice)
add_subdirectory(tic_tac_toe)
add_subdirectory(payloadless)
add_subdirectory(integration_test)


file(GLOB SKELETONS RELATIVE ${CMAKE_SOURCE_DIR}/contracts "skeleton/*")
Expand Down
10 changes: 8 additions & 2 deletions contracts/eosiolib/action.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,15 @@ namespace eosio {
T unpack_action_data() {
constexpr size_t max_stack_buffer_size = 512;
size_t size = action_data_size();
char* buffer = (char*)( max_stack_buffer_size < size ? malloc(size) : alloca(size) );
const bool heap_allocation = max_stack_buffer_size < size;
char* buffer = (char*)( heap_allocation ? malloc(size) : alloca(size) );
read_action_data( buffer, size );
return unpack<T>( buffer, size );
auto res = unpack<T>( buffer, size );
// Free allocated memory
if ( heap_allocation ) {
free(buffer);
}
return res;
}

using ::require_auth;
Expand Down
16 changes: 8 additions & 8 deletions contracts/eosiolib/crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ extern "C" {
* eosio::print("sha256 hash generated from data equals provided hash");
* @endcode
*/
void assert_sha256( char* data, uint32_t length, const checksum256* hash );
void assert_sha256( const char* data, uint32_t length, const checksum256* hash );

/**
* Tests if the sha1 hash generated from data matches the provided checksum.
Expand All @@ -67,7 +67,7 @@ void assert_sha256( char* data, uint32_t length, const checksum256* hash );
* eosio::print("sha1 hash generated from data equals provided hash");
* @endcode
*/
void assert_sha1( char* data, uint32_t length, const checksum160* hash );
void assert_sha1( const char* data, uint32_t length, const checksum160* hash );

/**
* Tests if the sha512 hash generated from data matches the provided checksum.
Expand All @@ -92,7 +92,7 @@ void assert_sha1( char* data, uint32_t length, const checksum160* hash );
* eosio::print("sha512 hash generated from data equals provided hash");
* @endcode
*/
void assert_sha512( char* data, uint32_t length, const checksum512* hash );
void assert_sha512( const char* data, uint32_t length, const checksum512* hash );

/**
* Tests if the ripemod160 hash generated from data matches the provided checksum.
Expand All @@ -116,7 +116,7 @@ void assert_sha512( char* data, uint32_t length, const checksum512* hash );
* eosio::print("ripemod160 hash generated from data equals provided hash");
* @endcode
*/
void assert_ripemd160( char* data, uint32_t length, const checksum160* hash );
void assert_ripemd160( const char* data, uint32_t length, const checksum160* hash );

/**
* Hashes `data` using `sha256` and stores result in memory pointed to by hash.
Expand All @@ -134,7 +134,7 @@ void assert_ripemd160( char* data, uint32_t length, const checksum160* hash );
* eos_assert( calc_hash == hash, "invalid hash" );
* @endcode
*/
void sha256( char* data, uint32_t length, checksum256* hash );
void sha256( const char* data, uint32_t length, checksum256* hash );

/**
* Hashes `data` using `sha1` and stores result in memory pointed to by hash.
Expand All @@ -152,7 +152,7 @@ void sha256( char* data, uint32_t length, checksum256* hash );
* eos_assert( calc_hash == hash, "invalid hash" );
* @endcode
*/
void sha1( char* data, uint32_t length, checksum160* hash );
void sha1( const char* data, uint32_t length, checksum160* hash );

/**
* Hashes `data` using `sha512` and stores result in memory pointed to by hash.
Expand All @@ -170,7 +170,7 @@ void sha1( char* data, uint32_t length, checksum160* hash );
* eos_assert( calc_hash == hash, "invalid hash" );
* @endcode
*/
void sha512( char* data, uint32_t length, checksum512* hash );
void sha512( const char* data, uint32_t length, checksum512* hash );

/**
* Hashes `data` using `ripemod160` and stores result in memory pointed to by hash.
Expand All @@ -188,7 +188,7 @@ void sha512( char* data, uint32_t length, checksum512* hash );
* eos_assert( calc_hash == hash, "invalid hash" );
* @endcode
*/
void ripemd160( char* data, uint32_t length, checksum160* hash );
void ripemd160( const char* data, uint32_t length, checksum160* hash );

/**
* Calculates the public key used for a given signature and hash used to create a message.
Expand Down
8 changes: 8 additions & 0 deletions contracts/integration_test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
file(GLOB ABI_FILES "*.abi")
configure_file("${ABI_FILES}" "${CMAKE_CURRENT_BINARY_DIR}" COPYONLY)

add_wast_executable(TARGET integration_test
INCLUDE_FOLDERS "${STANDARD_INCLUDE_FOLDERS}"
LIBRARIES libc libc++ eosiolib
DESTINATION_FOLDER ${CMAKE_CURRENT_BINARY_DIR}
)
41 changes: 41 additions & 0 deletions contracts/integration_test/integration_test.abi
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"version": "eosio::abi/1.0",
"types": [{
"new_type_name": "account_name",
"type": "name"
}],
"structs": [{
"name": "store",
"base": "",
"fields": [
{"name":"from", "type":"account_name"},
{"name":"to", "type":"account_name"},
{"name":"num", "type":"uint64"}
]
},{
"name": "payload",
"base": "",
"fields": [
{"name":"key", "type":"uint64"},
{"name":"data", "type":"uint64[]"}
]
}
],
"actions": [{
"name": "store",
"type": "store",
"ricardian_contract": ""
}

],
"tables": [{
"name": "payloads",
"type": "payload",
"index_type": "i64",
"key_names" : ["key"],
"key_types" : ["uint64"]
}
],
"ricardian_clauses": [],
"abi_extensions": []
}
37 changes: 37 additions & 0 deletions contracts/integration_test/integration_test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#include <eosiolib/eosio.hpp>
using namespace eosio;

struct integration_test : public eosio::contract {
using contract::contract;

struct payload {
uint64_t key;
vector<uint64_t> data;

uint64_t primary_key()const { return key; }
};
typedef eosio::multi_index<N(payloads), payload> payloads;

/// @abi action
void store( account_name from,
account_name to,
uint64_t num ) {
require_auth( from );
eosio_assert( is_account( to ), "to account does not exist");
eosio_assert( num < std::numeric_limits<size_t>::max(), "num to large");
payloads data ( _self, from );
uint64_t key = 0;
const uint64_t num_keys = 5;
while (data.find( key ) != data.end()) {
key += num_keys;
}
for (size_t i = 0; i < num_keys; ++i) {
data.emplace(from, [&]( auto& g ) {
g.key = key + i;
g.data = vector<uint64_t>( static_cast<size_t>(num), 5);
});
}
}
};

EOSIO_ABI( integration_test, (store) )
6 changes: 4 additions & 2 deletions contracts/tic_tac_toe/tic_tac_toe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ bool is_empty_cell(const uint8_t& cell) {
* @return true if movement is valid
*/
bool is_valid_movement(const uint16_t& row, const uint16_t& column, const vector<uint8_t>& board) {
uint32_t movement_location = row * tic_tac_toe::game::board_width + column;
bool is_valid = movement_location < board.size() && is_empty_cell(board[movement_location]);
uint16_t board_width = tic_tac_toe::game::board_width;
uint16_t board_height = tic_tac_toe::game::board_height;
uint32_t movement_location = row * board_width + column;
bool is_valid = column < board_width && row < board_height && is_empty_cell(board[movement_location]);
return is_valid;
}

Expand Down
Loading

0 comments on commit 4da680b

Please sign in to comment.