I'm building a transpiler and need to understand the protobuf/go scope lookup system. I've been trying to google the docs and finding no luck.
Q: Is there a shared package scope lookup that you can do when importing Types in Go/protobufs?
Here is the example that I'm questioning:
proto1:
package cosmos.crypto.keyring.v1;
...
message Ledger {
hd.v1.BIP44Params path = 1;
}
proto2:
package cosmos.crypto.hd.v1;
message BIP44Params {
...
}
There are two syntaxes I've seen that do make sense so far:
full scope
message Ledger {
cosmos.crypto.hd.v1.BIP44Params path = 1;
}
Or I’ve also seen versions like this
completely unscoped
message Ledger {
BIP44Params path = 1;
}
partially scoped?
But the style I'm seeing is partially scoped
message Ledger {
hd.v1.BIP44Params path = 1;
}
Is the reason they leave off the cosmos.crypto because these two packages share cosmos.crypto in the root of their package name?
Or is it a more generic scope lookup based on the import?
Any insight or reading links appreciated :)