Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. interface ITxMap {
  2. [index: string]: ITx; // Transaction Id
  3. }
  4.  
  5. interface ITx {
  6. txData: {
  7. from: string,
  8. to: string,
  9. };
  10. transaction: ITransaction;
  11. currentValidators: ICurrentValidators;
  12. previousValidators: IPreviousValidators;
  13. snapshotValidators: ISnapshotValidators;
  14. }
  15.  
  16. interface ITransaction {
  17. lifetime: EventTimestamp;
  18. generateSignature: EventTimestamp;
  19. writeToMyLedger: EventTimestamp;
  20. generateHash: EventTimestamp;
  21. }
  22.  
  23. interface ICurrentValidators {
  24. [index: string]: {
  25. validation: {
  26. lifetime: EventTimestamp,
  27. requestValidation: EventTimestamp,
  28. validateSignature: EventTimestamp, // VALIDATE_SIGNATURE
  29. validateLedger: EventTimestamp, // VALIDATE_LEDGER
  30. generateHash: EventTimestamp, // GENERATE_TRANSACTION_HASH
  31. writeToWitnessLedger: EventTimestamp, // WRITE_TO_LEDGER
  32. },
  33. connection: EventTimestamp, // CONNECT_TO_VALIDATOR
  34. };
  35. }
  36.  
  37. interface IPreviousValidators {
  38. [index: string]: { // Pod Address
  39. validation: {
  40. lifetime: EventTimestamp,
  41. getEntryFromLedger: EventTimestamp,
  42. };
  43. connection: {
  44. [index: string]: EventTimestamp,
  45. };
  46. };
  47. }
  48.  
  49. interface ISnapshotValidators {
  50. [index: string]: {
  51. validation: {
  52. generateSnapshot: EventTimestamp,
  53. };
  54. connection: {
  55. [index: string]: EventTimestamp,
  56. };
  57. };
  58. }
  59.  
  60. class EventTimestamp {
  61. public start: number;
  62. public end: number;
  63. public diff: number = 0;
  64.  
  65. constructor(start: number, end: number) {
  66. this.start = start;
  67. this.end = end;
  68. }
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement