chore: upgrade ucantone validator#26
Merged
alanshaw merged 8 commits intoMay 19, 2026
Merged
Conversation
alanshaw
commented
May 19, 2026
|
|
||
| s := retrieval.NewServer(service) | ||
| s.Handle(contentRetrieveCapability, func(req execution.Request, res execution.Response) error { | ||
| s.Handle(ucan.Command(contentRetrieve), func(req execution.Request, res execution.Response) error { |
Member
Author
There was a problem hiding this comment.
@Peeja This kinda sucks, bindcom.Command is a command.Command but you can't use it here without type asserting...
Notably you also don't get to call methods defined on command.Command.
A couple of options:
Define as a struct instead:
type Command[A] struct {
command.Command
}You get to call the command.Command methods directly but you'd still have to access .Command to pass it to server.Handler(...).
Define a Command() method:
func (c Command[A]) Command() command.Command {
return command.Command(c)
}Doesn't really get us anything other than it being slightly less verbose than type asserting...you can at least still use it in a map.
IDK, any ideas? Can also just leave it as is.
Member
There was a problem hiding this comment.
+1 to:
type Command[A] struct {
command.Command
}
Member
Author
There was a problem hiding this comment.
PRs for those proposals:
frrist
approved these changes
May 19, 2026
This was referenced May 19, 2026
alanshaw
added a commit
to fil-forge/ucantone
that referenced
this pull request
May 19, 2026
re: fil-forge/libforge#26 (comment) Instead of: ```go // content/retrieve.go Retrieve := bindcom.Parse[*RetrieveArgs]("/content/retrieve") // server.go s := retrieval.NewServer(service) s.Handle(ucan.Command(content.Retrieve), /* ... */) ``` You can do: ```go s.Handle(content.Retrieve.Command, /* ... */) ``` Alternative to #15
alanshaw
added a commit
to fil-forge/go-ipni-tools
that referenced
this pull request
May 19, 2026
fallout from fil-forge/libforge#26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Renames
capabilitiestocommandsand renamescapabilities.MustNew(...)tocapabilities.MustParse(...).depends on fil-forge/ucantone#14