Skip to content

Instantly share code, notes, and snippets.

@ItayPodhajcer
Last active January 16, 2020 08:40
Show Gist options
  • Save ItayPodhajcer/36b5eeb5f0add6c71cfb4da94a36e90d to your computer and use it in GitHub Desktop.
Save ItayPodhajcer/36b5eeb5f0add6c71cfb4da94a36e90d to your computer and use it in GitHub Desktop.
ethereum-event-azure-function-trigger/EthereumEventTriggerBinding
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