Skip to content

Commit

Permalink
2912 paris cleanup (#2957)
Browse files Browse the repository at this point in the history
* test: replaced all oxford ref with paris

* test: updated test mentioning protocol

* test: removed unneeded test case

* test: refine failing_noop test
  • Loading branch information
hui-an-yang authored May 14, 2024
1 parent 65bd481 commit 9c30e01
Show file tree
Hide file tree
Showing 17 changed files with 185 additions and 376 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ jobs:
strategy:
matrix:
include:
- testnet: oxfordnet
testnet_uppercase: OXFORDNET
- testnet: parisnet
testnet_uppercase: PARISNET
steps:
Expand Down
2 changes: 0 additions & 2 deletions docs/rpc_nodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,11 @@ values={[
|------------------|--------------|------------------------------------------|---------------------------------------------------------------------------------|
| ECAD Labs | Mainnet | https://mainnet.ecadinfra.com | [Check](https://mainnet.ecadinfra.com/chains/main/blocks/head/header) |
| ECAD Labs | Ghostnet | https://ghostnet.ecadinfra.com | [Check](https://ghostnet.ecadinfra.com/chains/main/blocks/head/header) |
| ECAD Labs | Oxfordnet | https://oxfordnet.ecadinfra.com | [Check](https://oxfordnet.ecadinfra.com/chains/main/blocks/head/header) |
| SmartPy | Mainnet | https://mainnet.smartpy.io | [Check](https://mainnet.smartpy.io/chains/main/blocks/head/header) |
| SmartPy | Ghostnet | https://ghostnet.smartpy.io | [Check](https://ghostnet.smartpy.io/chains/main/blocks/head/header) |
| Tezos Foundation | Mainnet | https://rpc.tzbeta.net/ | [Check](https://rpc.tzbeta.net/chains/main/blocks/head/header) |
| Marigold | Mainnet | https://mainnet.tezos.marigold.dev/ | [Check](https://mainnet.tezos.marigold.dev/chains/main/blocks/head/header) |
| Marigold | Ghostnet | https://ghostnet.tezos.marigold.dev/ | [Check](https://ghostnet.tezos.marigold.dev/chains/main/blocks/head/header) |
| Marigold | Oxfordnet | https://oxfordnet.tezos.marigold.dev/ | [Check](https://oxfordnet.tezos.marigold.dev/chains/main/blocks/head/header) |

*If you are aware of a public node missing from our list or our information is inaccurate, please help us by submitting an issue or pull request on our GitHub page.*
</TabItem>
Expand Down
2 changes: 1 addition & 1 deletion docs/rpc_nodes_integration_test.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ author: Roxane Letourneau
1. The RPC nodes' integration tests are disabled by default.
Remove `./rpc-nodes.spec.ts` from `"testPathIgnorePatterns"` in the package.json.

**oxfordnet**: `npm run test:parisnet rpc-nodes.spec.ts`
**parisnet**: `npm run test:parisnet rpc-nodes.spec.ts`

**When all endpoints are accessible for a node, you will obtain:**

Expand Down
4 changes: 2 additions & 2 deletions docs/wallet_API.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Please check out the section [Subscribing to events](#subscribing-to-events) to

In previous versions of Beacon, you were able to set the `network` property when doing `requestPermissions()`. This behavior was removed from Beacon, and you must now set the network when instantiating the wallet.

You can choose among `mainnet`, `oxfordnet`, `ghostnet` and `custom` to set up the network. Once the permissions have been configured, you can get the user's address by calling the `getPKH` method on the wallet:
You can choose among `mainnet`, `parisnet`, `ghostnet` and `custom` to set up the network. Once the permissions have been configured, you can get the user's address by calling the `getPKH` method on the wallet:

```js
const userAddress = await wallet.getPKH();
Expand Down Expand Up @@ -175,7 +175,7 @@ const wallet = new TempleWallet('MyAwesomeDapp');
The class constructor takes one parameter, the name of your dapp (this will be used later in the transaction confirmation pop-up). After the instantiation, we can connect the wallet by calling the `connect` method:

```js
await wallet.connect('mainnet' | 'oxfordnet' | 'ghostnet' | 'mondaynet' | 'sandbox');
await wallet.connect('mainnet' | 'parisnet' | 'ghostnet' | 'mondaynet' | 'sandbox');
```

(Temple used to be called Thanos and some Taquito code still uses the name Thanos.)
Expand Down
12 changes: 6 additions & 6 deletions integration-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Depending on the current Tezos upgrade cycle, multiple testnet networks may be c


```
OXFORDNET=true npm run test
PARISNET=true npm run test
```

## Configuration
Expand All @@ -52,15 +52,15 @@ If different testnets are configured in the `config.ts` file, you can run tests


```
npm run test:oxfordnet contract-with-bigmap-init.spec.ts
npm run test:parisnet contract-with-bigmap-init.spec.ts
```


Or for a specific test within a test file:


```
npm run test:oxfordnet -- -t "Verify contract.originate for a contract and call deposit method with unit param"
npm run test:parisnet -- -t "Verify contract.originate for a contract and call deposit method with unit param"
```


Expand All @@ -70,7 +70,7 @@ npm run test:oxfordnet -- -t "Verify contract.originate for a contract and call
To run tests against a node that is not pre-configured in Taquito, use:


`export TEZOS_RPC_OXFORDNET='http://localhost:8732'`.
`export TEZOS_RPC_PARISNET='http://localhost:8732'`.

## Using a Secret Key Instead of the Keygen API

Expand All @@ -79,7 +79,7 @@ By default, the integration tests use an ephemeral key managed by the Keygen API


```
npm run test:oxfordnet-secret-key contract-with-bigmap-init.spec.ts
npm run test:parisnet-secret-key contract-with-bigmap-init.spec.ts
```


Expand All @@ -103,7 +103,7 @@ To review the graphical report of the test run, open the index.html file in ~/ta
## Taquito Integration Tests with Flextesa

:::warning
Due to the discontinuation of Flextesa support from Protocol Oxford onwards, we unfortunately will not be testing against sandboxes anymore.
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.
:::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,17 @@ import { OpKind, TezosToolkit } from "@taquito/taquito";
import { InMemorySigner } from "@taquito/signer";
import { verifySignature } from "@taquito/utils";

CONFIGS().forEach(({ rpc }) => {
const aliceSKey = 'edsk3QoqBuvdamxouPhin7swCvkQNgq4jP5KZPbwWNnwdZpSpJiEbq'

CONFIGS().forEach(({ lib, setup, rpc }) => {
describe(`Test failing_noop through contract api using: ${rpc}`, () => {
let Tezos: TezosToolkit;
let Tezos = lib;

beforeAll(async () => {
if(rpc.includes('oxfordnet')){
Tezos = new TezosToolkit('https://rpc.tzkt.io/oxfordnet');
} else if(rpc.includes('ghostnet')){
Tezos = new TezosToolkit('https://rpc.tzkt.io/ghostnet');
} else {
Tezos = new TezosToolkit(rpc);
setup(true);
if (rpc.includes('parisnet')) {
Tezos.setProvider({ rpc: 'https://rpc.tzkt.io/parisnet' }); // public archive node to fetch genesis block
} else if (rpc.includes('ghostnet')) {
Tezos.setProvider({ rpc: 'https://rpc.tzkt.io/ghostnet' }); // public archive node to fetch genesis block
}
Tezos.setSignerProvider(new InMemorySigner(aliceSKey));
});

it('Verify that the contract.failingNoop signs a text on the genesis block', async () => {
Expand All @@ -43,8 +39,8 @@ CONFIGS().forEach(({ rpc }) => {
let Mainnet: TezosToolkit;

beforeAll(async () => {
Mainnet = new TezosToolkit('https://rpc.tzkt.io/mainnet'); // this is a mainnet archive history mode public rpc node url
Mainnet.setSignerProvider(new InMemorySigner(aliceSKey));
Mainnet = new TezosToolkit('https://rpc.tzkt.io/mainnet'); // public archive node to fetch genesis block
Mainnet.setSignerProvider(new InMemorySigner('edsk3QoqBuvdamxouPhin7swCvkQNgq4jP5KZPbwWNnwdZpSpJiEbq')); // alice's secret key
});

it('Verify that the contract.failingNoop result is as expected when the block and secret key are kept constant', async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { DefaultContractType, OriginationOperation, Protocols } from "@taquito/taquito";
import { DefaultContractType, OriginationOperation } from "@taquito/taquito";
import { CONFIGS } from "../../config";
import { ProtoGreaterOrEqual } from "@taquito/michel-codec";
import { buf2hex } from "@taquito/utils";
import { Chest } from '@taquito/timelock';

CONFIGS().forEach(({ lib, rpc, setup, protocol }) => {
CONFIGS().forEach(({ lib, rpc, setup }) => {
const Tezos = lib;
const oxfordAndAlpha = ProtoGreaterOrEqual(protocol, Protocols.ProxfordY) ? test : test.skip;

describe(`Test contract origination with timelock types (chest or chest_key) in storage and retrieve its value through contract api: ${rpc}`, () => {
const { chest, key } = Chest.newChestAndKey(new TextEncoder().encode('test'), 1000);
Expand All @@ -31,7 +29,7 @@ CONFIGS().forEach(({ lib, rpc, setup, protocol }) => {
await opChestKey.confirmation()
})

oxfordAndAlpha('Verify contract.originate for a contract with chest in storage', async () => {
it('Verify contract.originate for a contract with chest in storage', async () => {
expect(opChest.hash).toBeDefined();
expect(opChest.includedInBlock).toBeLessThan(Number.POSITIVE_INFINITY)
const contract = await opChest.contract();
Expand All @@ -40,7 +38,7 @@ CONFIGS().forEach(({ lib, rpc, setup, protocol }) => {
expect(storage).toEqual(buf2hex(chest.encode()));
});

oxfordAndAlpha('Verify contract.originate for a contract with chest_key in storage', async () => {
it('Verify contract.originate for a contract with chest_key in storage', async () => {
expect(opChestKey.hash).toBeDefined();
expect(opChestKey.includedInBlock).toBeLessThan(Number.POSITIVE_INFINITY)
const contract = await opChestKey.contract();
Expand Down
12 changes: 1 addition & 11 deletions integration-tests/__tests__/local-forging.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { CONFIGS } from "../config";
import { commonCases, oxfordCases, parisCases } from '../data/allTestsCases';
import { commonCases, parisCases } from '../data/allTestsCases';
import { LocalForger, ProtocolsHash } from '@taquito/local-forging'
import { Protocols, TezosToolkit } from "@taquito/taquito";
import { ProtoGreaterOrEqual } from '@taquito/michel-codec';

CONFIGS().forEach(({ rpc, protocol }) => {
const Tezos = new TezosToolkit(rpc);
const oxfordAndAlpha = ProtoGreaterOrEqual(protocol, Protocols.ProxfordY) ? test : test.skip
const parisAndAlpha = ProtoGreaterOrEqual(protocol, Protocols.PtParisBQ) ? test : test.skip

describe(`Test local forger: ${rpc}`, () => {
Expand All @@ -19,15 +18,6 @@ CONFIGS().forEach(({ rpc, protocol }) => {
expect(await localForger.parse(rpcResult)).toEqual(expected || operation);
});
});
oxfordCases.forEach(({ name, operation, expected }) => {
oxfordAndAlpha(`Verify that .forge for local forge will return same result as for network forge for rpc: ${name} (${rpc})`, async () => {
const localForger = new LocalForger(protocol as unknown as ProtocolsHash);
const result = await localForger.forge(operation);
const rpcResult = await Tezos.rpc.forgeOperations(operation);
expect(result).toEqual(rpcResult);
expect(await localForger.parse(result)).toEqual(expected || operation);
});
});
// all protocols
commonCases.forEach(({ name, operation, expected }) => {
it(`Verify that .forge for local forge will return same result as for network forge for rpc: ${name} (${rpc})`, async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CONFIGS().forEach(({ rpc, protocol, setup, lib }) => {
describe(`Test forging pseudo entrypoints: ${rpc}`, () => {
let contract: DefaultContractType
// for every new protocol need to check https://tezos.gitlab.io/shell/p2p_api.html#alpha-entrypoint-determined-from-data-8-bit-tag for the latest entrypoints and corresponding tag
let entrypoint = { 0: 'default', 1: 'root', 2: 'do', 3: 'set_delegate', 4: 'remove_delegate', 5: 'deposit', 6: 'stake', 7: 'unstake', 8: 'finalize_unstake', 9: 'set_delegate_parameters' }
let parisEntrypoint = { 0: 'default', 1: 'root', 2: 'do', 3: 'set_delegate', 4: 'remove_delegate', 5: 'deposit', 6: 'stake', 7: 'unstake', 8: 'finalize_unstake', 9: 'set_delegate_parameters' }

beforeAll(async () => {
await setup();
Expand All @@ -23,7 +23,7 @@ CONFIGS().forEach(({ rpc, protocol, setup, lib }) => {
} catch(e) {console.log(e)}
})

Object.values(entrypoint).forEach(name => {
Object.values(parisEntrypoint).forEach(name => {
it(`Verify that local forge will return same result as for rpc forge for entrypoints name ${name}`, async () => {
const localForger = new LocalForger(protocol as unknown as ProtocolsHash);
const methodObject = await contract.methodsObject[name](UnitValue)
Expand Down
132 changes: 0 additions & 132 deletions integration-tests/__tests__/rpc/get-protocol-constants.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { ConstantsResponseProto019, ConstantsResponseProto020 } from '@taquito/r

CONFIGS().forEach(({ lib, protocol, rpc, networkType }) => {
const Tezos = lib;
const oxfordnet = (networkType == NetworkType.TESTNET && protocol === Protocols.ProxfordY) ? test : test.skip;
const parisnet = (networkType == NetworkType.TESTNET && protocol === Protocols.PtParisBQ) ? test : test.skip;
const weeklynet = (networkType == NetworkType.TESTNET && protocol === Protocols.ProtoALpha) ? test : test.skip;
describe('Test fetching constants for all protocols on Mainnet', () => {
Expand Down Expand Up @@ -288,137 +287,6 @@ CONFIGS().forEach(({ lib, protocol, rpc, networkType }) => {
});
});


oxfordnet(`should successfully fetch all constants for Oxfordnet using ${rpc}`, async () => {
Tezos.setRpcProvider(rpc);
const constants: ConstantsResponseProto019 = await Tezos.rpc.getConstants();
expect(constants).toEqual({
adaptive_issuance_activation_vote_enable: false,
adaptive_issuance_launch_ema_threshold: 100000000,
adaptive_rewards_params: {
center_dz: {
denominator: "2",
numerator: "1",
},
growth_rate: {
denominator: "100",
numerator: "1",
},
issuance_ratio_max: {
denominator: "20",
numerator: "1",
},
issuance_ratio_min: {
denominator: "2000",
numerator: "1",
},
max_bonus: "50000000000000",
radius_dz: {
denominator: "50",
numerator: "1",
},
},
autostaking_enable: true,
proof_of_work_nonce_size: 8,
nonce_length: 32,
max_anon_ops_per_block: 132,
max_operation_data_length: 32768,
max_proposals_per_delegate: 20,
max_micheline_node_count: 50000,
max_micheline_bytes_limit: 50000,
max_allowed_global_constants_depth: 10000,
cache_layout_size: 3,
michelson_maximum_type_size: 2001,
smart_rollup_max_wrapped_proof_binary_size: 30000,
smart_rollup_max_number_of_messages_per_level: '1000000',
preserved_cycles: 3,
blocks_per_cycle: 8192,
blocks_per_commitment: 64,
blocks_per_stake_snapshot: 512,
nonce_revelation_threshold: 512,
cycles_per_voting_period: 1,
hard_gas_limit_per_operation: new BigNumber(1040000),
hard_gas_limit_per_block: new BigNumber(2600000),
proof_of_work_threshold: new BigNumber(-1),
minimal_stake: new BigNumber(6000000000),
origination_size: 257,
cost_per_byte: new BigNumber(250),
hard_storage_limit_per_operation: new BigNumber(60000),
percentage_of_frozen_deposits_slashed_per_double_baking: 5,
percentage_of_frozen_deposits_slashed_per_double_attestation: 50,
minimal_frozen_stake: '600000000',
limit_of_delegation_over_baking: 9,
issuance_weights: {
attesting_reward_weight: 10240,
baking_reward_bonus_weight: 5120,
baking_reward_fixed_portion_weight: 5120,
base_total_issued_per_minute: "85007812",
liquidity_baking_subsidy_weight: 1280,
seed_nonce_revelation_tip_weight: 1,
vdf_revelation_tip_weight: 1,
},
min_proposal_quorum: 500,
edge_of_staking_over_delegation: 2,
global_limit_of_staking_over_baking: 5,
liquidity_baking_toggle_ema_threshold: 1000000000,
max_operations_time_to_live: 240,
minimal_block_delay: new BigNumber(8),
delay_increment_per_round: new BigNumber(3),
consensus_committee_size: 7000,
consensus_threshold: 4667,
minimal_participation_ratio: {
numerator: 2,
denominator: 3
},
max_slashing_period: 2,
cache_script_size: 100000000,
cache_stake_distribution_cycles: 8,
cache_sampler_state_cycles: 8,
dal_parametric: {
feature_enable: false,
blocks_per_epoch: 1,
attestation_lag: 4,
attestation_threshold: 50,
redundancy_factor: 16,
page_size: 4096,
slot_size: 1048576,
number_of_shards: 2048,
number_of_slots: 256,
},
quorum_max: 7000,
quorum_min: 2000,
smart_rollup_arith_pvm_enable: false,
smart_rollup_challenge_window_in_blocks: 40,
smart_rollup_commitment_period_in_blocks: 20,
smart_rollup_max_lookahead_in_blocks: 30000,
smart_rollup_max_active_outbox_levels: 20160,
smart_rollup_max_outbox_messages_per_level: 100,
smart_rollup_max_number_of_cemented_commitments: 5,
smart_rollup_max_number_of_parallel_games: 32,
smart_rollup_message_size_limit: 4096,
smart_rollup_number_of_sections_in_dissection: 32,
smart_rollup_origination_size: 6314,
smart_rollup_private_enable: true,
smart_rollup_reveal_activation_level: {
dal_page: 2147483646,
dal_parameters: 2147483646,
metadata: 0,
raw_data: {
Blake2B: 0,
},
},
smart_rollup_riscv_pvm_enable: false,
smart_rollup_stake_amount: '10000000000',
smart_rollup_timeout_period_in_blocks: 500,
testnet_dictator: 'tz1Xf8zdT3DbAX9cHw3c3CXh79rc4nK4gCe8',
vdf_difficulty: new BigNumber(10000000000),
zk_rollup_enable: false,
zk_rollup_max_ticket_payload_size: 2048,
zk_rollup_min_pending_to_process: 10,
zk_rollup_origination_size: 4000,
});
});

weeklynet(`should successfully fetch all constants for weeklynet using ${rpc}`, async () => {
Tezos.setRpcProvider(rpc);
const constants: ConstantsResponseProto019 = await Tezos.rpc.getConstants();
Expand Down
6 changes: 0 additions & 6 deletions integration-tests/__tests__/rpc/nodes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ CONFIGS().forEach(
}) => {
const Tezos = lib;
const unrestrictedRPCNode = rpc.endsWith("ecadinfra.com") ? test.skip : test;
const oxford = protocol === Protocols.ProxfordY ? test : test.skip;
const parisAndAlpha = ProtoGreaterOrEqual(protocol, Protocols.PtParisBQ) ? test : test.skip;

let ticketContract: DefaultContractType;
Expand Down Expand Up @@ -473,11 +472,6 @@ CONFIGS().forEach(
expect(ticketBalances[0].amount).toBeDefined();
});

oxford(`Verify that rpcClient.getAdaptiveIssuanceLaunchCycle will retrieve launch cycle null for ${rpc}`, async () => {
const launchCycle = await rpcClient.getAdaptiveIssuanceLaunchCycle();
expect(launchCycle).toEqual(null);
})

parisAndAlpha(`Verify that rpcClient.getAdaptiveIssuanceLaunchCycle will retrieve launch cycle 6 for ${rpc}`, async () => {
const launchCycle = await rpcClient.getAdaptiveIssuanceLaunchCycle();
expect(launchCycle).toEqual(6);
Expand Down
Loading

0 comments on commit 9c30e01

Please sign in to comment.