Skip to content
Merged
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
4 changes: 2 additions & 2 deletions src/bins/faucet-api/src/httpserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ namespace Faucet {
std::vector<std::thread> v;
v.reserve(4 - 1);
for (int i = 4 - 1; i > 0; i--) v.emplace_back([&]{ this->ioc_.run(); });
LOGINFO(std::string("HTTP Server Started at port: ") + std::to_string(port_));
LOGTRACE(std::string("HTTP server started at port: ") + std::to_string(port_));
this->ioc_.run();

// If we get here, it means we got a SIGINT or SIGTERM. Block until all the threads exit
for (std::thread& t : v) t.join();
LOGINFO("HTTP Server Stopped");
LOGTRACE("HTTP server stopped");
return true;
}

Expand Down
2 changes: 2 additions & 0 deletions src/contract/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ set(CONTRACT_HEADERS
${CMAKE_SOURCE_DIR}/src/contract/templates/dexv2/dexv2router02.h
${CMAKE_SOURCE_DIR}/src/contract/templates/dexv2/uq112x112.h
${CMAKE_SOURCE_DIR}/src/contract/templates/pebble.h
${CMAKE_SOURCE_DIR}/src/contract/templates/systemcontract.h
${CMAKE_SOURCE_DIR}/src/contract/templates/throwtestA.h
${CMAKE_SOURCE_DIR}/src/contract/templates/throwtestB.h
${CMAKE_SOURCE_DIR}/src/contract/templates/throwtestC.h
Expand Down Expand Up @@ -74,6 +75,7 @@ set(CONTRACT_SOURCES
${CMAKE_SOURCE_DIR}/src/contract/templates/dexv2/dexv2pair.cpp
${CMAKE_SOURCE_DIR}/src/contract/templates/dexv2/dexv2router02.cpp
${CMAKE_SOURCE_DIR}/src/contract/templates/pebble.cpp
${CMAKE_SOURCE_DIR}/src/contract/templates/systemcontract.cpp
${CMAKE_SOURCE_DIR}/src/contract/templates/throwtestA.cpp
${CMAKE_SOURCE_DIR}/src/contract/templates/throwtestB.cpp
${CMAKE_SOURCE_DIR}/src/contract/templates/throwtestC.cpp
Expand Down
21 changes: 20 additions & 1 deletion src/contract/customcontracts.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ This software is distributed under the MIT License.
See the LICENSE.txt file in the project root for more information.
*/

#ifndef CUSTOMCONTRACTS_H
#define CUSTOMCONTRACTS_H

#include "templates/erc20.h"
#include "templates/erc20wrapper.h"
#include "templates/nativewrapper.h"
Expand All @@ -23,12 +26,14 @@ See the LICENSE.txt file in the project root for more information.
#include "templates/snailtraceroptimized.h"
#include "templates/ownable.h"
#include "templates/pebble.h"
#include "templates/systemcontract.h"

/// Typedef for the blockchain's registered contracts.
#ifdef BUILD_TESTNET
/// Typedef for the blockchain's registered contracts in TESTNET mode.
using ContractTypes = std::tuple<
ERC20, NativeWrapper, DEXV2Pair, DEXV2Factory, DEXV2Router02, ERC721, ERC721URIStorage, Ownable, Pebble
ERC20, NativeWrapper, DEXV2Pair, DEXV2Factory, DEXV2Router02, ERC721, ERC721URIStorage,
Ownable, Pebble
>;
#else
/// Typedef for the blockchain's registered contracts in normal mode.
Expand All @@ -39,3 +44,17 @@ using ContractTypes = std::tuple<
>;
#endif

/// Typedef for all protocol contracts that have state to persist.
using StatefulProtocolContractTypes = std::tuple<
SystemContract
>;

/// Typedef for all contracts (protocol or not) with state to persist.
using PersistedContractTypes = decltype(
std::tuple_cat(
std::declval<ContractTypes>(),
std::declval<StatefulProtocolContractTypes>()
)
);

#endif // CUSTOMCONTRACTS_H
2 changes: 1 addition & 1 deletion src/contract/executioncontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void ExecutionContext::transferBalance(View<Address> fromAddress, View<Address>
auto recipient = getAccount(toAddress);

if (sender.getBalance() < amount) {
throw DynamicException("insufficient founds");
throw DynamicException("ExecutionContext::transferBalance(): insufficient funds");
}

sender.setBalance(sender.getBalance() - amount);
Expand Down
Loading