Questions tagged [testing]
The testing tag has no usage guidance.
38
questions
1
vote
1
answer
82
views
Playing around with Etherlink
We would be interested to play around with Etherlink, is there any documentation already out there on RPCs and how to get access to test tokens?
0
votes
1
answer
38
views
error when using flextesa: mempool already contains a conflicting operation
when using flextesa to run a test suite I often get this error:
Error while applying operation oojMmYYobT1pFJkVowfGUMKSfvaCBRfkGBxaxaHHkEw7YvrfDup:\nError:\n The operation ...
1
vote
1
answer
52
views
Writing SmartPy tests along with LIGO contracts
I have a set of smart contracts coded in SmartPy. They are heavily interdependent and some of them also interact with cTez contracts.
I need to write SmartPy tests to check if everything is working ...
0
votes
1
answer
7
views
How can I apply a minus operation to Tez type in the archetype testing library?
I am writing some simple contract tests, and I want to check that account balances are updating appropriately.
There is currently no minus method on the Tez type. I attempted to add my own to the ...
0
votes
2
answers
20
views
How can I assign values for a map-type in an archetype test script?
I have the following typescript in my test script:
const tmdBytes = Bytes.hex_encode("ipfs://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
const tmdMap : Array<[ ...
3
votes
2
answers
41
views
Completium-cli setMockupNow
I write tests using completium-cli and jest. All the tests I wrote work correctly, except one. It requires waiting for X blocks (X=3 in current example) and calling entrypoint with the valid ...
1
vote
1
answer
27
views
How to test that an error is raised in ligo?
I would like to know if there is some way of testing for error raised with failwith in ligo using the testing framework?
There doesn’t seem to be any documented try-catch mechanism yet, or am I ...
0
votes
1
answer
37
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,...
2
votes
1
answer
60
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 ...
1
vote
1
answer
59
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 ...
1
vote
1
answer
29
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 ...
0
votes
2
answers
121
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 ...
1
vote
2
answers
52
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 ...
0
votes
1
answer
71
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 ...
0
votes
2
answers
34
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 ...
0
votes
2
answers
88
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 ...
0
votes
1
answer
25
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()
...
2
votes
1
answer
70
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
...
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 ...
2
votes
1
answer
100
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 ...
2
votes
1
answer
138
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 ...
0
votes
2
answers
92
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 ...
1
vote
1
answer
80
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). ...
0
votes
1
answer
30
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'...
1
vote
1
answer
70
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?
1
vote
1
answer
37
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 ...
2
votes
1
answer
83
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 ...
2
votes
0
answers
48
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 ...
3
votes
1
answer
210
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 ...
1
vote
1
answer
56
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: &...
0
votes
0
answers
29
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 ...
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 ...
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 ...
0
votes
1
answer
47
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(){
...
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 ?
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 ...
5
votes
2
answers
176
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 ...
13
votes
3
answers
203
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 ...