-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: separate db from home and consolidate home_db and syncing #878
Conversation
@@ -1,7 +1,7 @@ | |||
//! Interfaces to the ethereum contracts | |||
|
|||
#![forbid(unsafe_code)] | |||
#![warn(missing_docs)] | |||
// #![warn(missing_docs)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Struggling to silence the abigen!
warnings ugh
abigen!( | ||
EthereumHomeInternal, | ||
"./chains/optics-ethereum/abis/Home.abi.json" | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting these bizarre errors only when running cargo test
(why PR is failing CI). cargo build
works fine. @prestwich how to fix these weird abigen
path errors?
Doc-tests optics-ethereum
error: failed to get ABI JSON
Caused by:
0: failed to read artifact JSON file with path /Users/luketchang/Desktop/optics/optics-monorepo/rust/chains/optics-ethereum/chains/optics-ethereum/abis/Home.abi.json
1: No such file or directory (os error 2)
--> /Users/luketchang/Desktop/optics/optics-monorepo/rust/chains/optics-ethereum/src/home_indexer.rs:16:5
|
16 | "./chains/optics-ethereum/abis/Home.abi.json"
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: failed to get ABI JSON
Caused by:
0: failed to read artifact JSON file with path /Users/luketchang/Desktop/optics/optics-monorepo/rust/chains/optics-ethereum/chains/optics-ethereum/abis/Home.abi.json
1: No such file or directory (os error 2)
--> /Users/luketchang/Desktop/optics/optics-monorepo/rust/chains/optics-ethereum/src/settings.rs:17:5
|
17 | "./chains/optics-ethereum/abis/Home.abi.json"
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0432]: unresolved import `crate::EthereumHomeIndexer`
--> /Users/luketchang/Desktop/optics/optics-monorepo/rust/chains/optics-ethereum/src/settings.rs:12:5
|
12 | use crate::EthereumHomeIndexer;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ no `EthereumHomeIndexer` in the root
error[E0412]: cannot find type `EthereumHomeInternal` in this scope
--> /Users/luketchang/Desktop/optics/optics-monorepo/rust/chains/optics-ethereum/src/home_indexer.rs:25:19
|
25 | contract: Arc<EthereumHomeInternal<M>>,
| ^^^^^^^^^^^^^^^^^^^^ not found in this scope
|
help: consider importing one of these items
|
1 | use optics_ethereum::EthereumHomeInternal;
|
1 | use optics_ethereum::settings::EthereumHomeInternal;
|
error: aborting due to 4 previous errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i believe we are falling prey to rust-lang/cargo#9427 here
…g dependencies on old Ethereum home indexer
908c598
to
4e008ce
Compare
Closing in favor of #902 |
Separates home-indexing and db-syncing logic from the concept of a
home
contract (home interface).HomeIndexer
trait inoptics-core
, who's sole responsibility is to retrieve updates and messages from home contract eventsSyncingHomeDB
inoptics-base
, which contains aHomeIndexer
and aHomeDB
and keeps the agent'sHomeDB
up to date by indexing home contract events and updating the dbSyncingHomeDB
and will start the indexing task onrun
HomeDB
instead of accessing theirHomeDB
through thehome
objectCloses #870