Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare bugs #3096

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
42a5799
Merge branch 'master' of https://github.com/ecadlabs/taquito
hui-an-yang Jul 26, 2024
e45286c
Merge branch 'master' of https://github.com/ecadlabs/taquito
hui-an-yang Aug 29, 2024
903169d
Merge branch 'master' of https://github.com/ecadlabs/taquito
hui-an-yang Sep 12, 2024
a706929
Merge branch 'master' of https://github.com/ecadlabs/taquito
hui-an-yang Oct 4, 2024
cd57994
Merge branch 'master' of https://github.com/ecadlabs/taquito
hui-an-yang Oct 16, 2024
28cc2b5
Merge branch 'master' of https://github.com/ecadlabs/taquito
hui-an-yang Nov 8, 2024
28644cd
Merge branch 'master' of https://github.com/ecadlabs/taquito
hui-an-yang Dec 2, 2024
d3ae08f
fix: fix prepareProvier ballot and proposal bug and add sandbox test …
hui-an-yang Dec 12, 2024
d70c997
ci: updated ci sandbox-proposal-and-ballot test file path
hui-an-yang Dec 12, 2024
4fb008c
chore: tried downgrade node to avoid socket hang up error in tezbox
hui-an-yang Dec 12, 2024
65daa37
ci: try changing localhost to 0.0.0.0 in tezbox script to fix ECONNRE…
hui-an-yang Dec 12, 2024
b044a03
test: originated knownTicketContract to be used in several tests
hui-an-yang Dec 13, 2024
6a15d4b
test: rewrite prepare integration test and improve increasePaidStorag…
hui-an-yang Dec 16, 2024
9e741a3
test: revamp sandbox-proposal-and-ballot-operation.spec.ts
hui-an-yang Dec 17, 2024
26ca83f
Merge branch 'master' of https://github.com/ecadlabs/taquito into pre…
hui-an-yang Dec 17, 2024
599ee03
test: re-orgonised sandbox doc and sandbox tests
hui-an-yang Dec 17, 2024
ef7f0f6
test: improved failing-noop tests
hui-an-yang Dec 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
matrix:
node:
- 'lts/iron'
- '22'
- lts/hydrogen
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/iron
node-version: lts/hydrogen
- run: npm ci
- run: npm run build
- if: ${{ !github.event.pull_request.head.repo.fork }}
Expand All @@ -62,3 +62,25 @@ jobs:
env:
# Ternary operator workaround
TEZOS_RPC_${{ matrix.testnet_uppercase }}: ${{ github.event.pull_request.head.repo.fork && format('https://{0}.ecadinfra.com', matrix.testnet) || null }}

integration-tests-tezbox:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
include:
- testnet: parisnet
testnet_uppercase: PARISNET
flextesa_docker_image:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/hydrogen
- name: Provision Tezbox ${{ matrix.testnet }} container
run: npm -w integration-tests run sandbox:${{ matrix.testnet }}
- run: npm ci
- run: npm run build
- run: npm -w integration-tests run test __tests__/tezbox/
env:
TEZOS_RPC_${{ matrix.testnet_uppercase }}: http://0.0.0.0:8732
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20
v18
3 changes: 3 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"oxheadalpha",
"parisnet",
"Pkhfrom",
"preapplied",
"preattestation",
"precommit",
"preendorsement",
Expand Down Expand Up @@ -105,6 +106,8 @@
"tcli",
"testbox",
"testchain",
"tezbox",
"tezboxnet",
"tezbridge",
"tezos",
"Thanos",
Expand Down
2 changes: 1 addition & 1 deletion docs/metadata-tzip16.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const Tezos = new TezosToolkit('rpcUrl');

