Hot answers tagged

11

There are several test frameworks coming for Tezos. Ours (Techelson) can be used both from Michelson and from Liquidity. It should be released soon. (I will update this answer when it is released)


6

Ad 1. I am not sure whether it is what you look for, but look at: https://smartpy.io/demo/ SmartPy offers different tools: Analytics: elements of the UI in SmartPy.io to analyse smart contracts and their properties; SmartML: a virtual machine written in OCaml; Compiler: used to translate contracts from SmartML to Michelson; Python library: facilitates the ...


6

You can run all the tests with: dune build @runtest if you want particular tests you need to find their "alias name" dune build @runtest_voting.sh is one of them (That I found with git grep runtest_vot :), the file .gitlab-ci.yml has many examples also).


4

One can go in the src/proto_alpha/lib_protocol/test and run dune runtest, which will execute all unit tests for the protocol alpha, including the ones for voting (those in voting.ml). Another test is present in src/bin_client/test/test_voting.sh which tests the client commands related to voting. All these tests are executed when one runs make test.


4

Tezos environment manager has a contract testing framework planned on the roadmap, you can check the current status at this git repo.


4

This is not something you will be able to achieve with Taquito (at least not for now, that will change in the future) and you have to use an indexer API. I recommend Better Call Dev API, you can easily get the number of keys with a fetch call to api.better-call.dev/v1/bigmap/${network}/${big_map_id}/keys (the big map ID should be available in Taquito by ...


4

Here is the preview version of truffle tools for working with smart contacts in Tezos: https://www.trufflesuite.com:8443/docs/tezos/truffle/quickstart


3

You could use Flextesa In a docker-compose file, it should look like the following: version: '3.6' services: sandbox: image: tqtezos/flextesa:20210316 command: edobox start -P 8732 container_name: sandbox environment: block_time: 1 TEZOS_CLIENT_UNSAFE_DISABLE_DISCLAIMER: Y ports: - "8732:8732" It will bake ...


3

Use now = sp.timestamp(10). We used to allow now = 10 but this is not well typed. (also, obviously, the exception message should be better)


2

The best documentation available for this is: http://tezos.gitlab.io/developer/proposal_testing.html http://tezos.gitlab.io/developer/entering_alpha.html https://gitlab.com/romain.nl/howtos/-/blob/master/HOWTO-launch-a-test-network.md To summarize, you'll want to: patch src/proto_alpha use scripts/snapshot_alpha_and_link.sh to copy the protocol into a new ...


2

As far as I know, you cannot check if the entrypoint returns the balance with JavaScript, because the entrypoint doesn't return a value but emits a transaction. I didn't try it for a FA2 token contract but to test a FA1.2 token contract with Truffle, I wrote a simple contract that would call the FA1.2 balance_of entrypoint and receive the balance on a ...


2

I haven't found a solution myself using what is provided by Truffle to do what you want, so here is what I do. I guess you must be using Taquito. In this case, you can use this function to change the signer whenever you need: const signerFactory = async pk => { await Tezos.setProvider({ signer: new InMemorySigner(pk) }); return Tezos; }; However, ...


2

During the 48h cycle with the fork chain. The test chain now lasts as long as the third phase of the amendment process, so approximately 3 weeks. They are simply processing the same transactions that mainchain are producing using the new protocol looking for bugs? There is no particular reason to replay on the test chain the transaction that happen at the ...


1

The error means that a nonce commitment should have been included in the block, but it was not (or the other way around, it was included, but it was not expected to be included). See here for details: http://tezos.gitlab.io/whitedoc/proof_of_stake.html#random-seed. In sandbox mode, a nonce commitment should be included every 4 blocks, as far as I understand. ...


1

You can test against the data that the official Tezos project uses for regression testing. This file might be of interest: https://gitlab.com/tezos/tezos/-/blob/master/tezt/_regressions/protocol.alpha.operation.internal.out


1

The testnet chain is only to validate the ability for the amendment to occur without any initial adverse effects to the network. These protocols should also run in parallel on a dedicated test chain as well, but it's up to the community/proposers to ensure this is setup and well tested. Testnets should probably run from before the amendments are even ...


1

The code uses IPv6, which must be enabled on the host, and was not in my case.


1

Make sure you are on most recent code checkout hash: $ git log -1 should give you the hash: 0639894412 (Feb 11 2020) I just did a complete rebuild of the source and I do not have tezos-p2p in the path you specified. This, $ find ./ -iname tezos-p2p, returns no results in the entire code tree. Additionally, looking at the build file (dune file) it says ...


1

You could use Tezster-CLI for setting up local environment and use Tezster-Bundle to develop,deploy and test your contracts. Tezster-CLI: https://github.com/Tezsure/Tezster-CLI Tezster-Bundle: https://github.com/Tezsure/Bundle-react


Only top voted, non community-wiki answers of a minimum length are eligible