use super::{
BlockchainWrapper, CallValueWrapper, CryptoWrapper, ErrorHelper, ManagedSerializer,
SendRawWrapper, SendWrapper, StorageRawWrapper,
};
use crate::{
api::VMApi,
types::{Tx, TxBaseWithEnv, TxScEnv},
};
pub trait ContractBase: Sized {
type Api: VMApi;
fn call_value(&self) -> CallValueWrapper<Self::Api> {
CallValueWrapper::new()
}
#[inline]
fn send(&self) -> SendWrapper<Self::Api> {
SendWrapper::new()
}
#[inline]
fn tx(&self) -> TxBaseWithEnv<TxScEnv<Self::Api>> {
Tx::new_tx_from_sc()
}
#[inline]
fn send_raw(&self) -> SendRawWrapper<Self::Api> {
SendRawWrapper::new()
}
#[inline]
fn blockchain(&self) -> BlockchainWrapper<Self::Api> {
BlockchainWrapper::<Self::Api>::new()
}
#[inline]
fn crypto(&self) -> CryptoWrapper<Self::Api> {
CryptoWrapper::new()
}
#[inline]
fn serializer(&self) -> ManagedSerializer<Self::Api> {
ManagedSerializer::new()
}
#[inline]
fn error(&self) -> ErrorHelper<Self::Api> {
ErrorHelper::new()
}
#[inline]
fn storage_raw(&self) -> StorageRawWrapper<Self::Api> {
StorageRawWrapper::new()
}
}