-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Emit events for chain notifications (re-posted after revert) (#57)
* Speccing out overall module structure for events. * Attempt to fetch and parse blocks from Substrate. * Make interface testable and add first unit test. * Adding counter to subscribe test. * Moving event handlers into shared. * Move processor types to utils and add test. * Fix node types import. Add standalone event subscriber. * Wire up chain events to the database. * Subscription modal and menu UI for chain events. * Use association between Notification and ChainEvent. * Augment ChainEventType with metadata. * Update raw_name of ChainEventType to 'section.method'. * Update header event display format. * Add hacky redraw * Add polling if chain or server goes offline. * Always attempt default offline range algorithm. * Fix polling bugs, filter pruned blocks. * Add tentative migration. * Stubbing out filter system. * Initial implementation of filters. * Fix bugs to permit full stack notifications. * Fix processor unit test. * Add kinds for substrate event types. * Fix function call in header. * Remove balance formatter requiring chain from header. * Add CWEvent abstraction layer and affectedAddresses to event. * Fix affected address notification filter. * Add tentative URLs to some chain events. * Write poller unit tests. * Add events README and update types. * Increase test coverage. * Revert forgotten local change to package.json * Add new chain event types. * Add event handler server tests. * Add test-events command and remove db logging. * Switch CircleCI tests to API only. * Add exclude addresses to events. Remove author reliance in emitSubscription. * Add event testing to circleci config. * Add titler, remove modal, and update subscriptions page. * Update readme for titler and subscription page. * Add balance format, debug validator reward inconsistency. * Fix down migration. * Update for PR requests. * Add version to events. * Fix subscription page dropdown ordering. * Fix merge issues. * Fix dropdown sort for subscriptions, redux. * Move version from event_data to chain_event model. * Stub out new chain events. * Implement new events fully. * Fix unit tests and related bugs. * Add processor fail tests. * Update migration for new types. * Add stubs for enricher tests. * Move usage of chain version to type_parser and off db. * Add TreasuryRewardMinted event. * Add TreasuryRewardMintedV2 event. * Add full enricher tests. * Remove unused version from chain event creation. * Fix errors from Kusama chain upgrade. * Swap dispatch queue to new derive. * Add subscribe all button for chain events. * Fixes redirect on subscription page * Fixes for creation and tx fees * Fixes differences in client/server edgeware url setups * Adds flag for event logging * Add extrinsic to edgeware event logic + candidacy event. * Swap candidacy notification link to council page. * Add chain name to notification heading. * Add candidacy event to migration. Co-authored-by: Jake Naviasky <jake@commonwealth.im> Co-authored-by: Raymond Zhong <raykyri@gmail.com>
- Loading branch information
1 parent
bd13034
commit 6e71509
Showing
53 changed files
with
4,262 additions
and
51 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { IChainEventData } from 'events/interfaces'; | ||
import ChainEventType from './ChainEventType'; | ||
|
||
class ChainEvent { | ||
public readonly id: number; | ||
public readonly blockNumber: number; | ||
public readonly data: IChainEventData; | ||
public readonly type: ChainEventType; | ||
|
||
constructor(id, blockNumber, data, type) { | ||
this.id = id; | ||
this.blockNumber = blockNumber; | ||
this.data = data; | ||
this.type = type; | ||
} | ||
|
||
public static fromJSON(json) { | ||
return new ChainEvent( | ||
json.id, | ||
json.block_number, | ||
json.event_data, | ||
ChainEventType.fromJSON(json.ChainEventType), | ||
); | ||
} | ||
} | ||
|
||
export default ChainEvent; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { SubstrateEventKind } from 'shared/events/edgeware/types'; | ||
|
||
class ChainEventType { | ||
public readonly id: string; | ||
public readonly chain: string; | ||
public readonly eventName: SubstrateEventKind; | ||
|
||
constructor(id, chain, eventName) { | ||
this.id = id; | ||
this.chain = chain; | ||
this.eventName = eventName; | ||
} | ||
|
||
public static fromJSON(json) { | ||
return new ChainEventType(json.id, json.chain, json.event_name); | ||
} | ||
} | ||
|
||
export default ChainEventType; |
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
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
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
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
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
Oops, something went wrong.