Skip to content

Commit

Permalink
Add configuration for running integration tests against Oxfordnet
Browse files Browse the repository at this point in the history
  • Loading branch information
danielelisi committed Aug 30, 2023
1 parent 3c3687c commit f2972ab
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ jobs:
include:
- testnet: nairobinet
testnet_uppercase: NAIROBINET
- testnet: oxfordnet
testnet_uppercase: OXFORDNET
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand Down Expand Up @@ -128,4 +130,4 @@ jobs:
TEZOS_RPC_${{ matrix.testnet_uppercase }}: http://localhost:20000
POLLING_INTERVAL_MILLISECONDS: 100
RPC_CACHE_MILLISECONDS: 0
TEZOS_BAKER: tz1VSUr8wwNhLAzempoch5d6hLRiTh8Cjcjb
TEZOS_BAKER: tz1VSUr8wwNhLAzempoch5d6hLRiTh8Cjcjb
37 changes: 37 additions & 0 deletions integration-tests/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { RpcClient, RpcClientCache } from '@taquito/rpc';
import { knownBigMapContractProtoALph, knownContractProtoALph, knownOnChainViewContractAddressProtoALph, knownSaplingContractProtoALph, knownTzip12BigMapOffChainContractProtoALph } from './known-contracts-ProtoALph';
import { knownContractPtGhostnet, knownBigMapContractPtGhostnet, knownTzip12BigMapOffChainContractPtGhostnet, knownSaplingContractPtGhostnet, knownOnChainViewContractAddressPtGhostnet } from './known-contracts-PtGhostnet';
import { knownContractPtNairobi, knownBigMapContractPtNairobi, knownTzip12BigMapOffChainContractPtNairobi, knownSaplingContractPtNairobi, knownOnChainViewContractAddressPtNairobi } from './known-contracts-PtNairobi';
import { knownContractProxford, knownBigMapContractProxford, knownTzip12BigMapOffChainContractProxford, knownSaplingContractProxford, knownOnChainViewContractAddressProxford } from './known-contracts-Proxford';

const nodeCrypto = require('crypto');

Expand Down Expand Up @@ -94,6 +95,24 @@ const nairobinetEphemeral = {
},
};

const oxfordnetEphemeral = {
rpc: process.env['TEZOS_RPC_OXFORDNET'] || 'http://ecad-oxfordnet-full.i.tez.ie:8732',
pollingIntervalMilliseconds: process.env['POLLING_INTERVAL_MILLISECONDS'] || undefined,
rpcCacheMilliseconds: process.env['RPC_CACHE_MILLISECONDS'] || '1000',
knownBaker: process.env['TEZOS_BAKER'] || 'tz1cjyja1TU6fiyiFav3mFAdnDsCReJ12hPD',
knownContract: process.env['TEZOS_OXFORDNET_CONTRACT_ADDRESS'] || knownContractProxford,
knownBigMapContract: process.env['TEZOS_OXFORDNET_BIGMAPCONTRACT_ADDRESS'] || knownBigMapContractProxford,
knownTzip1216Contract: process.env['TEZOS_OXFORDNET_TZIP1216CONTRACT_ADDRESS'] || knownTzip12BigMapOffChainContractProxford,
knownSaplingContract: process.env['TEZOS_OXFORDNET_SAPLINGCONTRACT_ADDRESS'] || knownSaplingContractProxford,
knownViewContract: process.env['TEZOS_OXFORDNET_ON_CHAIN_VIEW_CONTRACT'] || knownOnChainViewContractAddressProxford,
protocol: Protocols.Proxford,
signerConfig: {
type: SignerType.EPHEMERAL_KEY as SignerType.EPHEMERAL_KEY,
keyUrl: 'https://keygen.ecadinfra.com/oxfordnet',
requestHeaders: { Authorization: 'Bearer taquito-example' },
},
};

