From 36bb9db05b7d722fc1a905eabda5e66a024a4f9b Mon Sep 17 00:00:00 2001 From: outprog Date: Thu, 24 Oct 2024 10:32:47 +0800 Subject: [PATCH] Adjust the Address, SignType and Owner of the bundler to the public method --- bundler.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/bundler.go b/bundler.go index 0daae5e..ee802d8 100644 --- a/bundler.go +++ b/bundler.go @@ -10,10 +10,10 @@ import ( ) type Bundler struct { - signType int - signer interface{} - owner string // only rsa has owner - signerAddr string + SignType int + signer interface{} + Owner string // only rsa has owner + Address string } func NewBundler(signer interface{}) (*Bundler, error) { @@ -22,10 +22,10 @@ func NewBundler(signer interface{}) (*Bundler, error) { return nil, err } return &Bundler{ - signType: signType, - signer: signer, - owner: owner, - signerAddr: signerAddr, + SignType: signType, + signer: signer, + Owner: owner, + Address: signerAddr, }, nil } @@ -35,7 +35,7 @@ func (b *Bundler) Sign(item *schema.BundleItem) error { return err } var sigData []byte - switch b.signType { + switch b.SignType { case schema.ArweaveSignType: arSigner, ok := b.signer.(*Signer) if !ok { @@ -66,7 +66,7 @@ func (b *Bundler) Sign(item *schema.BundleItem) error { } func (b *Bundler) CreateAndSignItem(data []byte, target string, anchor string, tags []schema.Tag) (bItem schema.BundleItem, err error) { - item, err := utils.NewBundleItem(b.owner, b.signType, target, anchor, data, tags) + item, err := utils.NewBundleItem(b.Owner, b.SignType, target, anchor, data, tags) if err != nil { return }