Light client friendly events (#2491)

* Sketch of indexed events.

* Get EventIndex by holding another variable.

* Add some docs.

* Use DoubleMap to store reverse topic index

* Implement StorageDoubleMap::append

* Use append for EventTopics.

* Refactor.

* Avoid `mutate`

* Docs.

* Add topics to EventRecord

* Update tests.

* Rebuild.

* Bump version.

* Event topics test.

* Mix in BlockNumber to distinguish updates

* Fix srml-system test.

* Post merge fixes.

* Comments/TODO.
This commit is contained in:
Sergei Pepyakin
2019-05-13 20:56:01 +02:00
committed by Gavin Wood
parent d974189e3c
commit 21773b3a07
8 changed files with 325 additions and 56 deletions
+2
View File
@@ -47,6 +47,7 @@ fn authorities_change_logged() {
EventRecord {
phase: Phase::Finalization,
event: RawEvent::NewAuthorities(vec![(4, 1), (5, 1), (6, 1)]).into(),
topics: vec![],
},
]);
});
@@ -77,6 +78,7 @@ fn authorities_change_logged_after_delay() {
EventRecord {
phase: Phase::Finalization,
event: RawEvent::NewAuthorities(vec![(4, 1), (5, 1), (6, 1)]).into(),
topics: vec![],
},
]);
});