Last active
January 16, 2020 08:40
-
-
Save ItayPodhajcer/36b5eeb5f0add6c71cfb4da94a36e90d to your computer and use it in GitHub Desktop.
ethereum-event-azure-function-trigger/EthereumEventTriggerBinding
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal class EthereumEventTriggerBinding : ITriggerBinding | |
{ | |
private readonly EthereumEventTriggerAttribute _attribute; | |
public EthereumEventTriggerBinding(EthereumEventTriggerAttribute attribute) | |
{ | |
_attribute = attribute; | |
} | |
public Type TriggerValueType => typeof(EthereumEventData); | |
public IReadOnlyDictionary<string, Type> BindingDataContract => new Dictionary<string, Type>(); | |
public Task<ITriggerData> BindAsync(object value, ValueBindingContext context) | |
{ | |
return Task.FromResult<ITriggerData>(new TriggerData(null, new Dictionary<string, object>())); | |
} | |
public Task<IListener> CreateListenerAsync(ListenerFactoryContext context) | |
{ | |
return Task.FromResult<IListener>(new EthereumEventListener(context.Executor, _attribute)); | |
} | |
public ParameterDescriptor ToParameterDescriptor() | |
{ | |
return default; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment