0

0

I want to use forgeOperation function provided by '@taquito/rpc' to make a transfer between two tz1 accounts. I can estimate gasLimit, storageLimit and suggestedFee using '@taquito/taquito' estimate method. But how can we get branch field in an operation shown below:

{
  "branch": "BMHBtAaUv59LipV1czwZ5iQkxEktPJDE7A9sYXPkPeRzbBasNY8",
  "contents": [
    { "kind": "transaction",
      "source": "tz1KqTpEZ7Yob7QbPE4Hy4Wo8fHG8LhKxZSx",
      "fee": "50000",
      "counter": "3",
      "gas_limit": "200",
      "storage_limit": "0",
      "amount": "100000000",
      "destination": "tz1gjaF81ZRRvdzjobyfVNsAeSC6PScjfQwN"
   } ]
}

Is it the hash of the current block we get by calling getBlock() function from '@taquito/rpc'? If it is, then in between the time of forging and injecting an operation if some other block got published, does this operation fail? Thanks in advance.

1 Answer 1

0

Is it the hash of the current block we get by calling getBlock()

Yes

if some other block got published, does this operation fail

Not sure, but I think no, because it's still on the same branch (old block points to next block), just a block older. You can inject a txn now with branch X, goes to mempool, doesn't get added to current block, but will get added to next block. In that case, the branch doesn't match the same as current, but it does match current's previous.

3
  • ok, I am checking this assumption using code. I will edit this comment if my operation will fail or success with the code snippet I have used. Dec 2, 2021 at 6:01
  • the operation doesn't fail until time 60 blocks got published Dec 9, 2021 at 11:00
  • I think it should be 120 blocks, it was 60 blocks (one hour) before the min. block time/delay was reduced to 30s.
    – ping_
    Feb 17 at 20:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.