-
Notifications
You must be signed in to change notification settings - Fork 39
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
Add network config endpoint #2016
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -283,6 +283,14 @@ func (w *Services) GetTenNodeHealthStatus() (bool, error) { | |
return *res, err | ||
} | ||
|
||
func (w *Services) GetTenNetworkConfig() (tencommon.TenNetworkInfo, error) { | ||
res, err := withPlainRPCConnection[tencommon.TenNetworkInfo](context.Background(), w, func(client *gethrpc.Client) (*tencommon.TenNetworkInfo, error) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this do any caching by default? Maybe safer not to cache for now I guess, there are some edge cases when network starts up before L2 contract deployment maybe. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, it doesn't do any caching. I was thinking about it, but it's not an expensive call to the node and we can add it later if needed. |
||
res, err := obsclient.NewObsClient(client).GetConfig() | ||
return res, err | ||
}) | ||
return *res, err | ||
} | ||
|
||
func (w *Services) GenerateUserMessageToSign(encryptionToken []byte, formatsSlice []string) (string, error) { | ||
// Check if the formats are valid | ||
for _, format := range formatsSlice { | ||
|
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.
Bit of a shame that we can't use
ObscuroNetworkInfo
like the ObsClient but I guess it's for json compatibility? Maybe better to have separate control over it anyway.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.
Yeah, it is because of that + we need to convert data fields to strings. I was also asking ChatGPT if there is a good way, but unfortunately nothing simpler than that :/