// The constructor of the `MetadataProvider` class takes a `Map<string, Handler>` as a parameter.
const customHandler = new Map<string, Handler>([
['ipfs', new IpfsHttpHandler('gateway.ipfs.io')], // Constructor of IpfsHttpHandler takes an optional gateway
['ipfs', new IpfsHttpHandler('ipfs.io')], // Constructor of IpfsHttpHandler takes an optional gateway
['http', 'customHttpHandler'], // Custom HTTP(S) handler
['https', 'customHttpHandler'],
['tezos-storage', new TezosStorageHandler()],
Expand Down
24 changes: 17 additions & 7 deletions integration-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

The `taquito/integration-tests` directory contains the integration test suite for Taquito. These tests are executed against live Tezos testnets, ensuring a comprehensive evaluation of various Taquito use cases.

The tests may also be run using Flextesa. This is useful for testing new features not in current test nets and for testing features around governance that benefit from shortened block processing times. As well Flextesa tests offer a secondary confirmation of the test net results.
The tests may also be run using tezbox. This is useful for testing new features not in current testnets and for testing features around governance that benefit from shortened block processing times. As well tezbox tests offer a secondary confirmation of the testnet results.

Internally Taquito is tested with tests running in parallel. This is achieved using an application that generates new keys and funds them as needed per test.
The application is not publicly available. External users, therefore, must run the Taquito Integration Tests in sequence, one test at a time.
Expand Down Expand Up @@ -100,13 +100,23 @@ If running the test with a configured secret key, ensure that the account balanc
To review the graphical report of the test run, open the index.html file in ~/taquito/integration-tests/jest-stare after each test run.


## Taquito Integration Tests with Flextesa
## Taquito Integration Tests with Tezbox

:::warning
Due to the discontinuation of Flextesa support from Protocol Oxford onwards, we unfortunately will not be testing against sandboxes anymore.

The only sandbox tests we're running points to the latest Nairobibox to specifically test for the `ballot` and `drain_delegate` operation.
:::
First, run this command to spin up the sandbox provided by [tezbox](https://github.com/tez-capital/tezbox)
This command will override the protocol parameters to 10 `blocks_per_cycle` and 1 second `minimal_block_delay`
```
npm run sandbox:parisnet
```
Then you can run the tests under tezbox subfolder that requires to wait cycles like proposals, ballot and drain_delegate
```
TEZOS_RPC_PARISNET=http://localhost:8732 npm run test __tests__/tezbox/
```
Or if you'd like to run the entire `__tests__` folder run these commands
```
source sandbox-env.sh
npm run originate-known-contracts
npm run test:parisnet-secret-key
```

## The Keygen API

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { OpKind, TezosToolkit } from "@taquito/taquito";
import { InMemorySigner } from "@taquito/signer";
import { verifySignature } from "@taquito/utils";

CONFIGS().forEach(({ setup, rpc }) => {
CONFIGS().forEach(({ lib, setup, rpc }) => {
let signerAlice = new InMemorySigner('edsk3QoqBuvdamxouPhin7swCvkQNgq4jP5KZPbwWNnwdZpSpJiEbq')

describe(`Test failing_noop through wallet api using: ${rpc}`, () => {
let Tezos: TezosToolkit;
let Tezos = lib;
beforeAll(async () => {
setup(true)
if (rpc.includes('paris')) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { CONFIGS } from "../../../config";
import { DefaultContractType, TezosToolkit } from "@taquito/taquito";
import { ticketsSendTz, ticketsBagTz, ticketsBlackholeTz } from "../../../data/code_with_ticket_transfer";
import { ticketsBagTz, ticketsBlackholeTz } from "../../../data/code_with_ticket_transfer";
import { RpcClient, TicketTokenParams } from '@taquito/rpc';

CONFIGS().forEach(({ lib, rpc, setup, createAddress }) => {
CONFIGS().forEach(({ lib, rpc, setup, createAddress, knownTicketContract }) => {
const Tezos1 = lib;
const client = new RpcClient(rpc);

Expand All @@ -25,9 +25,7 @@ CONFIGS().forEach(({ lib, rpc, setup, createAddress }) => {
tezos2Pkh = await Tezos2.signer.publicKeyHash();

// ticketSend contract has one default entrypoint which accepts an address to issue tickets to
const ticketSendOrigination = await Tezos1.contract.originate({ code: ticketsSendTz, storage: null });
await ticketSendOrigination.confirmation();
ticketSendContract = await ticketSendOrigination.contract();
ticketSendContract = await Tezos1.contract.at(knownTicketContract)

// ticketBag contract has two entrypoints, one is "save" to receive tickets and the other is "send" to send tickets out
const ticketBagOrigination = await Tezos1.contract.originate({ code: ticketsBagTz, storage: [] });
Expand All @@ -46,7 +44,7 @@ CONFIGS().forEach(({ lib, rpc, setup, createAddress }) => {
});

it('will send 3 tickets from an originated to an implicit account', async () => {
const ticketSendToImplicitOp = await ticketSendContract.methods.default(tezos1Pkh, '3').send();
const ticketSendToImplicitOp = await ticketSendContract.methodsObject.default({ 0: tezos1Pkh, 1: '3' }).send();
await ticketSendToImplicitOp.confirmation();
expect(ticketSendToImplicitOp.status).toEqual('applied');

Expand Down Expand Up @@ -92,7 +90,7 @@ CONFIGS().forEach(({ lib, rpc, setup, createAddress }) => {
});

it('will send 1 ticket from an origianted to another originated account to dispose', async () => {
const ticketSendOriginatedOp = await ticketBagContract.methods.send(ticketBlackholeContract.address).send();
const ticketSendOriginatedOp = await ticketBagContract.methodsObject.send(ticketBlackholeContract.address).send();
await ticketSendOriginatedOp.confirmation();
expect(ticketSendOriginatedOp.status).toEqual('applied');

Expand Down

This file was deleted.

This file was deleted.

Loading
Loading