Skip to content

Commit

Permalink
Fix: counter
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky committed Jan 19, 2022
1 parent b770ae3 commit c415862
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions internal/chain/tezos/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ func (t *Tezos) Initiate(ctx context.Context, args chain.InitiateArgs) error {

tx := node.Transaction{
Source: t.key.PubKey.GetAddress(),
Counter: fmt.Sprintf("%d", t.counter),
StorageLimit: operationParams.StorageLimit.Initiate,
GasLimit: operationParams.GasLimit.Initiate,
Fee: "1000",
Expand Down Expand Up @@ -351,7 +350,6 @@ func (t *Tezos) Redeem(ctx context.Context, hashedSecret, secret chain.Hex, cont
params := json.RawMessage(value)
opHash, err := t.sendTransaction(ctx, node.Transaction{
Source: t.key.PubKey.GetAddress(),
Counter: fmt.Sprintf("%d", t.counter),
Amount: "0",
StorageLimit: operationParams.StorageLimit.Redeem,
GasLimit: operationParams.GasLimit.Redeem,
Expand Down Expand Up @@ -393,7 +391,6 @@ func (t *Tezos) Refund(ctx context.Context, hashedSecret chain.Hex, contract str
params := json.RawMessage(value)
opHash, err := t.sendTransaction(ctx, node.Transaction{
Source: t.key.PubKey.GetAddress(),
Counter: fmt.Sprintf("%d", t.counter),
Amount: "0",
StorageLimit: operationParams.StorageLimit.Refund,
GasLimit: operationParams.GasLimit.Refund,
Expand Down Expand Up @@ -718,6 +715,7 @@ func (t *Tezos) parseTokensValueKeys(key api.BigMapKey, contract string) error {

func (t *Tezos) sendTransaction(ctx context.Context, transaction node.Transaction) (string, error) {
atomic.AddInt64(&t.counter, 1)
transaction.Counter = fmt.Sprintf("%d", t.counter)

headerCtx, headerCancel := context.WithTimeout(ctx, 10*time.Second)
defer headerCancel()
Expand Down

0 comments on commit c415862

Please sign in to comment.