const ghostnetEphemeral = {
rpc: process.env['TEZOS_RPC_GHOSTNET'] || 'ecad-ghostnet-rolling:8732',
pollingIntervalMilliseconds: process.env['POLLING_INTERVAL_MILLISECONDS'] || undefined,
Expand Down Expand Up @@ -145,6 +164,20 @@ const nairobinetSecretKey = {
signerConfig: defaultSecretKey
};

const oxfordnetSecretKey = {
rpc: process.env['TEZOS_RPC_OXFORDNET'] || 'http://ecad-oxfordnet-full:8732',
pollingIntervalMilliseconds: process.env['POLLING_INTERVAL_MILLISECONDS'] || undefined,
rpcCacheMilliseconds: process.env['RPC_CACHE_MILLISECONDS'] || '1000',
knownBaker: process.env['TEZOS_BAKER'] || 'tz1cjyja1TU6fiyiFav3mFAdnDsCReJ12hPD',
knownContract: process.env['TEZOS_OXFORDNET_CONTRACT_ADDRESS'] || knownContractProxford,
knownBigMapContract: process.env['TEZOS_OXFORDNET_BIGMAPCONTRACT_ADDRESS'] || knownBigMapContractProxford,
knownTzip1216Contract: process.env['TEZOS_OXFORDNET_TZIP1216CONTRACT_ADDRESS'] || knownTzip12BigMapOffChainContractProxford,
knownSaplingContract: process.env['TEZOS_OXFORDNET_SAPLINGCONTRACT_ADDRESS'] || knownSaplingContractProxford,
knownViewContract: process.env['TEZOS_OXFORDNET_ON_CHAIN_VIEW_CONTRACT'] || knownOnChainViewContractAddressProxford,
protocol: Protocols.Proxford,
signerConfig: defaultSecretKey
};

const ghostnetSecretKey = {
rpc: process.env['TEZOS_RPC_GHOSTNET'] || 'http://ecad-ghostnet-rolling:8732',
pollingIntervalMilliseconds: process.env['POLLING_INTERVAL_MILLISECONDS'] || undefined,
Expand Down Expand Up @@ -179,12 +212,16 @@ if (process.env['RUN_WITH_SECRET_KEY']) {
providers.push(nairobinetSecretKey);
} else if (process.env['RUN_NAIROBINET_WITH_SECRET_KEY']) {
providers.push(nairobinetSecretKey);
} else if (process.env['RUN_OXFORDNET_WITH_SECRET_KEY']) {
providers.push(oxfordnetSecretKey);
} else if (process.env['RUN_GHOSTNET_WITH_SECRET_KEY']) {
providers.push(ghostnetSecretKey);
} else if (process.env['RUN_MONDAYNET_WITH_SECRET_KEY']) {
providers.push(mondaynetSecretKey);
} else if (process.env['NAIROBINET']) {
providers.push(nairobinetEphemeral);
} else if (process.env['OXFORDNET']) {
providers.push(oxfordnetEphemeral);
} else if (process.env['GHOSTNET']) {
providers.push(ghostnetEphemeral);
} else if (process.env['MONDAYNET']) {
Expand Down
5 changes: 5 additions & 0 deletions integration-tests/known-contracts-Proxford.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export const knownContractProxford = "KT1TU9LydXWri8CBTQmzwnwjCm3dK8jt1LQA";
export const knownBigMapContractProxford = "KT1MYLamQavaVMYqgn9f4gMgHzEZfQD73qYs";
export const knownTzip12BigMapOffChainContractProxford = "KT1XX1JK4C7aPL2joE7nfeWRwPdrJYwroAUa";
export const knownSaplingContractProxford = "KT1MfFxdU3kpXMSmHZN4tYBbYkGRAbLt5Q1Y";
export const knownOnChainViewContractAddressProxford = "KT1TYMtN2yFQDmk82VFymQeZapp6BF1NsZ7B";
2 changes: 2 additions & 0 deletions integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"test:secret-key": "RUN_WITH_SECRET_KEY=true jest --runInBand",
"test:nairobinet": "NAIROBINET=true jest",
"test:nairobinet-secret-key": "RUN_NAIROBINET_WITH_SECRET_KEY=true jest --runInBand",
"test:oxfordnet": "OXFORDNET=true jest",
"test:oxfordnet-secret-key": "RUN_OXFORDNET_WITH_SECRET_KEY=true jest --runInBand",
"test:originate-known-contracts": "node -r ts-node/register originate-known-contracts.ts",
"originate-known-contracts-and-run-test": "node -r ts-node/register originate-known-contracts.ts && jest",
"test:mondaynet": "MONDAYNET=true jest",
Expand Down
4 changes: 3 additions & 1 deletion packages/taquito-local-forging/src/protocols.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export enum ProtocolsHash {
PtMumbaii = 'PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc',
PtMumbai2 = 'PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1',
PtNairobi = 'PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf',
Proxford = 'ProxfordSW2S7fvchT1Zgj2avb5UES194neRyYVXoaDGvF9egt8',
ProtoALpha = 'ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK',
}

Expand All @@ -35,7 +36,8 @@ const protoLevel: Record<ProtocolsHash, number> = {
PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc: 16,
PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1: 16,
PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf: 17,
ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK: 18,
ProxfordSW2S7fvchT1Zgj2avb5UES194neRyYVXoaDGvF9egt8: 18,
ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK: 19,
};

export function ProtoInferiorTo(a: ProtocolsHash, b: ProtocolsHash): boolean {
Expand Down
4 changes: 3 additions & 1 deletion packages/taquito-michel-codec/src/michelson-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ export enum Protocol {
PtMumbaii = 'PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc',
PtMumbai2 = 'PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1',
PtNairobi = 'PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf',
Proxford = 'ProxfordSW2S7fvchT1Zgj2avb5UES194neRyYVXoaDGvF9egt8',
ProtoALpha = 'ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK', // temporary protocol hash
}

Expand Down Expand Up @@ -434,7 +435,8 @@ const protoLevel: Record<ProtocolID, number> = {
PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc: 16,
PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1: 16,
PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf: 17,
ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK: 18,
ProxfordSW2S7fvchT1Zgj2avb5UES194neRyYVXoaDGvF9egt8: 18,
ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK: 19,
};

export function ProtoGreaterOrEqual(a: ProtocolID, b: ProtocolID): boolean {
Expand Down
5 changes: 4 additions & 1 deletion packages/taquito/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export enum Protocols {
PtMumbaii = 'PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc',
PtMumbai2 = 'PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1',
PtNairobi = 'PtNairobiyssHuh87hEhfVBGCVrK3WnS8Z2FT4ymB5tAa4r1nQf',
Proxford = 'ProxfordSW2S7fvchT1Zgj2avb5UES194neRyYVXoaDGvF9egt8',
ProtoALpha = 'ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK',
}

Expand All @@ -64,7 +65,8 @@ export const protocols = {
'015': [Protocols.PtLimaPtL],
'016': [Protocols.PtMumbai2], // mumbai v2
'017': [Protocols.PtNairobi],
'018': [Protocols.ProtoALpha],
'018': [Protocols.Proxford],
'019': [Protocols.ProtoALpha],
};

export enum ChainIds {
Expand All @@ -83,6 +85,7 @@ export enum ChainIds {
MUMBAINET = 'NetXQw6nWSnrJ5t',
MUMBAINET2 = 'NetXgbcrNtXD2yA',
NAIROBINET = 'NetXyuzvDo2Ugzb',
OXFORDNET = 'NetXH6zDyMzRsUy',
}

export const getRevealGasLimit = (address: string) =>
Expand Down

0 comments on commit f2972ab

Please sign in to comment.