feat(client): add delegation bundle(s) to client.pool
This commit is contained in:
committed by
Michael Muré
parent
4aedc4de39
commit
06f478b9c3
@@ -3,6 +3,7 @@ package client
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"iter"
|
||||||
|
|
||||||
"github.com/ipfs/go-cid"
|
"github.com/ipfs/go-cid"
|
||||||
"github.com/libp2p/go-libp2p/core/crypto"
|
"github.com/libp2p/go-libp2p/core/crypto"
|
||||||
@@ -35,6 +36,16 @@ func NewClient(privKey crypto.PrivKey, requester DelegationRequester) (*Client,
|
|||||||
}, nil
|
}, 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.
|
// 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) {
|
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)
|
proof, err := c.findProof(ctx, cmd, subject)
|
||||||
|
|||||||
Reference in New Issue
Block a user