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

Password and keys to file instead of console #4817

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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": []
}
36 changes: 36 additions & 0 deletions contracts/integration_test/integration_test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#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");
payloads data ( _self, from );
uint64_t key = 0;
const uint64_t num_keys = 5;
while (data.find( key ) != data.end()) {
key += num_keys;
}
for (uint64_t i = 0; i < num_keys; ++i) {
data.emplace(from, [&]( auto& g ) {
g.key = key + i;
g.data = vector<uint64_t>(num, 5);
});
}
}
};

EOSIO_ABI( integration_test, (store) )
2 changes: 1 addition & 1 deletion libraries/chain/include/eosio/chain/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const static auto default_reversible_guard_size = 2*1024*1024ll;/// 1MB * 340 bl
const static auto default_state_dir_name = "state";
const static auto forkdb_filename = "forkdb.dat";
const static auto default_state_size = 1*1024*1024*1024ll;
const static auto default_state_guard_size = 128*1024*1024ll;
const static auto default_state_guard_size = 128*1024*1024ll;


const static uint64_t system_account_name = N(eosio);
Expand Down
Loading