1

For example, calling an entrypoint to change a smart contract's storage. When can I be maximally certain the change is now part of the blockchain? Will it suffice if I grab the contract's storage with Taquito and see my change there?

A link to official docs to support your answer would be desirable.

2 Answers 2

4

The change to a smart contract is definitely part of the blockchain when one block has been added on top of the contract call. See https://tezos.gitlab.io/active/consensus.html#transaction-and-block-finality for the details.

2

I assume you're asking on how to check whether the op has now been injected or not in Taquito, since that's what you tagged it with.

In Taquito, when you call a certain contract entrypoint, like so:

const op = await contract.methods.default().send();

You should then do what's called a 'confirmation':

await op.confirmation();

That method basically confirms that your operation now has been injected properly.

If you want the results of your operation, you can also see them by outputting the operation results:

console.log(await op.operationResults());

For more examples, you can definitely check out some that we wrote here: https://github.com/ecadlabs/taquito/tree/master/example

2
  • op.confirmation() accepts an optional numeric argument. Your answer implies it is obsolete, such as for obsolete tezos protocols. (This topic is confusing because there's a lot of obsolete info on the internet about this.) Feb 10, 2023 at 22:28
  • 1
    Davis' answer implies it is optional, not obsolete. Building on Raphaël's answer, you should use await op.confirmation(2); to be 100% sure the change has been included in the Tezos blockchain, Taquito will wait for 2 blocks before returning the confirmation. Feb 12, 2023 at 8:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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