public static T LoadFieldFromStorage <T>(StorageContext storage, NativeContractKind kind, string fieldName) { var contractName = kind.GetContractName(); var key = GetKeyForField(contractName, fieldName, true); if (storage.Has(key)) { return(storage.Get <T>(key)); } return(default(T)); }
public static IContract GetContract(this IRuntime runtime, NativeContractKind nativeContract) { return(runtime.GetContract(nativeContract.GetContractName())); }
public static VMObject CallNativeContext(this IRuntime runtime, NativeContractKind nativeContract, string methodName, params object[] args) { return(runtime.CallContext(nativeContract.GetContractName(), 0, methodName, args)); }
public static byte[] GetKeyForField(NativeContractKind nativeContract, string fieldName, bool isProtected) { return(GetKeyForField(nativeContract.GetContractName(), fieldName, isProtected)); }
public static Address GetAddressForNative(NativeContractKind kind) { return(GetAddressForName(kind.GetContractName())); }
public VMObject InvokeContract(StorageContext storage, NativeContractKind nativeContract, string methodName, params object[] args) { return(InvokeContract(storage, nativeContract.GetContractName(), methodName, args)); }