Skip to content

codegen.rs does not allow for non-messari protos #134

@melotik

Description

@melotik

When building a substream project any non-messari protos being used get built in the target/pb/ folder as substreams.entity.v1.rs for example.

Then in the codegen it will build the src/pb.rs file to map the necessary proto definitions to a usable location in our /src folder, but the folder assumes that all target/pb/ files are messari. appended.

Should we be making this assumption?

In the example I am giving, it generates a broken src/pb.rs file that looks like this:

#[rustfmt::skip]
#[path = "../target/pb/messari.entity.v1.rs"]
pub(in crate::pb) mod entity_v1;

pub mod entity {
    pub mod v1 {
        pub use super::super::entity_v1::*;
    }
}

#[rustfmt::skip]
#[path = "../target/pb/messari.erc20.v1.rs"]
pub(in crate::pb) mod erc20_v1;

pub mod erc20 {
    pub mod v1 {
        pub use super::super::erc20_v1::*;
    }
}

Another note: abis are cleaned up during codegen, but proto files are not. Should we also clean the proto autogenerated files each time someone builds a substream?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions