Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
LocalIssuance.cs
1using System.Collections.Generic;
2using System.Threading.Tasks;
3using Waher.Events;
6
8{
13 {
19 : base(Uri)
20 {
21 }
22
27 protected override async Task<bool> DoPrepare()
28 {
29 if (!this.Uri.EDaler.Legal.Verify(this.Uri.PreSign, this.Uri.Signature) &&
30 (!string.IsNullOrEmpty(IoTGateway.Gateway.Domain) ||
31 ((this.Uri.EDaler.Server.Domain != "example.com") &&
32 (this.Uri.EDaler.Server.Domain != "example2.com") &&
33 (this.Uri.EDaler.Server.Domain != "example3.com"))))
34 {
35 this.Uri.State.Error(EDalerUriErrorType.BadRequest, "Invalid signature.", false);
36 return false;
37 }
38
39 // TODO: Check authorized to create eDaler.
40
41 return await base.DoPrepare();
42 }
43
50 protected override void LogEvent(string To, string From, decimal Amount, string Currency,
51 KeyValuePair<string, object>[] Tags)
52 {
53 Log.Notice(Amount.ToString() + " " + Currency + " eDaler created.", To, From,
54 "eDalerCreated", EventLevel.Major, Tags);
55 }
56
57 }
58}
Static class managing the application event log. Applications and services log events on this static ...
Definition: Log.cs:13
static void Notice(string Message, string Object, string Actor, string EventId, EventLevel Level, string Facility, string Module, string StackTrace, params KeyValuePair< string, object >[] Tags)
Logs a notice event.
Definition: Log.cs:450
Abstract base class for primary transaction objects (i.e. objects that control the transaction).
override void LogEvent(string To, string From, decimal Amount, string Currency, KeyValuePair< string, object >[] Tags)
Logs an event corresponding to the transaction.
LocalIssuance(EDalerUri Uri)
Handles the local issuance of eDaler.
override async Task< bool > DoPrepare()
Performs actual preparation.
Abstract base class for eDaler URIs
Definition: EDalerUri.cs:20
EDalerUriState State
URI State object.
Definition: EDalerUri.cs:173
EDalerComponent EDaler
eDaler component reference
Definition: EDalerUri.cs:167
virtual void Error(EDalerUriErrorType ErrorType, string ErrorMessage, bool LogAsNotice)
Reports an error with the URI
EventLevel
Event level.
Definition: EventLevel.cs:7