pub const _STDINT_H: u32 = 1;
pub const _FEATURES_H: u32 = 1;
pub const _DEFAULT_SOURCE: u32 = 1;
pub const __GLIBC_USE_ISOC2Y: u32 = 0;
pub const __GLIBC_USE_ISOC23: u32 = 0;
pub const __USE_ISOC11: u32 = 1;
pub const __USE_ISOC99: u32 = 1;
pub const __USE_ISOC95: u32 = 1;
pub const __USE_POSIX_IMPLICITLY: u32 = 1;
pub const _POSIX_SOURCE: u32 = 1;
pub const _POSIX_C_SOURCE: u32 = 202405;
pub const __USE_POSIX: u32 = 1;
pub const __USE_POSIX2: u32 = 1;
pub const __USE_POSIX199309: u32 = 1;
pub const __USE_POSIX199506: u32 = 1;
pub const __USE_XOPEN2K: u32 = 1;
pub const __USE_XOPEN2K8: u32 = 1;
pub const _ATFILE_SOURCE: u32 = 1;
pub const __USE_XOPEN2K24: u32 = 1;
pub const __WORDSIZE: u32 = 64;
pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1;
pub const __SYSCALL_WORDSIZE: u32 = 64;
pub const __TIMESIZE: u32 = 64;
pub const __USE_TIME_BITS64: u32 = 1;
pub const __USE_MISC: u32 = 1;
pub const __USE_ATFILE: u32 = 1;
pub const __USE_FORTIFY_LEVEL: u32 = 0;
pub const __GLIBC_USE_DEPRECATED_GETS: u32 = 0;
pub const __GLIBC_USE_DEPRECATED_SCANF: u32 = 0;
pub const __GLIBC_USE_C23_STRTOL: u32 = 0;
pub const _STDC_PREDEF_H: u32 = 1;
pub const __STDC_IEC_559__: u32 = 1;
pub const __STDC_IEC_60559_BFP__: u32 = 201404;
pub const __STDC_IEC_559_COMPLEX__: u32 = 1;
pub const __STDC_IEC_60559_COMPLEX__: u32 = 201404;
pub const __STDC_ISO_10646__: u32 = 201706;
pub const __GNU_LIBRARY__: u32 = 6;
pub const __GLIBC__: u32 = 2;
pub const __GLIBC_MINOR__: u32 = 44;
pub const _SYS_CDEFS_H: u32 = 1;
pub const __glibc_c99_flexarr_available: u32 = 1;
pub const __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI: u32 = 0;
pub const __HAVE_GENERIC_SELECTION: u32 = 1;
pub const __GLIBC_USE_LIB_EXT2: u32 = 0;
pub const __GLIBC_USE_IEC_60559_BFP_EXT: u32 = 0;
pub const __GLIBC_USE_IEC_60559_BFP_EXT_C23: u32 = 0;
pub const __GLIBC_USE_IEC_60559_EXT: u32 = 0;
pub const __GLIBC_USE_IEC_60559_FUNCS_EXT: u32 = 0;
pub const __GLIBC_USE_IEC_60559_FUNCS_EXT_C23: u32 = 0;
pub const __GLIBC_USE_IEC_60559_TYPES_EXT: u32 = 0;
pub const _BITS_TYPES_H: u32 = 1;
pub const _BITS_TYPESIZES_H: u32 = 1;
pub const __OFF_T_MATCHES_OFF64_T: u32 = 1;
pub const __INO_T_MATCHES_INO64_T: u32 = 1;
pub const __RLIM_T_MATCHES_RLIM64_T: u32 = 1;
pub const __STATFS_MATCHES_STATFS64: u32 = 1;
pub const __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64: u32 = 1;
pub const __FD_SETSIZE: u32 = 1024;
pub const _BITS_TIME64_H: u32 = 1;
pub const _BITS_WCHAR_H: u32 = 1;
pub const _BITS_STDINT_INTN_H: u32 = 1;
pub const _BITS_STDINT_UINTN_H: u32 = 1;
pub const _BITS_STDINT_LEAST_H: u32 = 1;
pub const INT8_MIN: i32 = -128;
pub const INT16_MIN: i32 = -32768;
pub const INT32_MIN: i32 = -2147483648;
pub const INT8_MAX: u32 = 127;
pub const INT16_MAX: u32 = 32767;
pub const INT32_MAX: u32 = 2147483647;
pub const UINT8_MAX: u32 = 255;
pub const UINT16_MAX: u32 = 65535;
pub const UINT32_MAX: u32 = 4294967295;
pub const INT_LEAST8_MIN: i32 = -128;
pub const INT_LEAST16_MIN: i32 = -32768;
pub const INT_LEAST32_MIN: i32 = -2147483648;
pub const INT_LEAST8_MAX: u32 = 127;
pub const INT_LEAST16_MAX: u32 = 32767;
pub const INT_LEAST32_MAX: u32 = 2147483647;
pub const UINT_LEAST8_MAX: u32 = 255;
pub const UINT_LEAST16_MAX: u32 = 65535;
pub const UINT_LEAST32_MAX: u32 = 4294967295;
pub const INT_FAST8_MIN: i32 = -128;
pub const INT_FAST16_MIN: i64 = -9223372036854775808;
pub const INT_FAST32_MIN: i64 = -9223372036854775808;
pub const INT_FAST8_MAX: u32 = 127;
pub const INT_FAST16_MAX: u64 = 9223372036854775807;
pub const INT_FAST32_MAX: u64 = 9223372036854775807;
pub const UINT_FAST8_MAX: u32 = 255;
pub const UINT_FAST16_MAX: i32 = -1;
pub const UINT_FAST32_MAX: i32 = -1;
pub const INTPTR_MIN: i64 = -9223372036854775808;
pub const INTPTR_MAX: u64 = 9223372036854775807;
pub const UINTPTR_MAX: i32 = -1;
pub const PTRDIFF_MIN: i64 = -9223372036854775808;
pub const PTRDIFF_MAX: u64 = 9223372036854775807;
pub const SIG_ATOMIC_MIN: i32 = -2147483648;
pub const SIG_ATOMIC_MAX: u32 = 2147483647;
pub const SIZE_MAX: i32 = -1;
pub const WINT_MIN: u32 = 0;
pub const WINT_MAX: u32 = 4294967295;
pub const TEST_FFI_VERSION_MAJOR: u32 = 0;
pub const TEST_FFI_VERSION_MINOR: u32 = 42;
pub const TEST_FFI_VERSION_PATCH: u32 = 0;
pub type __u_char = ::std::os::raw::c_uchar;
pub type __u_short = ::std::os::raw::c_ushort;
pub type __u_int = ::std::os::raw::c_uint;
pub type __u_long = ::std::os::raw::c_ulong;
pub type __int8_t = ::std::os::raw::c_schar;
pub type __uint8_t = ::std::os::raw::c_uchar;
pub type __int16_t = ::std::os::raw::c_short;
pub type __uint16_t = ::std::os::raw::c_ushort;
pub type __int32_t = ::std::os::raw::c_int;
pub type __uint32_t = ::std::os::raw::c_uint;
pub type __int64_t = ::std::os::raw::c_long;
pub type __uint64_t = ::std::os::raw::c_ulong;
pub type __int_least8_t = __int8_t;
pub type __uint_least8_t = __uint8_t;
pub type __int_least16_t = __int16_t;
pub type __uint_least16_t = __uint16_t;
pub type __int_least32_t = __int32_t;
pub type __uint_least32_t = __uint32_t;
pub type __int_least64_t = __int64_t;
pub type __uint_least64_t = __uint64_t;
pub type __quad_t = ::std::os::raw::c_long;
pub type __u_quad_t = ::std::os::raw::c_ulong;
pub type __intmax_t = ::std::os::raw::c_long;
pub type __uintmax_t = ::std::os::raw::c_ulong;
pub type __dev_t = ::std::os::raw::c_ulong;
pub type __uid_t = ::std::os::raw::c_uint;
pub type __gid_t = ::std::os::raw::c_uint;
pub type __ino_t = ::std::os::raw::c_ulong;
pub type __ino64_t = ::std::os::raw::c_ulong;
pub type __mode_t = ::std::os::raw::c_uint;
pub type __nlink_t = ::std::os::raw::c_ulong;
pub type __off_t = ::std::os::raw::c_long;
pub type __off64_t = ::std::os::raw::c_long;
pub type __pid_t = ::std::os::raw::c_int;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct __fsid_t {
pub __val: [::std::os::raw::c_int; 2usize],
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of __fsid_t"][::std::mem::size_of::<__fsid_t>() - 8usize];
["Alignment of __fsid_t"][::std::mem::align_of::<__fsid_t>() - 4usize];
["Offset of field: __fsid_t::__val"]
[::std::mem::offset_of!(__fsid_t, __val) - 0usize];
};
pub type __clock_t = ::std::os::raw::c_long;
pub type __rlim_t = ::std::os::raw::c_ulong;
pub type __rlim64_t = ::std::os::raw::c_ulong;
pub type __id_t = ::std::os::raw::c_uint;
pub type __time_t = ::std::os::raw::c_long;
pub type __useconds_t = ::std::os::raw::c_uint;
pub type __suseconds_t = ::std::os::raw::c_long;
pub type __suseconds64_t = ::std::os::raw::c_long;
pub type __daddr_t = ::std::os::raw::c_int;
pub type __key_t = ::std::os::raw::c_int;
pub type __clockid_t = ::std::os::raw::c_int;
pub type __timer_t = *mut ::std::os::raw::c_void;
pub type __blksize_t = ::std::os::raw::c_long;
pub type __blkcnt_t = ::std::os::raw::c_long;
pub type __blkcnt64_t = ::std::os::raw::c_long;
pub type __fsblkcnt_t = ::std::os::raw::c_ulong;
pub type __fsblkcnt64_t = ::std::os::raw::c_ulong;
pub type __fsfilcnt_t = ::std::os::raw::c_ulong;
pub type __fsfilcnt64_t = ::std::os::raw::c_ulong;
pub type __fsword_t = ::std::os::raw::c_long;
pub type __ssize_t = ::std::os::raw::c_long;
pub type __syscall_slong_t = ::std::os::raw::c_long;
pub type __syscall_ulong_t = ::std::os::raw::c_ulong;
pub type __loff_t = __off64_t;
pub type __caddr_t = *mut ::std::os::raw::c_char;
pub type __intptr_t = ::std::os::raw::c_long;
pub type __socklen_t = ::std::os::raw::c_uint;
pub type __sig_atomic_t = ::std::os::raw::c_int;
pub type int_least8_t = __int_least8_t;
pub type int_least16_t = __int_least16_t;
pub type int_least32_t = __int_least32_t;
pub type int_least64_t = __int_least64_t;
pub type uint_least8_t = __uint_least8_t;
pub type uint_least16_t = __uint_least16_t;
pub type uint_least32_t = __uint_least32_t;
pub type uint_least64_t = __uint_least64_t;
pub type int_fast8_t = ::std::os::raw::c_schar;
pub type int_fast16_t = ::std::os::raw::c_long;
pub type int_fast32_t = ::std::os::raw::c_long;
pub type int_fast64_t = ::std::os::raw::c_long;
pub type uint_fast8_t = ::std::os::raw::c_uchar;
pub type uint_fast16_t = ::std::os::raw::c_ulong;
pub type uint_fast32_t = ::std::os::raw::c_ulong;
pub type uint_fast64_t = ::std::os::raw::c_ulong;
pub type intmax_t = __intmax_t;
pub type uintmax_t = __uintmax_t;
pub const TestFFIErrorCode_kTestFFIErrorCodeNone: TestFFIErrorCode = 0;
pub const TestFFIErrorCode_kTestFFIErrorCodeInvalidPointer: TestFFIErrorCode =
1;
pub const TestFFIErrorCode_kTestFFIErrorCodeDeployNonexistentContract:
TestFFIErrorCode = 2;
pub const TestFFIErrorCode_kTestFFIErrorCodeCreateNonexistentMockContract:
TestFFIErrorCode = 3;
pub const TestFFIErrorCode_kTestFFIErrorCodeDeserializeError: TestFFIErrorCode =
4;
pub const TestFFIErrorCode_kTestFFIErrorCodeUnrecoverableError:
TestFFIErrorCode = 5;
pub const TestFFIErrorCode_kTestFFIErrorCodeContractVerificationFailed:
TestFFIErrorCode = 6;
pub const TestFFIErrorCode_kTestFFIErrorCodeInvalidArgument: TestFFIErrorCode =
7;
pub type TestFFIErrorCode = ::std::os::raw::c_uint;
pub const TestFFILogLevel_kTestFFILogLevelCritical: TestFFILogLevel = 0;
pub const TestFFILogLevel_kTestFFILogLevelError: TestFFILogLevel = 1;
pub const TestFFILogLevel_kTestFFILogLevelWarn: TestFFILogLevel = 2;
pub const TestFFILogLevel_kTestFFILogLevelInfo: TestFFILogLevel = 3;
pub const TestFFILogLevel_kTestFFILogLevelDebug: TestFFILogLevel = 4;
pub const TestFFILogLevel_kTestFFILogLevelTrace: TestFFILogLevel = 5;
pub type TestFFILogLevel = ::std::os::raw::c_uint;
#[repr(C)]
#[derive(Debug)]
pub struct FFIDataBuffer {
pub data: *mut u8,
pub len: u64,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of FFIDataBuffer"][::std::mem::size_of::<FFIDataBuffer>() - 16usize];
["Alignment of FFIDataBuffer"]
[::std::mem::align_of::<FFIDataBuffer>() - 8usize];
["Offset of field: FFIDataBuffer::data"]
[::std::mem::offset_of!(FFIDataBuffer, data) - 0usize];
["Offset of field: FFIDataBuffer::len"]
[::std::mem::offset_of!(FFIDataBuffer, len) - 8usize];
};
unsafe extern "C" {
pub fn free_ffi_data_buffer(buffer: FFIDataBuffer) -> TestFFIErrorCode;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ForeignInvokeResult {
pub panic: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of ForeignInvokeResult"]
[::std::mem::size_of::<ForeignInvokeResult>() - 4usize];
["Alignment of ForeignInvokeResult"]
[::std::mem::align_of::<ForeignInvokeResult>() - 4usize];
["Offset of field: ForeignInvokeResult::panic"]
[::std::mem::offset_of!(ForeignInvokeResult, panic) - 0usize];
};
#[repr(C)]
#[derive(Debug)]
pub struct ForeignTracedInvokeResult {
pub serialized_output: FFIDataBuffer,
pub gas_consumed: u64,
pub serialized_trace: FFIDataBuffer,
pub serialized_events: FFIDataBuffer,
pub ffi_error_code: TestFFIErrorCode,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of ForeignTracedInvokeResult"]
[::std::mem::size_of::<ForeignTracedInvokeResult>() - 64usize];
["Alignment of ForeignTracedInvokeResult"]
[::std::mem::align_of::<ForeignTracedInvokeResult>() - 8usize];
["Offset of field: ForeignTracedInvokeResult::serialized_output"][::std::mem::offset_of!(
ForeignTracedInvokeResult,
serialized_output
)
- 0usize];
["Offset of field: ForeignTracedInvokeResult::gas_consumed"][::std::mem::offset_of!(
ForeignTracedInvokeResult,
gas_consumed
) - 16usize];
["Offset of field: ForeignTracedInvokeResult::serialized_trace"][::std::mem::offset_of!(
ForeignTracedInvokeResult,
serialized_trace
)
- 24usize];
["Offset of field: ForeignTracedInvokeResult::serialized_events"][::std::mem::offset_of!(
ForeignTracedInvokeResult,
serialized_events
)
- 40usize];
["Offset of field: ForeignTracedInvokeResult::ffi_error_code"][::std::mem::offset_of!(
ForeignTracedInvokeResult,
ffi_error_code
) - 56usize];
};
pub type ForeignEntryPoint = ::std::option::Option<
unsafe extern "C" fn(
foreign_context: *mut ::std::os::raw::c_void,
method_number: u64,
) -> ForeignInvokeResult,
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ForeignHostFnResult {
pub result_code: i32,
pub panic: i32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of ForeignHostFnResult"]
[::std::mem::size_of::<ForeignHostFnResult>() - 8usize];
["Alignment of ForeignHostFnResult"]
[::std::mem::align_of::<ForeignHostFnResult>() - 4usize];
["Offset of field: ForeignHostFnResult::result_code"]
[::std::mem::offset_of!(ForeignHostFnResult, result_code) - 0usize];
["Offset of field: ForeignHostFnResult::panic"]
[::std::mem::offset_of!(ForeignHostFnResult, panic) - 4usize];
};
#[repr(C)]
#[derive(Debug)]
pub struct ForeignTryCommitResult {
pub result_code: i32,
pub serialized_conflict: FFIDataBuffer,
pub ffi_error_code: TestFFIErrorCode,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of ForeignTryCommitResult"]
[::std::mem::size_of::<ForeignTryCommitResult>() - 32usize];
["Alignment of ForeignTryCommitResult"]
[::std::mem::align_of::<ForeignTryCommitResult>() - 8usize];
["Offset of field: ForeignTryCommitResult::result_code"]
[::std::mem::offset_of!(ForeignTryCommitResult, result_code) - 0usize];
["Offset of field: ForeignTryCommitResult::serialized_conflict"][::std::mem::offset_of!(
ForeignTryCommitResult,
serialized_conflict
)
- 8usize];
["Offset of field: ForeignTryCommitResult::ffi_error_code"][::std::mem::offset_of!(
ForeignTryCommitResult,
ffi_error_code
) - 24usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CreateDBResult {
pub db: *mut ::std::os::raw::c_void,
pub ffi_error_code: TestFFIErrorCode,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of CreateDBResult"]
[::std::mem::size_of::<CreateDBResult>() - 16usize];
["Alignment of CreateDBResult"]
[::std::mem::align_of::<CreateDBResult>() - 8usize];
["Offset of field: CreateDBResult::db"]
[::std::mem::offset_of!(CreateDBResult, db) - 0usize];
["Offset of field: CreateDBResult::ffi_error_code"]
[::std::mem::offset_of!(CreateDBResult, ffi_error_code) - 8usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct FFIRv32StackUsage {
pub contract_address: [u8; 32usize],
pub method_id: u64,
pub sp_initial: u32,
pub sp_min: u32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of FFIRv32StackUsage"]
[::std::mem::size_of::<FFIRv32StackUsage>() - 48usize];
["Alignment of FFIRv32StackUsage"]
[::std::mem::align_of::<FFIRv32StackUsage>() - 8usize];
["Offset of field: FFIRv32StackUsage::contract_address"]
[::std::mem::offset_of!(FFIRv32StackUsage, contract_address) - 0usize];
["Offset of field: FFIRv32StackUsage::method_id"]
[::std::mem::offset_of!(FFIRv32StackUsage, method_id) - 32usize];
["Offset of field: FFIRv32StackUsage::sp_initial"]
[::std::mem::offset_of!(FFIRv32StackUsage, sp_initial) - 40usize];
["Offset of field: FFIRv32StackUsage::sp_min"]
[::std::mem::offset_of!(FFIRv32StackUsage, sp_min) - 44usize];
};
#[repr(C)]
#[derive(Debug)]
pub struct GetRv32StackUsageResult {
pub records: FFIDataBuffer,
pub ffi_error_code: TestFFIErrorCode,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GetRv32StackUsageResult"]
[::std::mem::size_of::<GetRv32StackUsageResult>() - 24usize];
["Alignment of GetRv32StackUsageResult"]
[::std::mem::align_of::<GetRv32StackUsageResult>() - 8usize];
["Offset of field: GetRv32StackUsageResult::records"]
[::std::mem::offset_of!(GetRv32StackUsageResult, records) - 0usize];
["Offset of field: GetRv32StackUsageResult::ffi_error_code"][::std::mem::offset_of!(
GetRv32StackUsageResult,
ffi_error_code
) - 16usize];
};
#[repr(C)]
#[derive(Debug)]
pub struct GetCostModelResult {
pub data: FFIDataBuffer,
pub ffi_error_code: TestFFIErrorCode,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GetCostModelResult"]
[::std::mem::size_of::<GetCostModelResult>() - 24usize];
["Alignment of GetCostModelResult"]
[::std::mem::align_of::<GetCostModelResult>() - 8usize];
["Offset of field: GetCostModelResult::data"]
[::std::mem::offset_of!(GetCostModelResult, data) - 0usize];
["Offset of field: GetCostModelResult::ffi_error_code"]
[::std::mem::offset_of!(GetCostModelResult, ffi_error_code) - 16usize];
};
#[repr(C)]
#[derive(Debug)]
pub struct GetNetworkConfigResult {
pub data: FFIDataBuffer,
pub ffi_error_code: TestFFIErrorCode,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GetNetworkConfigResult"]
[::std::mem::size_of::<GetNetworkConfigResult>() - 24usize];
["Alignment of GetNetworkConfigResult"]
[::std::mem::align_of::<GetNetworkConfigResult>() - 8usize];
["Offset of field: GetNetworkConfigResult::data"]
[::std::mem::offset_of!(GetNetworkConfigResult, data) - 0usize];
["Offset of field: GetNetworkConfigResult::ffi_error_code"][::std::mem::offset_of!(
GetNetworkConfigResult,
ffi_error_code
) - 16usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct FFISerializedAddressAndKey {
pub data: *const u8,
pub len: u32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of FFISerializedAddressAndKey"]
[::std::mem::size_of::<FFISerializedAddressAndKey>() - 16usize];
["Alignment of FFISerializedAddressAndKey"]
[::std::mem::align_of::<FFISerializedAddressAndKey>() - 8usize];
["Offset of field: FFISerializedAddressAndKey::data"]
[::std::mem::offset_of!(FFISerializedAddressAndKey, data) - 0usize];
["Offset of field: FFISerializedAddressAndKey::len"]
[::std::mem::offset_of!(FFISerializedAddressAndKey, len) - 8usize];
};
#[repr(C)]
#[derive(Debug)]
pub struct GetSnapshotStorageItemResult {
pub data: FFIDataBuffer,
pub ffi_error_code: TestFFIErrorCode,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of GetSnapshotStorageItemResult"]
[::std::mem::size_of::<GetSnapshotStorageItemResult>() - 24usize];
["Alignment of GetSnapshotStorageItemResult"]
[::std::mem::align_of::<GetSnapshotStorageItemResult>() - 8usize];
["Offset of field: GetSnapshotStorageItemResult::data"]
[::std::mem::offset_of!(GetSnapshotStorageItemResult, data) - 0usize];
["Offset of field: GetSnapshotStorageItemResult::ffi_error_code"][::std::mem::offset_of!(
GetSnapshotStorageItemResult,
ffi_error_code
)
- 16usize];
};
unsafe extern "C" {
pub fn create_db(
serialized_cost_model: *const u8,
serialized_cost_model_len: u32,
serialized_network_hash: *const u8,
serialized_genesis_root_contract: *const u8,
serialized_genesis_root_contract_len: u32,
serialized_network_config: *const u8,
serialized_network_config_len: u32,
) -> CreateDBResult;
}
unsafe extern "C" {
pub fn free_db(ptr: *mut ::std::os::raw::c_void) -> TestFFIErrorCode;
}
unsafe extern "C" {
pub fn get_cost_model(
db: *mut ::std::os::raw::c_void,
) -> GetCostModelResult;
}
unsafe extern "C" {
pub fn get_network_config(
db: *mut ::std::os::raw::c_void,
) -> GetNetworkConfigResult;
}
unsafe extern "C" {
pub fn get_snapshot_storage_item(
db: *mut ::std::os::raw::c_void,
addrkey: FFISerializedAddressAndKey,
) -> GetSnapshotStorageItemResult;
}
unsafe extern "C" {
pub fn advance_new_block(
db: *mut ::std::os::raw::c_void,
block_timepoint: *const u64,
) -> TestFFIErrorCode;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OpenRuntimeContextResult {
pub context: *mut ::std::os::raw::c_void,
pub ffi_error_code: TestFFIErrorCode,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of OpenRuntimeContextResult"]
[::std::mem::size_of::<OpenRuntimeContextResult>() - 16usize];
["Alignment of OpenRuntimeContextResult"]
[::std::mem::align_of::<OpenRuntimeContextResult>() - 8usize];
["Offset of field: OpenRuntimeContextResult::context"]
[::std::mem::offset_of!(OpenRuntimeContextResult, context) - 0usize];
["Offset of field: OpenRuntimeContextResult::ffi_error_code"][::std::mem::offset_of!(
OpenRuntimeContextResult,
ffi_error_code
) - 8usize];
};
unsafe extern "C" {
pub fn open_runtime_context() -> OpenRuntimeContextResult;
}
unsafe extern "C" {
pub fn close_runtime_context(
context: *mut ::std::os::raw::c_void,
) -> TestFFIErrorCode;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct FFISerializedSignedTransaction {
pub data: *mut u8,
pub len: u32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of FFISerializedSignedTransaction"]
[::std::mem::size_of::<FFISerializedSignedTransaction>() - 16usize];
["Alignment of FFISerializedSignedTransaction"]
[::std::mem::align_of::<FFISerializedSignedTransaction>() - 8usize];
["Offset of field: FFISerializedSignedTransaction::data"]
[::std::mem::offset_of!(FFISerializedSignedTransaction, data) - 0usize];
["Offset of field: FFISerializedSignedTransaction::len"]
[::std::mem::offset_of!(FFISerializedSignedTransaction, len) - 8usize];
};
unsafe extern "C" {
pub fn register_new_contract(
context: *mut ::std::os::raw::c_void,
mock_contract_id: i32,
entry_point: ForeignEntryPoint,
foreign_context: *mut ::std::os::raw::c_void,
) -> TestFFIErrorCode;
}
unsafe extern "C" {
pub fn setup_create_contract(
context: *mut ::std::os::raw::c_void,
db: *mut ::std::os::raw::c_void,
contract_bytes: *const u8,
contract_len: u32,
) -> TestFFIErrorCode;
}
unsafe extern "C" {
pub fn setup_deploy_contract(
db: *mut ::std::os::raw::c_void,
deployment_addr: *const u8,
contract_hash: *const u8,
contract_size: u32,
) -> TestFFIErrorCode;
}
unsafe extern "C" {
pub fn setup_grant_contract_storage_tokens(
db: *mut ::std::os::raw::c_void,
contract_addr: *const u8,
tokens: i64,
) -> TestFFIErrorCode;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OpenSyscallHandlerResult {
pub syscall_handler: *mut ::std::os::raw::c_void,
pub ffi_error_code: TestFFIErrorCode,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of OpenSyscallHandlerResult"]
[::std::mem::size_of::<OpenSyscallHandlerResult>() - 16usize];
["Alignment of OpenSyscallHandlerResult"]
[::std::mem::align_of::<OpenSyscallHandlerResult>() - 8usize];
["Offset of field: OpenSyscallHandlerResult::syscall_handler"][::std::mem::offset_of!(
OpenSyscallHandlerResult,
syscall_handler
) - 0usize];
["Offset of field: OpenSyscallHandlerResult::ffi_error_code"][::std::mem::offset_of!(
OpenSyscallHandlerResult,
ffi_error_code
) - 8usize];
};
unsafe extern "C" {
pub fn open_syscall_handler(
db: *mut ::std::os::raw::c_void,
rc: *mut ::std::os::raw::c_void,
signed_tx: FFISerializedSignedTransaction,
) -> OpenSyscallHandlerResult;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct FFISerializedAuthClaimData {
pub data: *const u8,
pub len: u32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of FFISerializedAuthClaimData"]
[::std::mem::size_of::<FFISerializedAuthClaimData>() - 16usize];
["Alignment of FFISerializedAuthClaimData"]
[::std::mem::align_of::<FFISerializedAuthClaimData>() - 8usize];
["Offset of field: FFISerializedAuthClaimData::data"]
[::std::mem::offset_of!(FFISerializedAuthClaimData, data) - 0usize];
["Offset of field: FFISerializedAuthClaimData::len"]
[::std::mem::offset_of!(FFISerializedAuthClaimData, len) - 8usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct FFISerializedInvocation {
pub data: *const u8,
pub len: u32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of FFISerializedInvocation"]
[::std::mem::size_of::<FFISerializedInvocation>() - 16usize];
["Alignment of FFISerializedInvocation"]
[::std::mem::align_of::<FFISerializedInvocation>() - 8usize];
["Offset of field: FFISerializedInvocation::data"]
[::std::mem::offset_of!(FFISerializedInvocation, data) - 0usize];
["Offset of field: FFISerializedInvocation::len"]
[::std::mem::offset_of!(FFISerializedInvocation, len) - 8usize];
};
unsafe extern "C" {
pub fn open_mocked_syscall_handler(
db: *mut ::std::os::raw::c_void,
rc: *mut ::std::os::raw::c_void,
auth_claim_data: FFISerializedAuthClaimData,
source_tx_hash: *const u8,
enable_tracing: u8,
) -> OpenSyscallHandlerResult;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OpenMockInvocationFrameResult {
pub syscall_error_code: i32,
pub ffi_error_code: TestFFIErrorCode,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of OpenMockInvocationFrameResult"]
[::std::mem::size_of::<OpenMockInvocationFrameResult>() - 8usize];
["Alignment of OpenMockInvocationFrameResult"]
[::std::mem::align_of::<OpenMockInvocationFrameResult>() - 4usize];
["Offset of field: OpenMockInvocationFrameResult::syscall_error_code"][::std::mem::offset_of!(
OpenMockInvocationFrameResult,
syscall_error_code
)
- 0usize];
["Offset of field: OpenMockInvocationFrameResult::ffi_error_code"][::std::mem::offset_of!(
OpenMockInvocationFrameResult,
ffi_error_code
)
- 4usize];
};
unsafe extern "C" {
pub fn open_mock_invocation_frame(
syscall_handler: *mut ::std::os::raw::c_void,
invocation: FFISerializedInvocation,
invoke_flags: u32,
) -> OpenMockInvocationFrameResult;
}
unsafe extern "C" {
pub fn finish_mock_invocation_frame(
syscall_handler: *mut ::std::os::raw::c_void,
invoke_error_code: i32,
) -> ForeignTracedInvokeResult;
}
unsafe extern "C" {
pub fn push_context(
syscall_handler: *mut ::std::os::raw::c_void,
) -> TestFFIErrorCode;
}
unsafe extern "C" {
pub fn pop_context() -> TestFFIErrorCode;
}
unsafe extern "C" {
pub fn close_syscall_handler(
syscall_handler: *mut ::std::os::raw::c_void,
) -> TestFFIErrorCode;
}
unsafe extern "C" {
pub fn mock_syscall_entrypoint(
syscall: i32,
arg1: u64,
arg2: u64,
arg3: u64,
arg4: u64,
arg5: u64,
arg6: u64,
arg7: u64,
) -> ForeignHostFnResult;
}
unsafe extern "C" {
pub fn root_invoke(
syscall_handler: *mut ::std::os::raw::c_void,
enable_tracing: u8,
) -> ForeignTracedInvokeResult;
}
unsafe extern "C" {
pub fn try_commit_transaction(
syscall_handler: *mut ::std::os::raw::c_void,
) -> ForeignTryCommitResult;
}
unsafe extern "C" {
pub fn get_rv32_stack_usage(
syscall_handler: *mut ::std::os::raw::c_void,
) -> GetRv32StackUsageResult;
}
unsafe extern "C" {
pub fn abort_transaction(
syscall_handler: *mut ::std::os::raw::c_void,
) -> TestFFIErrorCode;
}
unsafe extern "C" {
pub fn enable_syscall_logging(level: i32);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct FFISourceAuthData {
pub data: *const u8,
pub len: u32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of FFISourceAuthData"]
[::std::mem::size_of::<FFISourceAuthData>() - 16usize];
["Alignment of FFISourceAuthData"]
[::std::mem::align_of::<FFISourceAuthData>() - 8usize];
["Offset of field: FFISourceAuthData::data"]
[::std::mem::offset_of!(FFISourceAuthData, data) - 0usize];
["Offset of field: FFISourceAuthData::len"]
[::std::mem::offset_of!(FFISourceAuthData, len) - 8usize];
};
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VerifyAuthResult {
pub auth_error_code: i32,
pub ffi_error_code: TestFFIErrorCode,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of VerifyAuthResult"]
[::std::mem::size_of::<VerifyAuthResult>() - 8usize];
["Alignment of VerifyAuthResult"]
[::std::mem::align_of::<VerifyAuthResult>() - 4usize];
["Offset of field: VerifyAuthResult::auth_error_code"]
[::std::mem::offset_of!(VerifyAuthResult, auth_error_code) - 0usize];
["Offset of field: VerifyAuthResult::ffi_error_code"]
[::std::mem::offset_of!(VerifyAuthResult, ffi_error_code) - 4usize];
};
unsafe extern "C" {
pub fn verify_signed_transaction_auth(
signed_tx: FFISerializedSignedTransaction,
source_auth_data: FFISourceAuthData,
serialized_network_hash: *const u8,
) -> VerifyAuthResult;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VerifyAuthResultFromDBResult {
pub auth_error_code: i32,
pub ffi_error_code: TestFFIErrorCode,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of VerifyAuthResultFromDBResult"]
[::std::mem::size_of::<VerifyAuthResultFromDBResult>() - 8usize];
["Alignment of VerifyAuthResultFromDBResult"]
[::std::mem::align_of::<VerifyAuthResultFromDBResult>() - 4usize];
["Offset of field: VerifyAuthResultFromDBResult::auth_error_code"][::std::mem::offset_of!(
VerifyAuthResultFromDBResult,
auth_error_code
)
- 0usize];
["Offset of field: VerifyAuthResultFromDBResult::ffi_error_code"][::std::mem::offset_of!(
VerifyAuthResultFromDBResult,
ffi_error_code
)
- 4usize];
};
unsafe extern "C" {
pub fn verify_signed_transaction_auth_from_db(
db: *mut ::std::os::raw::c_void,
signed_tx: FFISerializedSignedTransaction,
) -> VerifyAuthResultFromDBResult;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VerifyContractResult {
pub success: u8,
pub ffi_error_code: TestFFIErrorCode,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of VerifyContractResult"]
[::std::mem::size_of::<VerifyContractResult>() - 8usize];
["Alignment of VerifyContractResult"]
[::std::mem::align_of::<VerifyContractResult>() - 4usize];
["Offset of field: VerifyContractResult::success"]
[::std::mem::offset_of!(VerifyContractResult, success) - 0usize];
["Offset of field: VerifyContractResult::ffi_error_code"]
[::std::mem::offset_of!(VerifyContractResult, ffi_error_code) - 4usize];
};
unsafe extern "C" {
pub fn do_verify_contract(
context: *mut ::std::os::raw::c_void,
contract_bytes: *const u8,
contract_len: u32,
) -> VerifyContractResult;
}