Questions tagged [testing]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
31 views

Why does unpacking a record that has a key containing bounded data fail with `to_value sp.TBounded` in smartpy?

Tests are throwing a to_value error in the scenario when trying to unpack a record that contains a key with a bounded type TNat inside the entrypoint being called. There's a minimal reproduction below,...
user avatar
  • 347
3 votes
1 answer
40 views

Why can I not subtract 2 local variables of type nat from each other and assign that result to another local variable in a view in smartpy?

I am trying to do some maths operations inside an on-chain view and am getting an unexpected result. The reproduction contract tries to perform the following steps: Define an internal contract ...
user avatar
  • 347
2 votes
1 answer
17 views

Why does calling sp.address() with a dynamic value inside an entrypoint fail?

Is there some way to call sp.address inside an entrypoint and pass in a dynamic String? I have created an example contract showing the failing state: import smartpy as sp class ...
user avatar
  • 347
1 vote
1 answer
25 views

Receiving a "doesn't have a comparable type" error when returning a list from an on-chain view

When I return a list from an on-chain view am receiving a type error but am unsure where to set the type in order to fix it. Returning a string or integer from the view works fine. Is there a set ...
user avatar
  • 347
0 votes
2 answers
31 views

Taquito "estimate" fails with "storage_exhausted.operation"

I was getting the error storage_exhausted.operation before when trying to send an operation. I thought I fixed it by ensuring I had enough funds in my account to cover the storage fee. Code was ...
user avatar
2 votes
2 answers
43 views

Receiving an "OpenVariant" error when evaluating view result in another contract. How do you use the view response inside a smartpy contract?

I have a scenario that works in local smartpy tests, but once deployed to testnet the same call responds with an obscure "OpenVariant" error. There is a check that happens inside an ...
user avatar
  • 347
0 votes
1 answer
40 views

How do I setup and run a custom network for testing purposes?

I am working on a user level tutorial for ‘how to write and introduce a Tezos protocol’. I want to offer people a couple ways of testing it. One of those being running an isolated testnet and ...
user avatar
0 votes
1 answer
18 views

How do we unit test COMPONENTS THAT USE BeaconWallet and TezosToolkit-any best practice examples please?

Quality-centric = There are a few examples showing approaches for testing contract-related functionality in isolation-GREAT!! However, the same cannot be said if searching the web for mocking ...
user avatar
  • 11
0 votes
2 answers
69 views

Any Tezos RPC alternatives suggestions

The open tezos docs suggest using RPC URL: "https://florencenet.smartpy.io/". It does not work. What alternatives RPC URLs do you use. It seems that when you use the mainnet RPC URL - things ...
user avatar
  • 5
0 votes
1 answer
12 views

Online SmartPy IDE run error:

The error says: exports[f] is not a function. Not sure why when I try to run.... import smartpy as sp @sp.add_test(name = "First test") def test(): scenario = sp.test_scenario() ...
user avatar
  • 5
2 votes
1 answer
48 views

Is it possible to test for type exceptions in SmartPy?

How do you catch parameter type exceptions in SmartPy tests? There's an example of exception testing in: https://smartpy.io/docs/scenarios/testing An example from docs # Assert exception result ...
user avatar
0 votes
0 answers
13 views

Stress testing making consecutive calls on a contract's entry point

I want to test calling the same entry point on a smart contract repeatedly. I have a smart contract that might linearly increase the gas it consumes after each consecutive call in the entry point. Of ...
user avatar
  • 13
1 vote
1 answer
76 views

How to prepare a Protocol Change Proposal?

I want to know what is the procedure for preparing a protocol proposal. From my understanding it goes like this. Take the current Protocol src and make the changes in .ml files. Use a script to ...
user avatar
  • 13
2 votes
1 answer
130 views

How to deploy my own little network with some Tezos nodes on Docker just for research?

I'd like to run some Tezos nodes in my private Docker network just for studying baking process and principles of blockchain in practice. But all instructions I could find are about how to connect main ...
user avatar
  • 123
0 votes
2 answers
85 views

How can I save the gas cost of operations when running contracts in sandbox pytest?

I am testing smart contracts in sandbox mode using python scripts. I want to be able to store how much an operation cost. So for example when I get the output of a contract origination after baking a ...
user avatar
  • 647
