Compare commits

...

5 Commits

Author SHA1 Message Date
Dark Sun 3e7f4e7254 update Dockerfile 2024-04-10 17:47:14 +03:00
Dark Sun 3be71635ac Dockerfile 2024-04-10 17:13:09 +03:00
Dark Sun e6c412e2c3 Dockerfile 2024-04-10 17:12:03 +03:00
Dark Sun 960076f4ce update version 2024-04-10 10:38:12 +03:00
Dark Sun 7d12b93e7e add get_account_ram_usage method 2024-04-09 18:45:15 +03:00
6 changed files with 42 additions and 3 deletions
+3 -3
View File
@@ -14,9 +14,9 @@ endif()
project(cdt)
set(VERSION_MAJOR 4)
set(VERSION_MINOR 0)
set(VERSION_PATCH 1)
set(VERSION_SUFFIX "rc1")
set(VERSION_MINOR 1)
set(VERSION_PATCH 0)
# set(VERSION_SUFFIX "rc1")
if (VERSION_SUFFIX)
set(VERSION_FULL "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-${VERSION_SUFFIX}")
+9
View File
@@ -0,0 +1,9 @@
FROM ubuntu:latest
WORKDIR /workdir
COPY build/cdt_*.deb /workdir
RUN apt-get update && apt-get install -y wget cmake build-essential g++ libboost-all-dev libz3-dev && \
apt install ./cdt_*.deb -y && \
rm cdt_*.deb
@@ -10,6 +10,16 @@ extern "C" {
* @brief Defines %C Privileged API
*/
/**
* Get the RAM usage an account
*
* @param account - name of the account whose resource limit to get
* @param used_ram_bytes - pointer to `int64_t` to hold retrieved ram usage in absolute bytes
*/
__attribute__((eosio_wasm_import))
void get_account_ram_usage( capi_name account, int64_t* used_ram_bytes );
/**
* Get the resource limits of an account
*
@@ -12,6 +12,9 @@ namespace eosio {
__attribute__((eosio_wasm_import))
bool is_privileged( uint64_t account );
__attribute__((eosio_wasm_import))
void get_account_ram_usage( uint64_t account, int64_t* used_ram_bytes );
__attribute__((eosio_wasm_import))
void get_resource_limits( uint64_t account, int64_t* ram_bytes, int64_t* net_weight, int64_t* cpu_weight );
@@ -182,6 +185,19 @@ namespace eosio {
*/
void get_blockchain_parameters(eosio::blockchain_parameters& params);
/**
* Get the ram usage of an account
*
* @ingroup privileged
* @param account - name of the account whose resource limit to get
* @param used_ram_bytes - output to hold retrieved ram usage in absolute bytes
*/
inline void get_account_ram_usage( name account, int64_t& used_ram_bytes ) {
internal_use_do_not_use::get_account_ram_usage( account.value, &used_ram_bytes);
}
/**
* Get the resource limits of an account
*
+3
View File
@@ -16,6 +16,9 @@
// Boilerplate
using namespace eosio::native;
extern "C" {
void get_account_ram_usage( capi_name account, int64_t* used_ram_bytes ) {
return intrinsics::get().call<intrinsics::get_account_ram_usage>(account, used_ram_bytes);
}
void get_resource_limits( capi_name account, int64_t* ram_bytes, int64_t* net_weight, int64_t* cpu_weight ) {
return intrinsics::get().call<intrinsics::get_resource_limits>(account, ram_bytes, net_weight, cpu_weight);
}
@@ -43,6 +43,7 @@ namespace eosio { namespace native {
}
#define INTRINSICS(intrinsic_macro) \
intrinsic_macro(get_account_ram_usage) \
intrinsic_macro(get_resource_limits) \
intrinsic_macro(set_resource_limits) \
intrinsic_macro(set_proposed_producers) \