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

Oxford2 #2771

Merged
merged 18 commits into from
Jan 29, 2024
Merged

Oxford2 #2771

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
134 changes: 67 additions & 67 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ jobs:
strategy:
matrix:
include:
- testnet: nairobinet
testnet_uppercase: NAIROBINET
- testnet: oxfordnet
testnet_uppercase: OXFORDNET
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand All @@ -62,69 +62,69 @@ jobs:
# 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-flextesa:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
include:
- protocol: Nairobi
testnet: nairobinet
testnet_uppercase: NAIROBINET
flextesa_docker_image: oxheadalpha/flextesa:20230607
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/hydrogen
# integration-tests-flextesa:
# runs-on: ubuntu-latest
# continue-on-error: true
# strategy:
# matrix:
# include:
# - protocol: Oxford
# testnet: oxfordnet
# testnet_uppercase: OXFORDNET
# flextesa_docker_image: oxheadalpha/flextesa:latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-node@v3
# with:
# node-version: lts/hydrogen

## The 4 Bootstrap Accounts (alias, pk, pkh, sk)
# alice,edpkvGfYw3LyB1UcCahKQk4rF2tvbMUk8GFiTuMjL75uGXrpvKXhjn,tz1VSUr8wwNhLAzempoch5d6hLRiTh8Cjcjb,unencrypted:edsk3QoqBuvdamxouPhin7swCvkQNgq4jP5KZPbwWNnwdZpSpJiEbq
# bob,edpkurPsQ8eUApnLUJ9ZPDvu98E8VNj4KtJa1aZr16Cr5ow5VHKnz4,tz1aSkwEot3L2kmUvcoxzjMomb9mvBNuzFK6,unencrypted:edsk3RFfvaFaxbHx8BMtEW1rKQcPtDML3LXjNqMNLCzC3wLC1bWbAt
# charlie,edpkuvMuRuZ6ZbAquJH1XxBFfUmuBFz1zp9ENEqjCVgLp3NcY3Ww9M,tz1RDVcKmFcqzvTpJirvg4JaUVgZbjtnRT26,unencrypted:edsk3RgWvbKKA1atEUcaGwivge7QtckHkTL9nQJUXQKY5r8WKp4pF4
# donald,edpkvXGp1BMZxHkwg3mKnWfJYS6HTJ5JtufD8YXxLtH8UKqLZkZVun,tz1eSWp4B9s1qhtNMMNXAkaf2oqCnDHd2iAm,unencrypted:edsk3S8mG2sSBmSRbikAcZVLCz4SrCq4DjmsQRic6MGktqNFijfrS2
- name: Generate Flextesa bootstrap accounts
run: |-
echo "alice=$(docker run --rm ${{ matrix.flextesa_docker_image }} flextesa key alice)" >> $GITHUB_ENV
echo "bob=$(docker run --rm ${{ matrix.flextesa_docker_image }} flextesa key bob)" >> $GITHUB_ENV
echo "charlie=$(docker run --rm ${{ matrix.flextesa_docker_image }} flextesa key charlie)" >> $GITHUB_ENV
echo "donald=$(docker run --rm ${{ matrix.flextesa_docker_image }} flextesa key donald)" >> $GITHUB_ENV
- name: Provision Flextesa ${{ matrix.protocol }} container
run: |-
docker run \
--rm \
--name my-sandbox \
--detach \
-p 20000:20000 \
${{ matrix.flextesa_docker_image }} \
flextesa mini-net \
--root /tmp/mini-box --size 1 \
--set-history-mode N000:archive \
--number-of-b 1 \
--balance-of-bootstrap-accounts tez:100_000_000 \
--time-b 1 \
--add-bootstrap-account="${alice}@2_000_000_000_000" \
--add-bootstrap-account="${bob}@2_000_000_000_000" \
--add-bootstrap-account="${charlie}@2_000_000_000_000" \
--add-bootstrap-account="${donald}@2_000_000_000_000" \
--no-daemons-for=donald \
--until-level 200_000_000 \
--protocol-kind ${{ matrix.protocol }}
- run: npm ci
- run: npm run build
- run: npm -w integration-tests run test:originate-known-contracts && npm -w integration-tests run test:${{ matrix.testnet }}-secret-key -- --testPathIgnorePatterns ledger-signer-failing-tests.spec.ts ledger-signer.spec.ts contract-estimation-tests.spec.ts rpc-get-protocol-constants.spec.ts sandbox-ballot-operation.spec.ts contract-batch-high-number-of-operations.spec.ts contract-pair-as-key.spec.ts --detectOpenHandles --runInBand
env:
RUN_${{ matrix.testnet_uppercase }}_WITH_SECRET_KEY: true
SECRET_KEY: edsk3S8mG2sSBmSRbikAcZVLCz4SrCq4DjmsQRic6MGktqNFijfrS2
TEZOS_RPC_${{ matrix.testnet_uppercase }}: http://localhost:20000
POLLING_INTERVAL_MILLISECONDS: 100
RPC_CACHE_MILLISECONDS: 0
TEZOS_BAKER: tz1VSUr8wwNhLAzempoch5d6hLRiTh8Cjcjb
- run: npm -w integration-tests run test:${{ matrix.testnet }}-secret-key sandbox-ballot-operation.spec.ts
env:
RUN_${{ matrix.testnet_uppercase }}_WITH_SECRET_KEY: true
SECRET_KEY: edsk3QoqBuvdamxouPhin7swCvkQNgq4jP5KZPbwWNnwdZpSpJiEbq
TEZOS_RPC_${{ matrix.testnet_uppercase }}: http://localhost:20000
POLLING_INTERVAL_MILLISECONDS: 100
RPC_CACHE_MILLISECONDS: 0
TEZOS_BAKER: tz1VSUr8wwNhLAzempoch5d6hLRiTh8Cjcjb
# ## The 4 Bootstrap Accounts (alias, pk, pkh, sk)
# # alice,edpkvGfYw3LyB1UcCahKQk4rF2tvbMUk8GFiTuMjL75uGXrpvKXhjn,tz1VSUr8wwNhLAzempoch5d6hLRiTh8Cjcjb,unencrypted:edsk3QoqBuvdamxouPhin7swCvkQNgq4jP5KZPbwWNnwdZpSpJiEbq
# # bob,edpkurPsQ8eUApnLUJ9ZPDvu98E8VNj4KtJa1aZr16Cr5ow5VHKnz4,tz1aSkwEot3L2kmUvcoxzjMomb9mvBNuzFK6,unencrypted:edsk3RFfvaFaxbHx8BMtEW1rKQcPtDML3LXjNqMNLCzC3wLC1bWbAt
# # charlie,edpkuvMuRuZ6ZbAquJH1XxBFfUmuBFz1zp9ENEqjCVgLp3NcY3Ww9M,tz1RDVcKmFcqzvTpJirvg4JaUVgZbjtnRT26,unencrypted:edsk3RgWvbKKA1atEUcaGwivge7QtckHkTL9nQJUXQKY5r8WKp4pF4
# # donald,edpkvXGp1BMZxHkwg3mKnWfJYS6HTJ5JtufD8YXxLtH8UKqLZkZVun,tz1eSWp4B9s1qhtNMMNXAkaf2oqCnDHd2iAm,unencrypted:edsk3S8mG2sSBmSRbikAcZVLCz4SrCq4DjmsQRic6MGktqNFijfrS2
# - name: Generate Flextesa bootstrap accounts
# run: |-
# echo "alice=$(docker run --rm ${{ matrix.flextesa_docker_image }} flextesa key alice)" >> $GITHUB_ENV
# echo "bob=$(docker run --rm ${{ matrix.flextesa_docker_image }} flextesa key bob)" >> $GITHUB_ENV
# echo "charlie=$(docker run --rm ${{ matrix.flextesa_docker_image }} flextesa key charlie)" >> $GITHUB_ENV
# echo "donald=$(docker run --rm ${{ matrix.flextesa_docker_image }} flextesa key donald)" >> $GITHUB_ENV
# - name: Provision Flextesa ${{ matrix.protocol }} container
# run: |-
# docker run \
# --rm \
# --name my-sandbox \
# --detach \
# -p 20000:20000 \
# ${{ matrix.flextesa_docker_image }} \
# flextesa mini-net \
# --root /tmp/mini-box --size 1 \
# --set-history-mode N000:archive \
# --number-of-b 1 \
# --balance-of-bootstrap-accounts tez:100_000_000 \
# --time-b 1 \
# --add-bootstrap-account="${alice}@2_000_000_000_000" \
# --add-bootstrap-account="${bob}@2_000_000_000_000" \
# --add-bootstrap-account="${charlie}@2_000_000_000_000" \
# --add-bootstrap-account="${donald}@2_000_000_000_000" \
# --no-daemons-for=donald \
# --until-level 200_000_000 \
# --protocol-kind ${{ matrix.protocol }}
# - run: npm ci
# - run: npm run build
# - run: npm -w integration-tests run originate-known-contracts && npm -w integration-tests run test:${{ matrix.testnet }}-secret-key -- --testPathIgnorePatterns ledger-signer-failing-tests.spec.ts ledger-signer.spec.ts contract-estimation-tests.spec.ts rpc-get-protocol-constants.spec.ts sandbox-ballot-operation.spec.ts contract-batch-high-number-of-operations.spec.ts contract-pair-as-key.spec.ts --detectOpenHandles --runInBand
# env:
# RUN_${{ matrix.testnet_uppercase }}_WITH_SECRET_KEY: true
# SECRET_KEY: edsk3S8mG2sSBmSRbikAcZVLCz4SrCq4DjmsQRic6MGktqNFijfrS2
# TEZOS_RPC_${{ matrix.testnet_uppercase }}: http://localhost:20000
# POLLING_INTERVAL_MILLISECONDS: 100
# RPC_CACHE_MILLISECONDS: 0
# TEZOS_BAKER: tz1VSUr8wwNhLAzempoch5d6hLRiTh8Cjcjb
# - run: npm -w integration-tests run test:${{ matrix.testnet }}-secret-key sandbox-ballot-operation.spec.ts
# env:
# RUN_${{ matrix.testnet_uppercase }}_WITH_SECRET_KEY: true
# SECRET_KEY: edsk3QoqBuvdamxouPhin7swCvkQNgq4jP5KZPbwWNnwdZpSpJiEbq
# TEZOS_RPC_${{ matrix.testnet_uppercase }}: http://localhost:20000
# POLLING_INTERVAL_MILLISECONDS: 100
# RPC_CACHE_MILLISECONDS: 0
# TEZOS_BAKER: tz1VSUr8wwNhLAzempoch5d6hLRiTh8Cjcjb
10 changes: 5 additions & 5 deletions apps/taquito-test-dapp/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "taquito-test-dapp-vite",
"private": true,
"version": "17.5.2",
"version": "19.0.0",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -25,10 +25,10 @@
},
"dependencies": {
"@airgap/beacon-sdk": "4.1.0",
"@taquito/beacon-wallet": "^17.5.2",
"@taquito/core": "^17.5.2",
"@taquito/taquito": "^17.5.2",
"@taquito/utils": "^17.5.2",
"@taquito/beacon-wallet": "^19.0.0",
"@taquito/core": "^19.0.0",
"@taquito/taquito": "^19.0.0",
"@taquito/utils": "^19.0.0",
"buffer": "^6.0.3",
"svelte-select": "^5.7.0",
"vite-compatible-readable-stream": "^3.6.1"
Expand Down
16 changes: 4 additions & 12 deletions apps/taquito-test-dapp/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,13 @@

let layout: Layout;

// https://ide.ligolang.org/p/RL93C86hftTTCNGU0ykLMw | https://ide.ligolang.org/p/61ENTorA4PSfQg-jhpu0jA
// https://better-call.dev/florencenet/KT1PzUGbdKaN332Smfd1ExpdKQ7BSzzJRqJ4/operations
// https://better-call.dev/granadanet/KT1T836HqhBu9waqmknStVDCXu2WogZtzsNz/operations
// https://better-call.dev/hangzhounet/KT1T2gL26SwYMxpkR5SZT1pHRBF84knfw8Cg/operations
// https://better-call.dev/ithacanet/KT1QKmcNBcfzVTXG2kBcE6XqXtEuYYUzMcT5/operations
// https://better-call.dev/mumbainet/KT1Tkm7U3NS9JWgeCGywrRTSQdLZJvDSgD5Z/operations

let browser = "";
let availableNetworks = [
{ value: "ghostnet", label: "Ghostnet", group: "current testnets" },
{ value: "mumbainet", label: "Mumbainet", group: "current testnets" },
{ value: "nairobinet", label: "Nairobinet", group: "current testnets" },
{ value: "oxfordnet", label: "Oxfordnet", group: "current testnets" },
{ value: "mainnet", label: "Mainnet", group: "mainnet" },
{ value: "dailynet", label: "Dailynet", group: "other testnets" },
{ value: "mondaynet", label: "Mondaynet", group: "other testnets" },
{ value: "weeklynet", label: "Weeklynet", group: "other testnets" },
{ value: "custom", label: "Custom", group: "custom network" },
];
let availableMatrixNodes = [
Expand All @@ -47,8 +39,8 @@
case "ghostnet":
store.updateNetworkType(NetworkType.GHOSTNET);
break;
case "nairobinet":
store.updateNetworkType(NetworkType.NAIROBINET);
case "oxfordnet":
store.updateNetworkType(NetworkType.OXFORDNET);
break;
case "custom":
//TODO: input custom RPC URL
Expand Down
12 changes: 6 additions & 6 deletions apps/taquito-test-dapp/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { NetworkType } from "@airgap/beacon-sdk";

export type SupportedNetworks = NetworkType.NAIROBINET | NetworkType.GHOSTNET | NetworkType.MAINNET | NetworkType.CUSTOM;
export type SupportedNetworks = NetworkType.OXFORDNET | NetworkType.GHOSTNET | NetworkType.MAINNET | NetworkType.CUSTOM;

const rpcUrls: Record<SupportedNetworks, string> = {
[NetworkType.MAINNET]: "https://mainnet.ecadinfra.com",
[NetworkType.GHOSTNET]: "https://ghostnet.ecadinfra.com/",
[NetworkType.NAIROBINET]: "https://nairobinet.ecadinfra.com/",
// [NetworkType.CUSTOM]: "https://ghostnet.ecadinfra.com/",
[NetworkType.OXFORDNET]: "https://oxfordnet.ecadinfra.com/",
[NetworkType.CUSTOM]: "https://ghostnet.ecadinfra.com/",
};

export const getRpcUrl = (networkType: SupportedNetworks): string => {
Expand All @@ -19,8 +19,8 @@ export const getTzKtUrl = (networkType: SupportedNetworks): string | undefined =
return "https://tzkt.io";
case NetworkType.GHOSTNET:
return "https://ghostnet.tzkt.io";
case NetworkType.NAIROBINET:
return "https://nairobinet.tzkt.io";
case NetworkType.OXFORDNET:
return "https://oxfordnet.tzkt.io";
case NetworkType.CUSTOM:
return undefined;
}
Expand All @@ -34,5 +34,5 @@ export const defaultNetworkType = NetworkType.GHOSTNET;
export const contractAddress = {
mainnet: "KT1ShtH2zCrKMuWGRejEd6RAcnePwxBQeMAN",
ghostnet: "KT1QKmcNBcfzVTXG2kBcE6XqXtEuYYUzMcT5",
nairobinet: "KT1WoyF3wpUGRm6fbmmm1qKmpfneq1iijMT8"
oxfordnet: "KT1GYx1KDhMQt2GJEztRh8EyYxJUPM6fnAMM",
};
9 changes: 9 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,22 @@
"octez",
"opkind",
"originations",
"oxfordbox",
"oxfordnet",
"oxheadalpha",
"Pkhfrom",
"preattestation",
"precommit",
"preendorsement",
"preendorsements",
"prevalidated",
"prevalidation",
"println",
"Protofire",
"ProxfordY",
"PtNairobi",
"refetched",
"riscv",
"rollups",
"Roxane",
"SAPLINGCONTRACT",
Expand All @@ -94,6 +101,7 @@
"taquito",
"tcli",
"testbox",
"testchain",
"tezbridge",
"tezos",
"Thanos",
Expand All @@ -109,6 +117,7 @@
"Unparsing",
"vals",
"walletbeacon",
"weeklynet",
"ZARITH"
],
"files": [
Expand Down
20 changes: 10 additions & 10 deletions docs/complex_parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ storage (pair
(map %validators nat address));
```

In this example, we originate the contract with initial values in the storage. We use the `MichelsonMap` class' of Taquito to initialize [the maps and the bigMap](https://tezostaquito.io/docs/maps_bigmaps).
In this example, we originate the contract with initial values in the storage. We use the `MichelsonMap` class' of Taquito to initialize [the maps and the bigMap](https://tezostaquito.io/docs/maps_bigmaps).

As described above, the `map %data` uses a value that we chose between different types. When using Taquito, we need to surround the chosen argument with curly braces. In the current example, we initialize the value in the `map %data` to the boolean true: `{ bool: true }`.

Expand All @@ -59,7 +59,7 @@ const dataMap = new MichelsonMap();
//key is a string, we choose a boolean for the value
dataMap.set('Hello', { bool : true })

//%records
//%records
const recordsBigMap = new MichelsonMap();
recordsBigMap.set(
'FFFF', //key of the bigMap %records is in bytes
Expand Down Expand Up @@ -89,7 +89,7 @@ importKey(Tezos, secretKey)
code : contractJson,
storage : {
owner : 'tz1PgQt52JMirBUhhkq1eanX8hVd1Fsg71Lr', //address
records: recordsBigMap,
records: recordsBigMap,
validators : validatorsMap
}})
}).then((contractOriginated) => {
Expand All @@ -102,7 +102,7 @@ importKey(Tezos, secretKey)

## Calling the function of a contract having a complex object as a parameter

The contract contains a function named `set_child_record`. The parameter of the function is composed of nested pairs regrouping different datatypes (address, `map`, `bytes` and `nat`). Two of its arguments, the `address %address` and the `nat %ttl`, are optional. The `map %data` uses a `string` as its key. The user needs to choose the value of the `map` between different proposed types.
The contract contains a function named `set_child_record`. The parameter of the function is composed of nested pairs regrouping different datatypes (address, `map`, `bytes` and `nat`). Two of its arguments, the `address %address` and the `nat %ttl`, are optional. The `map %data` uses a `string` as its key. The user needs to choose the value of the `map` between different proposed types.

Here is the parameter of the function defined in Michelson :

Expand Down Expand Up @@ -138,7 +138,7 @@ importKey(Tezos, secretKey)
}).then(myContract => {
const dataMap = new MichelsonMap();
dataMap.set("Hello World", { bool : true })
let inspect = myContract.methods.set_child_record('tz1PgQt52JMirBUhhkq1eanX8hVd1Fsg71Lr', dataMap, 'EEEE', 'tz1PgQt52JMirBUhhkq1eanX8hVd1Fsg71Lr', 'FFFF', '10').toTransferParams();
let inspect = myContract.methods.set_child_record('tz1PgQt52JMirBUhhkq1eanX8hVd1Fsg71Lr', dataMap, 'EEEE', 'tz1PgQt52JMirBUhhkq1eanX8hVd1Fsg71Lr', 'FFFF', '10').toTransferParams();
println(JSON.stringify(inspect, null, 2))
}).catch(error => println(`Error: ${JSON.stringify(error, null, 2)}`));
```
Expand All @@ -156,15 +156,15 @@ importKey(Tezos, secretKey)
}).then(myContract => {
const dataMap = new MichelsonMap();
dataMap.set("Hello World", { bool : true })

return myContract.methods.set_child_record(
'tz1PgQt52JMirBUhhkq1eanX8hVd1Fsg71Lr', //address(optional)
dataMap, //data
'EEEE', //label
'tz1PgQt52JMirBUhhkq1eanX8hVd1Fsg71Lr', //owner
'FFFF', //parent
'10' //ttl(optional)
).send();
).send();
}).then(op => {
println(`Waiting for ${op.hash} to be confirmed...`);
return op.confirmation(1).then(() => op.hash);
Expand All @@ -178,7 +178,7 @@ The `address %address` and the `nat %ttl` of the `set_child_record` function are

```js live noInline
// import { TezosToolkit, MichelsonMap } from '@taquito/taquito';
// const Tezos = new TezosToolkit('https://jakartanet.ecadinfra.com')
// const Tezos = new TezosToolkit('https://ghostnet.ecadinfra.com')
// import { importKey } from '@taquito/signer';

importKey(Tezos, secretKey)
Expand All @@ -187,15 +187,15 @@ importKey(Tezos, secretKey)
}).then(myContract => {
const dataMap = new MichelsonMap();
dataMap.set("Hello World", { nat : '3' })

return myContract.methods.set_child_record(
null, //address(optional)
dataMap, //data
'EEEE', //label
'tz1PgQt52JMirBUhhkq1eanX8hVd1Fsg71Lr', //owner
'FFFF', //parent
undefined //ttl(optional)
).send();
).send();
}).then(op => {
println(`Waiting for ${op.hash} to be confirmed...`);
return op.confirmation(1).then(() => op.hash);
Expand Down
2 changes: 1 addition & 1 deletion docs/consensus_key.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Consensus Keys
author: Davis Sawali & Hui-An Yang
---

The "consensus key" feature allows bakers to use a different key, called the consensus key. It will allow for baking and signing consensus operations (i.e. pre-endorsements and endorsements). For more detailed information on consensus keys, refer to [this documentation](https://tezos.gitlab.io/protocols/015_lima.html?highlight=update%20consensus%20key#consensus-key)
The "consensus key" feature allows bakers to use a different key, called the consensus key. It will allow for baking and signing consensus operations (i.e. preattestation/preendorsements and attestation/endorsements). For more detailed information on consensus keys, refer to [this documentation](https://tezos.gitlab.io/protocols/015_lima.html?highlight=update%20consensus%20key#consensus-key)

Starting from Lima protocol, these 2 new operations will be available:

Expand Down
4 changes: 2 additions & 2 deletions docs/drain_account.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ In the following example, we have not revealed the account that we want to empty
:::

```js live noInline
// const Tezos = new TezosToolkit('https://jakartanet.ecadinfra.com');
// const Tezos = new TezosToolkit('https://ghostnet.ecadinfra.com');
// import { DEFAULT_FEE } from "@taquito/taquito";

Tezos.signer
Expand Down Expand Up @@ -87,7 +87,7 @@ The contract we originate is a `manager contract.` It has a `do` method taking a
In the example, we estimate the transfer operation before doing it. The associated fees are deducted from the manager's address when draining the account. Thus, for the operation to be successful, the manager's address for that account must contain funds to cover the gas.

```js live noInline
// const Tezos = new TezosToolkit('https://jakartanet.ecadinfra.com');
// const Tezos = new TezosToolkit('https://ghostnet.ecadinfra.com');

function transferImplicit(key, mutez) {
return [
Expand Down
Loading
Loading