-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwallet_bundle.go
More file actions
31 lines (24 loc) · 1.03 KB
/
wallet_bundle.go
File metadata and controls
31 lines (24 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package goar
import (
"context"
"os"
"github.com/permadao/goar/schema"
)
func (w *Wallet) SendBundleTxSpeedUp(ctx context.Context, concurrentNum int, bundleBinary interface{}, tags []schema.Tag, txSpeed int64) (schema.Transaction, error) {
bundleTags := []schema.Tag{
{Name: "Bundle-Format", Value: "binary"},
{Name: "Bundle-Version", Value: "2.0.0"},
}
if err := checkBundleTags(tags); err != nil {
return schema.Transaction{}, err
}
txTags := make([]schema.Tag, 0)
txTags = append(bundleTags, tags...)
return w.SendDataConcurrentSpeedUp(ctx, concurrentNum, bundleBinary, txTags, txSpeed)
}
func (w *Wallet) SendBundleTx(ctx context.Context, concurrentNum int, bundleBinary []byte, tags []schema.Tag) (schema.Transaction, error) {
return w.SendBundleTxSpeedUp(ctx, concurrentNum, bundleBinary, tags, 0)
}
func (w *Wallet) SendBundleTxStream(ctx context.Context, concurrentNum int, bundleReader *os.File, tags []schema.Tag) (schema.Transaction, error) {
return w.SendBundleTxSpeedUp(ctx, concurrentNum, bundleReader, tags, 0)
}