Skip to content

Commit

Permalink
test: removed more tx rollup references in integration tests and some…
Browse files Browse the repository at this point in the history
… styles and doc update

re #2270
  • Loading branch information
hui-an-yang committed Feb 9, 2023
1 parent 0bc5707 commit 3233200
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 98 deletions.
64 changes: 0 additions & 64 deletions integration-tests/data/contract_origination.ts
Original file line number Diff line number Diff line change
@@ -1,69 +1,5 @@
import { OperationContentsOrigination } from "@taquito/rpc"

export const contractOriginationParams = {
"code":
[{
"prim": "parameter",
"args":
[{
"prim": "pair",
"args":
[{ "prim": "string" }, { "prim": "nat" },
{ "prim": "tx_rollup_l2_address" },
{ "prim": "address" }]
}]
},
{ "prim": "storage", "args": [{ "prim": "unit" }] },
{
"prim": "code",
"args":
[[{ "prim": "CAR" },
{
"prim": "UNPAIR",
"args": [{ "int": "4" }]
},
{ "prim": "TICKET" }, { "prim": "PAIR" },
{ "prim": "SWAP" },
{
"prim": "CONTRACT",
"args":
[{
"prim": "pair",
"args":
[{
"prim": "ticket",
"args": [{ "prim": "string" }]
},
{ "prim": "tx_rollup_l2_address" }]
}],
"annots": ["%deposit"]
},
[{
"prim": "IF_NONE",
"args":
[[[{ "prim": "UNIT" },
{ "prim": "FAILWITH" }]], []]
}],
{ "prim": "SWAP" },
{
"prim": "PUSH",
"args":
[{ "prim": "mutez" }, { "int": "0" }]
},
{ "prim": "SWAP" },
{ "prim": "TRANSFER_TOKENS" },
{ "prim": "UNIT" },
{
"prim": "NIL",
"args": [{ "prim": "operation" }]
},
{ "prim": "DIG", "args": [{ "int": "2" }] },
{ "prim": "CONS" }, { "prim": "PAIR" }]]
}],
"storage": { "prim": "Unit" }
}


export const rpcToForge = {
"branch": "BLQ6JyEEzUNkA7WEDSAbyFYLoEK7RVcNcjbjrN5LrmqoUW4qmu3",
"contents":
Expand Down
20 changes: 0 additions & 20 deletions integration-tests/data/tickets_deposit_contract.ts

This file was deleted.

20 changes: 10 additions & 10 deletions integration-tests/originate-known-contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ CONFIGS().forEach(({ lib, setup, protocol }) => {
(async () => {
await setup(true);
console.log(protocol)
fs.writeFile(`known-contracts-${protocol.substring(0,9)}.ts`, '', (err: any) => {
if (err) {
console.error(err);
}
});
fs.writeFile(`known-contracts-${protocol.substring(0,9)}.ts`, '', (err: any) => {
if (err) {
console.error(err);
}
});

keyPkh = await tezos.signer.publicKeyHash();
keyInitialBalance = await tezos.tz.getBalance(keyPkh);
Expand Down Expand Up @@ -151,11 +151,11 @@ Total XTZ Spent : ${keyInitialBalance.minus(await tezos.tz.getBalance(keyPkh)).d
const contract = await operation.contract();
console.log(`known${contractName} address: ${contract.address}`);
console.log(`::set-output name=known${contractName}Address::${contract.address}\n`);
fs.appendFile(`known-contracts-${protocol.substring(0,9)}.ts`, `export const known${contractName}${protocol.substring(0,9)} = "${contract.address}";\n`, (err: any) => {
if (err) {
console.error(err);
}
});
fs.appendFile(`known-contracts-${protocol.substring(0,9)}.ts`, `export const known${contractName}${protocol.substring(0,9)} = "${contract.address}";\n`, (err: any) => {
if (err) {
console.error(err);
}
});
} catch (e: any) {
console.error(`Failed to deploy ${contractName} known contract | Error: ${e.stack}`);

Expand Down
8 changes: 4 additions & 4 deletions packages/taquito-rpc/src/taquito-rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1131,11 +1131,11 @@ export class RpcClient implements RpcClientInterface {

/**
*
* @param contract address of the contract we want to retrieve ticket balance of
* @param ticket object to specify ticketer, content type and content
* @param contract implicit or originated address we want to retrieve ticket balance of
* @param ticket object to specify a ticket by ticketer, content type and content
* @param options contains generic configuration for rpc calls
* @description Access the contract's balance of ticket with specified ticketer, content type, and content.
* @example ticket{ ticketer: 'address', content_type: { prim: "string" }, content: { string: 'ticket1' } }
* @example ticket { ticketer: 'address', content_type: { prim: "string" }, content: { string: 'ticket1' } }
* @see https://tezos.gitlab.io/protocols/016_mumbai.html#rpc-changes
*/
async getTicketBalance(
Expand All @@ -1156,7 +1156,7 @@ export class RpcClient implements RpcClientInterface {

/**
*
* @param contract address of the contract we want to retrieve ticket balance of
* @param contract originated address we want to retrieve ticket balances of
* @param options contains generic configuration for rpc calls
* @description Access the complete list of tickets owned by the given contract by scanning the contract's storage.
* @see https://tezos.gitlab.io/protocols/016_mumbai.html#rpc-changes
Expand Down

0 comments on commit 3233200

Please sign in to comment.