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

Commit

Permalink
Merge pull request #333 from EOSIO/change-cdt-dependency
Browse files Browse the repository at this point in the history
Update minimum CDT dependency to 1.7.x
  • Loading branch information
arhag authored Sep 27, 2019
2 parents c2bafcc + 1e4b8de commit c9b1333
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 81 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.5)
project(eosio_contracts)

set(VERSION_MAJOR 1)
set(VERSION_MINOR 8)
set(VERSION_MINOR 9)
set(VERSION_PATCH 0)
set(VERSION_SUFFIX rc1)

Expand All @@ -19,8 +19,8 @@ find_package(eosio.cdt)

message(STATUS "Building eosio.contracts v${VERSION_FULL}")

set(EOSIO_CDT_VERSION_MIN "1.6")
set(EOSIO_CDT_VERSION_SOFT_MAX "1.6")
set(EOSIO_CDT_VERSION_MIN "1.7")
set(EOSIO_CDT_VERSION_SOFT_MAX "1.7")
#set(EOSIO_CDT_VERSION_HARD_MAX "")

### Check the version of eosio.cdt
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The following unprivileged contract(s) are also part of the system.
* [eosio.token](./contracts/eosio.token)

Dependencies:
* [eosio.cdt v1.6.x](https://github.com/EOSIO/eosio.cdt/releases/tag/v1.6.2)
* [eosio.cdt v1.7.x](https://github.com/EOSIO/eosio.cdt/releases/tag/v1.7.0-rc1)
* [eosio v1.8.x](https://github.com/EOSIO/eos/releases/tag/v1.8.1) (optional dependency only needed to build unit tests)

To build contracts alone:
Expand Down
41 changes: 7 additions & 34 deletions contracts/eosio.bios/include/eosio.bios/eosio.bios.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,6 @@
#include <eosio/privileged.hpp>
#include <eosio/producer_schedule.hpp>

// This header is needed until `is_feature_activiated` and `preactivate_feature` are added to `eosio.cdt`
#include <eosio/../../capi/eosio/crypto.h>

namespace eosio {
namespace internal_use_do_not_use {
extern "C" {
__attribute__((eosio_wasm_import))
bool is_feature_activated( const ::capi_checksum256* feature_digest );

__attribute__((eosio_wasm_import))
void preactivate_feature( const ::capi_checksum256* feature_digest );
}
}
}

namespace eosio {
bool is_feature_activated( const eosio::checksum256& feature_digest ) {
auto feature_digest_data = feature_digest.extract_as_byte_array();
return internal_use_do_not_use::is_feature_activated(
reinterpret_cast<const ::capi_checksum256*>( feature_digest_data.data() )
);
}

void preactivate_feature( const eosio::checksum256& feature_digest ) {
auto feature_digest_data = feature_digest.extract_as_byte_array();
internal_use_do_not_use::preactivate_feature(
reinterpret_cast<const ::capi_checksum256*>( feature_digest_data.data() )
);
}
}

/**
* EOSIO Contracts
*
Expand All @@ -57,9 +26,13 @@ namespace eosio {
* - eosio.token
*/

namespace eosio {
namespace eosiobios {

using eosio::action_wrapper;
using eosio::check;
using eosio::checksum256;
using eosio::ignore;
using eosio::name;
using eosio::permission_level;
using eosio::public_key;

Expand Down Expand Up @@ -161,7 +134,7 @@ namespace eosio {
*
* @{
*/
class [[eosio::contract("eosio.bios")]] bios : public contract {
class [[eosio::contract("eosio.bios")]] bios : public eosio::contract {
public:
using contract::contract;
/**
Expand Down Expand Up @@ -420,4 +393,4 @@ namespace eosio {
using reqactivated_action = action_wrapper<"reqactivated"_n, &bios::reqactivated>;
};
/** @}*/ // end of @defgroup eosiobios eosio.bios
} /// namespace eosio
} /// namespace eosiobios
8 changes: 4 additions & 4 deletions contracts/eosio.bios/src/eosio.bios.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#include <eosio.bios/eosio.bios.hpp>

namespace eosio {
namespace eosiobios {

void bios::setabi( name account, const std::vector<char>& abi ) {
abi_hash_table table(get_self(), get_self().value);
auto itr = table.find( account.value );
if( itr == table.end() ) {
table.emplace( account, [&]( auto& row ) {
row.owner = account;
row.hash = sha256(const_cast<char*>(abi.data()), abi.size());
row.hash = eosio::sha256(const_cast<char*>(abi.data()), abi.size());
});
} else {
table.modify( itr, same_payer, [&]( auto& row ) {
row.hash = sha256(const_cast<char*>(abi.data()), abi.size());
table.modify( itr, eosio::same_payer, [&]( auto& row ) {
row.hash = eosio::sha256(const_cast<char*>(abi.data()), abi.size());
});
}
}
Expand Down
6 changes: 2 additions & 4 deletions contracts/eosio.msig/src/eosio.msig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ void multisig::propose( ignore<name> proposer,
check( proptable.find( _proposal_name.value ) == proptable.end(), "proposal with the same name exists" );

auto packed_requested = pack(_requested);
// TODO: Remove internal_use_do_not_use namespace after minimum eosio.cdt dependency becomes 1.7.x
auto res = internal_use_do_not_use::check_transaction_authorization(
auto res = check_transaction_authorization(
trx_pos, size,
(const char*)0, 0,
packed_requested.data(), packed_requested.size()
Expand Down Expand Up @@ -175,8 +174,7 @@ void multisig::exec( name proposer, name proposal_name, name executer ) {
old_apptable.erase(apps);
}
auto packed_provided_approvals = pack(approvals);
// TODO: Remove internal_use_do_not_use namespace after minimum eosio.cdt dependency becomes 1.7.x
auto res = internal_use_do_not_use::check_transaction_authorization(
auto res = check_transaction_authorization(
prop.packed_transaction.data(), prop.packed_transaction.size(),
(const char*)0, 0,
packed_provided_approvals.data(), packed_provided_approvals.size()
Expand Down
18 changes: 0 additions & 18 deletions contracts/eosio.system/include/eosio.system/native.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,6 @@
#include <eosio/privileged.hpp>
#include <eosio/producer_schedule.hpp>

// This header is needed until `is_feature_activiated` and `preactivate_feature` are added to `eosio.cdt`
#include <eosio/../../capi/eosio/crypto.h>

namespace eosio {
namespace internal_use_do_not_use {
extern "C" {
__attribute__((eosio_wasm_import))
bool is_feature_activated( const ::capi_checksum256* feature_digest );

__attribute__((eosio_wasm_import))
void preactivate_feature( const ::capi_checksum256* feature_digest );
}
}

bool is_feature_activated( const eosio::checksum256& feature_digest );
void preactivate_feature( const eosio::checksum256& feature_digest );
}

namespace eosiosystem {

using eosio::checksum256;
Expand Down
16 changes: 0 additions & 16 deletions contracts/eosio.system/src/native.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,6 @@

#include <eosio/check.hpp>

namespace eosio {
bool is_feature_activated( const eosio::checksum256& feature_digest ) {
auto feature_digest_data = feature_digest.extract_as_byte_array();
return internal_use_do_not_use::is_feature_activated(
reinterpret_cast<const ::capi_checksum256*>( feature_digest_data.data() )
);
}

void preactivate_feature( const eosio::checksum256& feature_digest ) {
auto feature_digest_data = feature_digest.extract_as_byte_array();
internal_use_do_not_use::preactivate_feature(
reinterpret_cast<const ::capi_checksum256*>( feature_digest_data.data() )
);
}
}

namespace eosiosystem {

void native::onerror( ignore<uint128_t>, ignore<std::vector<char>> ) {
Expand Down
2 changes: 1 addition & 1 deletion pipeline.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"dependencies": // dependencies to pull for a build of contracts, by branch, tag, or commit hash
{
"eosio": "release/1.8.x",
"eosio.cdt": "release/1.6.x"
"eosio.cdt": "0e9b9b0ca5244d0caae4ea1c23ebcd3e7c7398fc" // eventually update to release/1.7.x
}
}
}

0 comments on commit c9b1333

Please sign in to comment.