chore: clean up ambient (#136)
* fix: remove unnecessary tx field in ProtocolComponent * chore: move ambient protobuf files to ambient module * chore: remove dependency on common message types This allows us to isolate the ambient specific messages within the ambient module * feat: update ambient substream with new message structs * chore: update substream configs And remove use of deprecated BlockContractChanges. * feat: implement From for AmbientProtocolComponent to ProtocolComponent
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
use substreams::store::{StoreNew, StoreSet, StoreSetProto};
|
||||
use tycho_substreams::models::{BlockPoolChanges, ProtocolComponent};
|
||||
use tycho_substreams::models::ProtocolComponent;
|
||||
|
||||
use crate::pb::tycho::ambient::v1::BlockPoolChanges;
|
||||
|
||||
#[substreams::handlers::store]
|
||||
pub fn store_pools(changes: BlockPoolChanges, component_store: StoreSetProto<ProtocolComponent>) {
|
||||
for component in changes.protocol_components {
|
||||
component_store.set(0, component.id.clone(), &component);
|
||||
for component in changes.new_components {
|
||||
let protocol_component: ProtocolComponent = component.into();
|
||||
component_store.set(0, protocol_component.id.clone(), &protocol_component);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user