Skip to content

Commit

Permalink
Lima (#2113)
Browse files Browse the repository at this point in the history
* 2073 support type ticket deprecated in michelson encoder (#2094)

* feat: exposed setParserProvider configuration through TezosToolkit

re #660

* test: added integration tests using setParserProvider with TezosToolkit

re #660

* docs: updated starting production server commands with taquito-test-dapp readme.md

* test: removed unnecessory console.log

re #660

* chore: update vite to latest version

* docs: fixed some typos in doc to address comments

re #660

* 1630 ballot operation support in contract API (#2050)

* added estimate and contract ballot operation support

* added rpc contract provider for ballot op

* updated implementation and added docs

* added property in OperationContentsAndResultBallot and added unit test

* remove metadata property from ballot

* addressed PR comments

* updated yarn and package-lock

* cleaned up comments and switched out async for promise in op emitter

* removed unnecessary line break

* 660 support customize parser options (#2061)

* feat: exposed setParserProvider configuration through TezosToolkit

re #660

* test: added integration tests using setParserProvider with TezosToolkit

re #660

* docs: updated starting production server commands with taquito-test-dapp readme.md

* test: removed unnecessory console.log

re #660

* chore: update vite to latest version

* docs: fixed some typos in doc to address comments

re #660

* feat(n): support type ticket_deprecated in michelson encoder

re #2073

* contract-security-non-existent-KT-address: use rpc (#2091)

* fix: address comment with TicketDeprecatedEncodeError and fix unit tests

fix #2073

Co-authored-by: Davis Sawali <davis.sawali@ecadlabs.com>
Co-authored-by: Arvid Jakobsson <arvid.jakobsson@nomadic-labs.com>
Co-authored-by: Roxane Létourneau <65877347+roxaneletourneau@users.noreply.github.com>

* Deprecate Tezbridge (#2105)

* 1630 ballot operation support in contract API (#2050)

* added estimate and contract ballot operation support

* added rpc contract provider for ballot op

* updated implementation and added docs

* added property in OperationContentsAndResultBallot and added unit test

* remove metadata property from ballot

* addressed PR comments

* updated yarn and package-lock

* cleaned up comments and switched out async for promise in op emitter

* removed unnecessary line break

* 660 support customize parser options (#2061)

* feat: exposed setParserProvider configuration through TezosToolkit

re #660

* test: added integration tests using setParserProvider with TezosToolkit

re #660

* docs: updated starting production server commands with taquito-test-dapp readme.md

* test: removed unnecessory console.log

re #660

* chore: update vite to latest version

* docs: fixed some typos in doc to address comments

re #660

* refactor: deprecate tezbridge and related

* contract-security-non-existent-KT-address: use rpc (#2091)

* refactor: deprecate tezbridge and related

Co-authored-by: Davis Sawali <davis.sawali@ecadlabs.com>
Co-authored-by: hui-an-yang <106410553+hui-an-yang@users.noreply.github.com>
Co-authored-by: Arvid Jakobsson <arvid.jakobsson@nomadic-labs.com>
Co-authored-by: Roxane Létourneau <65877347+roxaneletourneau@users.noreply.github.com>

* 2064 lima integration remove jakarta (#2084)

* 1630 ballot operation support in contract API (#2050)

* added estimate and contract ballot operation support

* added rpc contract provider for ballot op

* updated implementation and added docs

* added property in OperationContentsAndResultBallot and added unit test

* remove metadata property from ballot

* addressed PR comments

* updated yarn and package-lock

* cleaned up comments and switched out async for promise in op emitter

* removed unnecessary line break

* 660 support customize parser options (#2061)

* feat: exposed setParserProvider configuration through TezosToolkit

re #660

* test: added integration tests using setParserProvider with TezosToolkit

re #660

* docs: updated starting production server commands with taquito-test-dapp readme.md

* test: removed unnecessory console.log

re #660

* chore: update vite to latest version

* docs: fixed some typos in doc to address comments

re #660

* initial changes, check chainids

adjust config, run originate contracts

 add untracked

fix improper config data

switch jakarta tests, switch rpc endpoint

fix missed jakartanet

adjust constants lima, estimate test values

fix broken value

* change test protocol runs

Co-authored-by: Davis Sawali <davis.sawali@ecadlabs.com>
Co-authored-by: hui-an-yang <106410553+hui-an-yang@users.noreply.github.com>
Co-authored-by: Zainen Suzuki <zainensuzuki@Zainens-MacBook-Pro.local>

* 2069 type changes (#2114)

* updated types for lima

* update constants.ts with protocol hash for lima

* updated unit tests

* changed test name for clarity

* addressed PR comments

* 2066 support types for new operations in lima (#2097)

* feat: support new types for new operations UpdateConsensusKey and DrainDelegate in Lima

re #2066

* test: update_consensus_key unit test added for limanet

re #2066

* test: added drain_deleagte unit test for limanet

re #2066

* test: minor fix rpc-response data and updateConsensusKey unit test

re #2066

* test: addressed comments to update correct test title

re #2066

* Replace lima rpc url in test

* added new rpc endpoints and updated tests (#2148)

* added new rpc endpoints and updated tests

* updated unit tests

* updated unit test for rpc-cache

* updated typedoc and updated test to originate own contract

* 2065 local forging support new operations for lima 2 (#2139)

* feat: support new types for new operations UpdateConsensusKey and DrainDelegate in Lima

re #2066

* test: update_consensus_key unit test added for limanet

re #2066

* feat: support new operation UpdateConsensusKey for Lima

re #2065

* feat: support new operation updateConsensusKey in local-forger for Lima

re #2065

* revert: removed unnecesorry change of updateConsensusKey in rpc-batch-provider

re #2065

* revert: changes of update_consensus_key in RpcContractProvider and RPCEstimateProvider

re #2065

* feat: support new operation drainDelegate for Lima

re #2065

* feat: support new encoding for ticket & ticket depreacted in lima with tests

re #2072

* fix: added ASSERT_SOME in ticketCode and fixed 2 integration tests in lima

re #2072

* fix: fixs merge conflicts

* fix: replaced ASSERT_SOME with its expansion in ticketCode

re #2072

* test: added local-forgin integration tests for new operations

re #2065

* fix: address comments removed duplicate tests and move kathcases to commoncases

re #2065

* fix: address comments to remove kathcases integration tests

re #2065

* test: address comments add forge and parse operation test suite back with lima cases

re #2065

* test: addressing comments updated file name and added simicolons

re #2065

* test: address comments added semicolon

re #2065

* fix: configure localforger with lima protocol hash with lima cases

re #2065

* fix: removed update_consensus_key & drain_delegate from encodersProto14 and decoderProto14

re #2065

* feat: removed Jakarta conditions in on chain view related files (#2138)

re #2098

* fix(local-forging): fix encoding for deposit entrypoint (#2160)

* fix(local-forging): fix encoding for deposit entrypoint

In lima protocol, the %deposit entrypoint is now represented by 0x05

fix #2158

* Fix unit tests

* Fix tests kathmandunet

* 2071 lima rpc changes (#2095)

* initial changes, check chainids

adjust config, run originate contracts

 add untracked

fix improper config data

switch jakarta tests, switch rpc endpoint

fix missed jakartanet

adjust constants lima, estimate test values

fix broken value

fix constants test add minimum_stake to replace tokens_per_roll

fix ticket_token type

fix constants expects

correct ticket updates type, todo add test

corrections, add proto015 mock data

add sample && unit test for ticket_updates

* resolve error for test

* fix tests improper values

* pr comments so far

* update tests for all testnets

* missed test cahnge

* remove yarn lock, fix missed spot

* remove quotes

* initial changes, check chainids

adjust config, run originate contracts

 add untracked

fix improper config data

switch jakarta tests, switch rpc endpoint

fix missed jakartanet

adjust constants lima, estimate test values

fix broken value

fix constants test add minimum_stake to replace tokens_per_roll

fix ticket_token type

fix constants expects

correct ticket updates type, todo add test

corrections, add proto015 mock data

add sample && unit test for ticket_updates

resolve error for test

fix tests improper values

pr comments so far

update tests for all testnets

missed test cahnge

remove yarn lock, fix missed spot

remove quotes

pr comments

* fix ticket_receipt

* remove duplication after mondaynet removal from tx-rollup test

* fix rebase change

Co-authored-by: Zainen Suzuki <zainensuzuki@Zainens-MacBook-Pro.local>
Co-authored-by: Zainen Suzuki <zainensuzuki@pop-os.localdomain>

* fix(integration-tests): fix tests for lima

* test(integration-test): fix contract-tx-rollup-origination-operation test for flextesa

Bump storage_limit because the constant tx_rollup_origination_size is set to an higher value on
flextesa than on the testnets

* test(michel-codec): added lima contracts for unit tests

There is no code change in the branch. I removed the contracts related to protocols 10 to 13 and
added contracts for the protocol 15. Some contracts are commented out in the contract_015.spec.ts
file as they are currently failing. Those contracts should be uncommented and fixed when working on
the issue #2075.

re $2075

* 2074 local forging support new instruction lambda rec (#2159)

* test: added code_with_lambda_rec file and test against rpc forger

re #2074

* fix: added LAMBDA_REC condition padding in primEncoder and primDecoder

re #2074

* style: linted lambdaRecCode

re #2074

* test(integration-test): lambda_rec

Deploy a contract written in plain michelson that contains the LAMBDA_REC instruction (test
michel-codec and local-forging support of LAMBDA_REC inst). Call a contract having the type lambda
in its entrypoint by passing a recursive lambda (test michelson-encoder package and local-forging
package).

* test(integration-test): fixed tx-rollup-l2-address test for limanet (#2171)

* test(integration-test): fixed tx-rollup-l2-address test for limanet

For the lima protocol, the instruction TICKET needs to be followed by ASSERT_SOME

fix #2170

* Removed console.log

* fix(rpc): add missing properties related to lima

fix #2172

* add tests for parsing mode for all testnets, and fail case (#2184)

* add tests for parsing mode for all testnets, and fail case

* one more test fail

* format

Co-authored-by: Zainen Suzuki <zainensuzuki@Zainens-MacBook-Pro.local>

* test(integration-test): small clean up and remove duplication

* 2075 lambda rec michel codec (#2175)

* parent 8922de6
author Zainen Suzuki <zainensuzuki@Zainens-MacBook-Pro.local> 1666748308 -0700
committer Zainen Suzuki <zainensuzuki@Zainens-MacBook-Pro.local> 1670007819 -0800

initial changes, check chainids

adjust config, run originate contracts

 add untracked

fix improper config data

switch jakarta tests, switch rpc endpoint

fix missed jakartanet

adjust constants lima, estimate test values

fix broken value

fix constants test add minimum_stake to replace tokens_per_roll

fix ticket_token type

fix constants expects

correct ticket updates type, todo add test

corrections, add proto015 mock data

add sample && unit test for ticket_updates

fix tests improper values

update tests for all testnets

missed test cahnge

initial work retstack still broken

passing without validation

add other contract

add contracts and setup

comment out

all test passing. binanry.spec.ts failing values

fix binary array sensitive order

remove unneeded

more cleanup

Lambda_rec michelsonData addition

remove duplicate

change to instructionlist

* feat(michel-codec): pack/unpack Lambda_rec data

fix #2181

* remove commented

Co-authored-by: Zainen Suzuki <zainensuzuki@Zainens-MacBook-Pro.local>
Co-authored-by: roxaneletourneau <roxane@ecadlabs.com>

* Try fix test

* Implemented update_consensus_key support in Contract API (#2179)

* Implemented update_consensus_key support in Contract API and updated tests

* addressed PR comments

* chore(releng) bump version to 15.0.0-beta-RC.0

* remove accidental push

* revert sidebar

* Consensus key docs (#2205)

* added updated_consensus_key op docs

* fixed typos in doc

* chore(releng) bump version to 15.0.0

Co-authored-by: hui-an-yang <106410553+hui-an-yang@users.noreply.github.com>
Co-authored-by: Davis Sawali <davis.sawali@ecadlabs.com>
Co-authored-by: Arvid Jakobsson <arvid.jakobsson@nomadic-labs.com>
Co-authored-by: Edward Garson <edward.garson@ecadlabs.com>
Co-authored-by: Zainen <72581075+zainen@users.noreply.github.com>
Co-authored-by: Zainen Suzuki <zainensuzuki@Zainens-MacBook-Pro.local>
Co-authored-by: Zainen Suzuki <zainensuzuki@pop-os.localdomain>
  • Loading branch information
8 people authored Dec 6, 2022
1 parent 9195e4f commit 3f711f1
Show file tree
Hide file tree
Showing 1,583 changed files with 9,379 additions and 67,974 deletions.
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
matrix:
protocol:
- kathmandunet
- limanet
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand Down
31 changes: 31 additions & 0 deletions .husky/_/husky.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh
if [ -z "$husky_skip_init" ]; then
debug () {
if [ "$HUSKY_DEBUG" = "1" ]; then
echo "husky (debug) - $1"
fi
}

readonly hook_name="$(basename "$0")"
debug "starting $hook_name..."

if [ "$HUSKY" = "0" ]; then
debug "HUSKY env variable is set to 0, skipping hook"
exit 0
fi

if [ -f ~/.huskyrc ]; then
debug "sourcing ~/.huskyrc"
. ~/.huskyrc
fi

export readonly husky_skip_init=1
sh -e "$0" "$@"
exitCode="$?"

if [ $exitCode != 0 ]; then
echo "husky - $hook_name hook exited with code $exitCode (error)"
fi

exit $exitCode
fi
8 changes: 4 additions & 4 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": "14.2.0",
"version": "15.0.0",
"type": "module",
"scripts": {
"dev": "vite",
Expand All @@ -25,9 +25,9 @@
},
"dependencies": {
"@airgap/beacon-sdk": "^3.3.0",
"@taquito/beacon-wallet": "*",
"@taquito/taquito": "*",
"@taquito/utils": "*",
"@taquito/beacon-wallet": "^15.0.0",
"@taquito/taquito": "^15.0.0",
"@taquito/utils": "^15.0.0",
"buffer": "^6.0.3",
"svelte-select": "^4.4.7",
"vite-compatible-readable-stream": "^3.6.1"
Expand Down
23 changes: 23 additions & 0 deletions docs/ballot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: Ballot Operation
id: ballot
author: Davis Sawali
---

The `Ballot` operation allows delegates to cast one `Yay`, `Nay`, or `Pass` ballot on a selected proposal. Delegates are only able to cast their votes during the **Exploration period** and the **Promotion period**

## Examples
The `Ballot` operation is currently available in the Contract API, and can be used as such:
```typescript
const op = await Tezos.contract.ballot({
proposal: 'PROPOSAL_HASH',
ballot: 'BALLOT_VOTE_STRING'
});

await op.confirmation();
```
- `proposal` is the proposal hash string that you (a delegate) would like to point your ballot towards. Information on the current proposal can be obtained by calling [this RPC endpoint](https://tezos.gitlab.io/alpha/rpc.html#get-block-id-votes-current-proposal). Alternatively, you could also get the proposal hash by using Taquito's RPC Client method `RpcClient.getCurrentProposal`. For more information on the `RpcClient` refer to [this document](https://tezostaquito.io/docs/rpc_package/)
- `ballot` is your ballot vote (`yay`, `nay`, or `pass`)


For more information in regards to the Amendment (and Voting) Process refer to [this document](https://tezos.gitlab.io/alpha/voting.html)
22 changes: 22 additions & 0 deletions docs/consensus_key.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: Consensus Keys
author: Davis Sawali
---

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)

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

## Update Consensus Key
This is a manager operation that must be signed by the manager key of the baker. This operation updates the consensus key of the baker to `PUBLIC_KEY` starting from the current cycle plus `PRESERVED_CYCLES + 1`. A consensus key can only be used by a single baker, the operation will fail otherwise.

### Examples
```typescript
const op = await Tezos.contract.updateConsensusKey({
pk: 'PUBLIC_KEY'
});

await op.confirmation();
```
- `pk` is the public key you want the consensus key to point to

49 changes: 5 additions & 44 deletions docs/wallet_API.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,16 @@ yarn add @taquito/taquito

Make sure you have the latest version (`7.1.0` when this article was written, but the API became available from `6.3.2-beta.0`).

Once the package is downloaded, you can install the wallet of your choice. The wallet API supports different kinds of wallets. _Beacon_, _Temple_ and _TezBridge_ (deprecated v13) wallets are available to use at the moment. You can install one or multiple wallets according to your needs:
Once the package is downloaded, you can install the wallet of your choice. The wallet API supports different kinds of wallets. The _Beacon_ and _Temple_ wallets are available to use at the moment. You can install one or both wallets, depending on your requirements:

```
npm install @taquito/tezbridge-wallet
npm install @taquito/beacon-wallet
npm install @temple-wallet/dapp
```

Remember that some wallets may require an extra step in addition to the package installation. For example, TezBridge (deprecated v13) requires a plugin file, Temple must be used with an extension installed in the browser. We will explain the requirements for the different wallets in detail in the sections below.
Remember that some wallets may require an extra step in addition to the package installation. For example, Temple must be used with an extension installed in the browser. We will explain the requirements for the different wallets in detail in the sections below.

## Connecting the wallet

Expand Down Expand Up @@ -132,7 +129,7 @@ Tezos.setWalletProvider(wallet);

### - Development wallets

During the development of your dapp, you may prefer a less "user-friendly" option that gives you more information and details than a more user-friendly wallet. You may also want to install and set up a wallet quickly that requires less boilerplate than the Beacon SDK. In these cases, you can choose between the Tezbridge wallet(deprecated v13) (for more details in a lightweight format) and the Temple Wallet (for a quick setup using the Temple wallet extension).
During the development of your dapp, you may prefer a less "user-friendly" option that gives you more information and details than a more user-friendly wallet. You may also want to install and set up a wallet quickly that requires less boilerplate than the Beacon SDK. In these cases, use the Temple Wallet (for a quick setup using the Temple wallet extension).

- Temple wallet

Expand Down Expand Up @@ -194,7 +191,7 @@ Tezos.setProvider({ wallet });

#### Try the Temple wallet!

Make sure you have the Temple browser extension installed first.
*Make sure you have the Temple browser extension installed first.*

```js
//import { TempleWallet } from '@temple-wallet/dapp';
Expand All @@ -214,45 +211,9 @@ TempleWallet.isAvailable()
.catch((err) => console.log(err));
```

- TezBridge wallet (deprecated v13)

> Note that the TezBridge wallet may not work correctly since the Delphi upgrade might be deprecated in the future.
First, we have to import the TezBridge wallet from the package:

```js
import { TezBridgeWallet } from '@taquito/tezbridge-wallet';
```

Next, we can set up the wallet. In general, you will give your dapp users the choice of the wallet they prefer, so the wallet initialization wouldn't happen when the dapp is mounted but after user's interaction, for example, after pressing a button. It is important to remember that you have to import the TezBridge class in your HTML file before setting up your wallet, or this will throw an error:

```js
<script src="https://www.tezbridge.com/plugin.js"></script>
```

To set up TezBridge as your wallet, you use the `setWalletProvider` method of the `Tezos` singleton instance and pass a new instance of the `TezBridgeWallet` class:

```js
Tezos.setWalletProvider(new TezBridgeWallet());
```

or

```js
Tezos.setProvider({ wallet: new TezBridgeWallet() });
```

Please note that you don't need to interact directly with the `tezbridge` object that the plugin injects in the `window` object. Taquito will take care of it. You can even get the user's address using the TezBridgeWallet instance like so:

```js
const wallet = new TezBridgeWallet();
Tezos.setWalletProvider(wallet);
const userAddress = await wallet.getPKH();
```

## Making transfers

Although it is possible to transfer tokens directly from the wallets, Taquito offers to send tokens programmatically. This method could be a better solution if you want to do calculations before sending the tokens or if the amount of tokens to send is based on a variable value. This could also be preferable to avoid manual inputs that can often be a source of errors. Using Taquito to send tokens only requires to sign a transaction, sit back and relax :)
Although it is possible to transfer tokens directly from the wallets, Taquito can send tokens *programmatically*. This method could be a better solution if you want to do calculations before sending the tokens, or if the amount of tokens to send is based on a variable value. It is also preferable to avoid manual inputs, which are often a source of errors. Using Taquito to send tokens only requires to sign a transaction, sit back and relax :)

### - Transfer between implicit accounts

Expand Down
22 changes: 11 additions & 11 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@taquito/example",
"private": true,
"version": "14.2.0",
"version": "15.0.0",
"scripts": {
"example": "node -r ts-node/register --preserve-symlinks example-node.ts",
"example:activation": "node -r ts-node/register --preserve-symlinks example-activate.ts",
Expand Down Expand Up @@ -41,16 +41,16 @@
},
"dependencies": {
"@ledgerhq/hw-transport-node-hid": "^6.27.3",
"@taquito/ledger-signer": "*",
"@taquito/local-forging": "*",
"@taquito/michel-codec": "*",
"@taquito/michelson-encoder": "*",
"@taquito/rpc": "*",
"@taquito/sapling": "*",
"@taquito/signer": "*",
"@taquito/taquito": "*",
"@taquito/tzip16": "*",
"@taquito/utils": "*",
"@taquito/ledger-signer": "^15.0.0",
"@taquito/local-forging": "^15.0.0",
"@taquito/michel-codec": "^15.0.0",
"@taquito/michelson-encoder": "^15.0.0",
"@taquito/rpc": "^15.0.0",
"@taquito/sapling": "^15.0.0",
"@taquito/signer": "^15.0.0",
"@taquito/taquito": "^15.0.0",
"@taquito/tzip16": "^15.0.0",
"@taquito/utils": "^15.0.0",
"bignumber.js": "^9.1.0"
},
"devDependencies": {
Expand Down
67 changes: 34 additions & 33 deletions integration-tests/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { importKey, InMemorySigner } from '@taquito/signer';
import { RpcClient, RpcClientCache } from '@taquito/rpc';
import { knownBigMapContractProtoALph, knownContractProtoALph, knownOnChainViewContractAddressProtoALph, knownSaplingContractProtoALph, knownTzip12BigMapOffChainContractProtoALph, txRollupAddressProtoALph } from './known-contracts-ProtoALph';
import { knownContractPtKathman, knownBigMapContractPtKathman, knownTzip12BigMapOffChainContractPtKathman, knownSaplingContractPtKathman, knownOnChainViewContractAddressPtKathman, txRollupAddressPtKathman } from './known-contracts-PtKathman';
import { knownContractPtJakart2, knownBigMapContractPtJakart2, knownTzip12BigMapOffChainContractPtJakart2, knownSaplingContractPtJakart2, knownOnChainViewContractAddressPtJakart2, txRollupAddressPtJakart2 } from './known-contracts-PtJakart2';
import { knownContractPtLimaPtL, knownBigMapContractPtLimaPtL, knownTzip12BigMapOffChainContractPtLimaPtL, knownSaplingContractPtLimaPtL, knownOnChainViewContractAddressPtLimaPtL, txRollupAddressPtLimaPtL } from './known-contracts-PtLimaPtL';

const nodeCrypto = require('crypto');

Expand Down Expand Up @@ -91,32 +91,33 @@ const kathmandunetEphemeral = {
protocol: Protocols.PtKathman,
signerConfig: {
type: SignerType.EPHEMERAL_KEY as SignerType.EPHEMERAL_KEY,
keyUrl: 'https://api.tez.ie/keys/kathmandunet',
keyUrl: 'http://key-gen-1.i.tez.ie:3000/kathmandunet',
requestHeaders: { Authorization: 'Bearer taquito-example' },
}
};

const jakartanetEphemeral = {
rpc: process.env['TEZOS_RPC_JAKARTANET'] || 'https://jakartanet-archive.ecadinfra.com',
const limanetEphemeral = {
rpc: process.env['TEZOS_RPC_LIMANET'] || 'http://ecad-limanet-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_JAKARTANET_CONTRACT_ADDRESS'] || knownContractPtJakart2,
knownBigMapContract: process.env['TEZOS_JAKARTANET_BIGMAPCONTRACT_ADDRESS'] || knownBigMapContractPtJakart2,
knownTzip1216Contract: process.env['TEZOS_JAKARTANET_TZIP1216CONTRACT_ADDRESS'] || knownTzip12BigMapOffChainContractPtJakart2,
knownSaplingContract: process.env['TEZOS_JAKARTANET_SAPLINGCONTRACT_ADDRESS'] || knownSaplingContractPtJakart2,
txRollupWithdrawContract: process.env['TEZOS_JAKARTANET_TX_ROLLUP_WITHDRAW_CONTRACT'] || '',
txRollupDepositContract: process.env['TEZOS_JAKARTANET_TX_ROLLUP_DEPOSIT_CONTRACT'] || '',
knownViewContract: process.env['TEZOS_JAKARTANET_ON_CHAIN_VIEW_CONTRACT'] || knownOnChainViewContractAddressPtJakart2,
txRollupAddress: process.env['TEZOS_JAKARTANET_TXROLLUP_ADDRESS'] || txRollupAddressPtJakart2,
protocol: Protocols.PtJakart2,
knownContract: process.env['TEZOS_LIMANET_CONTRACT_ADDRESS'] || knownContractPtLimaPtL,
knownBigMapContract: process.env['TEZOS_LIMANET_BIGMAPCONTRACT_ADDRESS'] || knownBigMapContractPtLimaPtL,
knownTzip1216Contract: process.env['TEZOS_LIMANET_TZIP1216CONTRACT_ADDRESS'] || knownTzip12BigMapOffChainContractPtLimaPtL,
knownSaplingContract: process.env['TEZOS_LIMANET_SAPLINGCONTRACT_ADDRESS'] || knownSaplingContractPtLimaPtL,
txRollupWithdrawContract: process.env['TEZOS_LIMANET_TX_ROLLUP_WITHDRAW_CONTRACT'] || '',
txRollupDepositContract: process.env['TEZOS_LIMANET_TX_ROLLUP_DEPOSIT_CONTRACT'] || '',
knownViewContract: process.env['TEZOS_LIMANET_ON_CHAIN_VIEW_CONTRACT'] || knownOnChainViewContractAddressPtLimaPtL,
txRollupAddress: process.env['TEZOS_LIMANET_TXROLLUP_ADDRESS'] || txRollupAddressPtLimaPtL,
protocol: Protocols.PtLimaPtL,
signerConfig: {
type: SignerType.EPHEMERAL_KEY as SignerType.EPHEMERAL_KEY,
keyUrl: 'https://api.tez.ie/keys/jakartanet',
keyUrl: 'http://key-gen-1.i.tez.ie:3000/limanet',
requestHeaders: { Authorization: 'Bearer taquito-example' },
},
};


const mondaynetEphemeral = {
rpc: process.env['TEZOS_RPC_MONDAYNET'] || 'http://mondaynet.ecadinfra.com:8732',
pollingIntervalMilliseconds: process.env['POLLING_INTERVAL_MILLISECONDS'] || undefined,
Expand Down Expand Up @@ -155,20 +156,20 @@ const kathmandunetSecretKey = {
signerConfig: defaultSecretKey,
};

const jakartanetSecretKey = {
rpc: process.env['TEZOS_RPC_JAKARTANET'] || 'https://jakartanet-archive.ecadinfra.com',
const limanetSecretKey = {
rpc: process.env['TEZOS_RPC_LIMANET'] || 'http://ecad-limanet-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_JAKARTANET_CONTRACT_ADDRESS'] || knownContractPtJakart2,
knownBigMapContract: process.env['TEZOS_JAKARTANET_BIGMAPCONTRACT_ADDRESS'] || knownBigMapContractPtJakart2,
knownTzip1216Contract: process.env['TEZOS_JAKARTANET_TZIP1216CONTRACT_ADDRESS'] || knownTzip12BigMapOffChainContractPtJakart2,
knownSaplingContract: process.env['TEZOS_JAKARTANET_SAPLINGCONTRACT_ADDRESS'] || knownSaplingContractPtJakart2,
txRollupWithdrawContract: process.env['TEZOS_JAKARTANET_TX_ROLLUP_WITHDRAW_CONTRACT'] || '',
txRollupDepositContract: process.env['TEZOS_JAKARTANET_TX_ROLLUP_DEPOSIT_CONTRACT'] || '',
knownViewContract: process.env['TEZOS_JAKARTANET_ON_CHAIN_VIEW_CONTRACT'] || knownOnChainViewContractAddressPtJakart2,
txRollupAddress: process.env['TEZOS_JAKARTANET_TXROLLUP_ADDRESS'] || txRollupAddressPtJakart2,
protocol: Protocols.PtJakart2,
knownContract: process.env['TEZOS_LIMANET_CONTRACT_ADDRESS'] || knownContractPtLimaPtL,
knownBigMapContract: process.env['TEZOS_LIMANET_BIGMAPCONTRACT_ADDRESS'] || knownBigMapContractPtLimaPtL,
knownTzip1216Contract: process.env['TEZOS_LIMANET_TZIP1216CONTRACT_ADDRESS'] || knownTzip12BigMapOffChainContractPtLimaPtL,
knownSaplingContract: process.env['TEZOS_LIMANET_SAPLINGCONTRACT_ADDRESS'] || knownSaplingContractPtLimaPtL,
txRollupWithdrawContract: process.env['TEZOS_LIMANET_TX_ROLLUP_WITHDRAW_CONTRACT'] || '',
txRollupDepositContract: process.env['TEZOS_LIMANET_TX_ROLLUP_DEPOSIT_CONTRACT'] || '',
knownViewContract: process.env['TEZOS_LIMANET_ON_CHAIN_VIEW_CONTRACT'] || knownOnChainViewContractAddressPtLimaPtL,
txRollupAddress: process.env['TEZOS_LIMANET_TXROLLUP_ADDRESS'] || txRollupAddressPtLimaPtL,
protocol: Protocols.PtLimaPtL,
signerConfig: defaultSecretKey
};

Expand All @@ -192,21 +193,21 @@ const mondaynetSecretKey = {
const providers: Config[] = [];

if (process.env['RUN_WITH_SECRET_KEY']) {
providers.push(jakartanetSecretKey, kathmandunetSecretKey);
} else if (process.env['RUN_JAKARTANET_WITH_SECRET_KEY']) {
providers.push(jakartanetSecretKey);
providers.push(limanetSecretKey, kathmandunetSecretKey);
} else if (process.env['RUN_LIMANET_WITH_SECRET_KEY']) {
providers.push(limanetSecretKey);
} else if (process.env['RUN_KATHMANDUNET_WITH_SECRET_KEY']) {
providers.push(kathmandunetSecretKey);
} else if (process.env['RUN_MONDAYNET_WITH_SECRET_KEY']) {
providers.push(mondaynetSecretKey);
} else if (process.env['JAKARTANET']) {
providers.push(jakartanetEphemeral);
} else if (process.env['KATHMANDUNET']) {
providers.push(kathmandunetEphemeral);
} else if (process.env['LIMANET']) {
providers.push(limanetEphemeral);
} else if (process.env['MONDAYNET']) {
providers.push(mondaynetEphemeral);
} else {
providers.push(jakartanetEphemeral, kathmandunetEphemeral);
providers.push(limanetEphemeral, kathmandunetEphemeral);
}

const setupForger = (Tezos: TezosToolkit, forger: ForgerType): void => {
Expand Down Expand Up @@ -250,7 +251,7 @@ const setupSignerWithEphemeralKey = async (
const httpClient = new HttpBackend();

try {
const { id, pkh } = await httpClient.createRequest({
const { id, pkh } = await httpClient.createRequest<{ id: string; pkh: string }>({
url: ephemeralUrl,
method: 'POST',
headers: requestHeaders,
Expand Down Expand Up @@ -352,4 +353,4 @@ export const CONFIGS = () => {
);
return [...prev, ...configs];
}, [] as ConfigWithSetup[]);
};
};
2 changes: 1 addition & 1 deletion integration-tests/contract-call-with-xtz-amount.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ CONFIGS().forEach(({ lib, rpc, setup }) => {

describe(`Test contract call with amount using: ${rpc}`, () => {
beforeEach(async (done) => {
await setup();
await setup(true);
done();
});

Expand Down
Loading

0 comments on commit 3f711f1

Please sign in to comment.