internal override void InternalInitialize(ISmartContractBridgeContext bridgeContext) { if (Context != null) { throw new InvalidOperationException(); } Context = new CSharpSmartContractContext(bridgeContext); State.Context = Context; }
public void InternalInitialize(ISmartContractBridgeContext context) { _methodInternalInitialize(context); }
internal abstract void InternalInitialize(ISmartContractBridgeContext bridgeContext);
public void InternalInitialize(ISmartContractBridgeContext context) { _methodInfos[nameof(InternalInitialize)].Invoke(_instance, new object[] { context }); }
public static void SendVirtualInline(this ISmartContractBridgeContext context, Hash fromVirtualAddress, Address toAddress, string methodName, IMessage message) { context.SendVirtualInline(fromVirtualAddress, toAddress, methodName, ConvertToByteString(message)); }
public CSharpSmartContractContext(ISmartContractBridgeContext smartContractBridgeContextImplementation) { _smartContractBridgeContextImplementation = smartContractBridgeContextImplementation; }
/// <summary> /// Converts a virtual address to a contract address with the currently running contract address. /// </summary> /// <param name="this">An instance of <see cref="ISmartContractBridgeContext"/>.</param> /// <param name="virtualAddress">The virtual address that want to convert.</param> /// <returns></returns> public static Address ConvertVirtualAddressToContractAddressWithContractHashName( this ISmartContractBridgeContext @this, Hash virtualAddress) { return(@this.ConvertVirtualAddressToContractAddressWithContractHashName(virtualAddress, @this.Self)); }
public static T Call <T>(this ISmartContractBridgeContext context, Address address, string methodName, IMessage message) where T : IMessage <T>, new() { return(context.Call <T>(address, methodName, ConvertToByteString(message))); }
/// <summary> /// Generate a hash type id based on the address and the bytes. /// </summary> /// <param name="this">An instance of <see cref="ISmartContractBridgeContext"/>.</param> /// <param name="address">The address on which the id generation is based.</param> /// <param name="token">The hash type token on which the id generation is based.</param> /// <returns>The generated hash type id.</returns> public static Hash GenerateId(this ISmartContractBridgeContext @this, Address address, Hash token) { return(@this.GenerateId(address, token)); }
/// <summary> /// Generate a hash type id based on the currently running contract address. /// </summary> /// <param name="this">An instance of <see cref="ISmartContractBridgeContext"/>.</param> /// <returns>The generated hash type id.</returns> public static Hash GenerateId(this ISmartContractBridgeContext @this) { return(@this.GenerateId(@this.Self, null)); }
/// <summary> /// Generate a hash type id based on the currently running contract address and the hash type token. /// </summary> /// <param name="this">An instance of <see cref="ISmartContractBridgeContext"/>.</param> /// <param name="token">The hash type token on which the id generation is based.</param> /// <returns>The generated hash type id.</returns> public static Hash GenerateId(this ISmartContractBridgeContext @this, Hash token) { return(@this.GenerateId(@this.Self, token.Value)); }
/// <summary> /// Generate a hash type id based on the currently running contract address and the token. /// </summary> /// <param name="this">An instance of <see cref="ISmartContractBridgeContext"/>.</param> /// <param name="token">The token on which the id generation is based.</param> /// <returns>The generated hash type id.</returns> public static Hash GenerateId(this ISmartContractBridgeContext @this, string token) { return(@this.GenerateId(@this.Self, token.GetBytes())); }
/// <summary> /// Generate a hash type id based on the currently running contract address and the bytes. /// </summary> /// <param name="this">An instance of <see cref="ISmartContractBridgeContext"/>.</param> /// <param name="bytes">The bytes on which the id generation is based.</param> /// <returns>The generated hash type id.</returns> public static Hash GenerateId(this ISmartContractBridgeContext @this, IEnumerable <byte> bytes) { return(@this.GenerateId(@this.Self, bytes)); }