コード例 #1
0
        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));
        }
コード例 #2
0
 public static IContract GetContract(this IRuntime runtime, NativeContractKind nativeContract)
 {
     return(runtime.GetContract(nativeContract.GetContractName()));
 }
コード例 #3
0
 public static VMObject CallNativeContext(this IRuntime runtime, NativeContractKind nativeContract, string methodName, params object[] args)
 {
     return(runtime.CallContext(nativeContract.GetContractName(), 0, methodName, args));
 }
コード例 #4
0
 public static byte[] GetKeyForField(NativeContractKind nativeContract, string fieldName, bool isProtected)
 {
     return(GetKeyForField(nativeContract.GetContractName(), fieldName, isProtected));
 }
コード例 #5
0
 public static Address GetAddressForNative(NativeContractKind kind)
 {
     return(GetAddressForName(kind.GetContractName()));
 }
コード例 #6
0
 public VMObject InvokeContract(StorageContext storage, NativeContractKind nativeContract, string methodName, params object[] args)
 {
     return(InvokeContract(storage, nativeContract.GetContractName(), methodName, args));
 }