From 06f478b9c3b05c903be91a0b53ea2a7e47487157 Mon Sep 17 00:00:00 2001 From: Steve Moyer Date: Tue, 18 Mar 2025 14:18:53 -0400 Subject: [PATCH] feat(client): add delegation bundle(s) to client.pool --- toolkit/client/client.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/toolkit/client/client.go b/toolkit/client/client.go index 346c9fe..470c12b 100644 --- a/toolkit/client/client.go +++ b/toolkit/client/client.go @@ -3,6 +3,7 @@ package client import ( "context" "fmt" + "iter" "github.com/ipfs/go-cid" "github.com/libp2p/go-libp2p/core/crypto" @@ -35,6 +36,16 @@ func NewClient(privKey crypto.PrivKey, requester DelegationRequester) (*Client, }, nil } +// AddBundle adds a delegation.Bundle to the client's pool. +func (c *Client) AddBundle(bundle *delegation.Bundle) { + c.pool.AddBundle(bundle) +} + +// AddBundles adds a sequence of delegation.Bundles to the client's pool. +func (c *Client) AddBundles(bundles iter.Seq[*delegation.Bundle]) { + c.pool.AddBundles(bundles) +} + // PrepareInvoke returns an invocation, bundled in a container.Writer with the necessary proofs. func (c *Client) PrepareInvoke(ctx context.Context, cmd command.Command, subject did.DID, opts ...invocation.Option) (container.Writer, error) { proof, err := c.findProof(ctx, cmd, subject)