1 vote
1 answer
69 views

How do you set the time of a transfer when testing contracts with SmartPy?

Previously, to set the (virtual) time a transaction happened in SmartPy I used the flag now when running a command like run. Now it seems to cause an error (seems like something changed in an update). ...
user avatar
  • 647
0 votes
1 answer
23 views

What is causes "Unexpected seed's nonce commitment in block header" when baking in sandbox mode?

I'm running some tests on tezos sandbox mode and in one of the commands for baking a new block, sometimes I get the following error: Unexpected seed's nonce commitment in block header. The error doesn'...
user avatar
  • 647
1 vote
1 answer
63 views

Test vectors for calculating operation hash

I am writing code to calculate operation hash from the raw hex and I would like some test vectors to verify my code. Where can I find that?
user avatar
1 vote
1 answer
36 views

What exactly is tested during Testing Phase of the governance cycle?

During the 48h cycle with the fork chain, what are bakers participating in the test doing? They are simply processing the same transactions that mainchain are producing using the new protocol looking ...
user avatar
  • 13
2 votes
1 answer
71 views

Get number of entries in bigmap

I am currently writing tests for a contract and for one of those tests, I would like to get the number of entries in a bigmap field of the contract's storage. I am using JavaScript with Taquito and ...
user avatar
2 votes
0 answers
47 views

How to set `contract` as input argument

I have a method Token_metadata_registry which takes contract(address) as input parameter and I would like to call that method from ligo dry-run. How do I do that? ligo dry-run contracts/main/fa2.ligo ...
user avatar
3 votes
1 answer
182 views

How do I call the FA2 balance_of endpoint through Truffle?

I have written a contract to implement FA2 and I have a Truffle/JavaScript setup to test this contract while running against a sandboxed node. I can test the transfer endpoint and the update_operators ...
user avatar
1 vote
1 answer
42 views

How do I change the originating address in truffle?

My truffle-config.js has const { alice } = require('./scripts/sandbox/accounts'); module.exports = { contracts_directory: "./contracts/main", networks: { development: { host: &...
user avatar
0 votes
0 answers
28 views

Is there a minimum number of tokens I need to have to bake on Carthagenet?

I have gotten about 236 odd tokens from the faucet and now I am about to register to bake on my node. The problem is I can't seem to find any mention on the minimum number of tokens required to bake ...
user avatar
1 vote
2 answers
35 views

Test failures for tezos-p2p on FreeBSD, kern.maxfiles limit exceeded

Tezos on FreeBSD Running atop a freshly ported Ocaml 4.09.1 that passes tests. Tezos tests fail for tezos-p2p (cannot bind to listening socket) due to too many file descriptors open. By watching ...
user avatar
5 votes
3 answers
1k views

Testing frameworks for tezos smart-contracts

I did few smart contracts with Ligo, but now looking for more productionize setup. Is there a test framework one can use for Tezos? I'm looking for something like waffle + mocha in Ethereum, or ...
user avatar
0 votes
1 answer
42 views

Error while setting up Tezster

While running the command: sudo tezster setup Encountered the error, sudo tezster setup [sudo] password for aditya: /usr/local/lib/node_modules/tezster/tezster.js:108 .action(async function(){ ...
user avatar
3 votes
0 answers
26 views

Testnet participation rate?

The current athens amendment proposal has now entered the testing phase. Where can i monitor what is the participation rate in this phase in terms of number of bakers and full nodes running it ?
user avatar
  • 6,006
4 votes
1 answer
43 views

Testnet Fork during Testing Period (Cycles 17-24)

Why is the testnet fork during the Testing Period (Cycles 17-24) only run for 48 hours as compared to the entire duration of 8 cycles of that phase? Wouldn't it make more sense to test for a longer ...
user avatar
  • 399
5 votes
2 answers
175 views

How to run unit tests?

I have downloaded the source code and built my node from scratch. What command should I run in order to double check that all unit tests run fine? In particular I am interested in running the unit ...
user avatar
  • 6,006
13 votes
3 answers
187 views

How can I write tests for my smart contracts?

I like doing TDD and would like to build up a test suite around my contract code. I have been looking at both ReasonML and Liquidity but neither seems to have a great testing story yet. Does it make ...
user avatar
  • 1,973