Skip to content

Commit

Permalink
Revert "2306 contract api sr originate (#2349)"
Browse files Browse the repository at this point in the history
This reverts commit defe860.
  • Loading branch information
zainen authored and Zainen Suzuki committed Mar 30, 2023
1 parent e5d872e commit d5dd448
Show file tree
Hide file tree
Showing 32 changed files with 29 additions and 1,052 deletions.
11 changes: 0 additions & 11 deletions docs/rpc_package.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,6 @@ const view = await client.runView({
});
```

You can obtain the `Origination Proof` for the `smart_rollup_originate` batch operation (not needed for the `smart_rollup_originate` alone)

This function will obtain the proof needed for the `smart_rollup_originate` batch method
```js
const originationProof = await client.getOriginationProof({
kernel: 'your kernel',
kind: 'PVM kind'
})
```


## Full documentation

You can find the full documentation at the following address: [https://tezostaquito.io/typedoc/classes/\_taquito_rpc.rpcclient.html](https://tezostaquito.io/typedoc/classes/_taquito_rpc.rpcclient.html)
27 changes: 1 addition & 26 deletions docs/smart_rollups.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,6 @@ Rollups are a permissionless scaling implementation for the Tezos blockchain. Th

In Taquito, we have implemented some of the operations included in Mumbai protocol update in regards to smart rollups. In this document, we will go through the operations we support. We also won't go too detailed on how rollups work behind the scenes, if you'd like to understand the feature a bit deeper, you can refer to [this document](https://tezos.gitlab.io/mumbai/smart_rollups.html).

## `smart_rollup_originate`

The `Smart Rollup Originate` operation allows a user to originate a smart rollup. Users must pass a `kernel`, `pvmKind`, and `parameterType`.

### Examples

```typescript
const op = await Tezos.contract.smartRollupOriginate({
pvmKind: 'wasm_2_0_0',
kernel: '23212f7573722f62696e2f656e762073680a6578706f7274204b45524e454c3d22303036313733366430313030303030303031323830373630303337663766376630313766363030323766376630313766363030353766376637663766376630313766363030313766303036303031376630313766363030323766376630303630303030303032363130333131373336643631373237343566373236663663366337353730356636333666373236353061373236353631363435663639366537303735373430303030313137333664363137323734356637323666366336633735373035663633366637323635306337373732363937343635356636663735373437303735373430303031313137333664363137323734356637323666366336633735373035663633366637323635306237333734366637323635356637373732363937343635303030323033303530343033303430353036303530333031303030313037313430323033366436353664303230303061366236353732366536353663356637323735366530303036306161343031303432613031303237663431666130303266303130303231303132303030326630313030323130323230303132303032343730343430343165343030343131323431303034316534303034313030313030323161306230623038303032303030343163343030366230623530303130353766343166653030326430303030323130333431666330303266303130303231303232303030326430303030323130343230303032663031303032313035323030313130303432313036323030343230303334363034343032303030343130313661323030313431303136623130303131613035323030353230303234363034343032303030343130373661323030363130303131613062306230623164303130313766343164633031343138343032343139303163313030303231303034313834303232303030313030353431383430323130303330623062333830353030343165343030306231323266366236353732366536353663326636353665373632663732363536323666366637343030343166383030306230323030303130303431666130303062303230303032303034316663303030623032303030303030343166653030306230313031220a',
parametersType: { prim: 'bytes' },

});
await op.confirmation();
```

##### please note
- `pvmKind` at this time the only PVM supported is `wasm_2_0_0`
- `kernel` is passed as a hexadecimal string examples can be found at [this tezos docs endpoint](https://tezos.gitlab.io/mumbai/smart_rollups.html?highlight=smart%20rollup%20originate#id1)
- `parametersType` is a MichelsonV1Expression to define the type.
- **Please note** `originationProof` is needed origination in `batch` which can be obtained with the `rpc.getOriginationProof({kernel, kind: PVMKind})`

For more information in regards to Smart Rollup Origination please refer to the this [link](https://tezos.gitlab.io/mumbai/smart_rollups.html?highlight=smart%20rollup%20originate#id1)


## `smart_rollup_add_messages`
The add messages operation allows users to send external messages into a rollup inbox. We will go into a bit more detail down below on what that means.

Expand Down Expand Up @@ -64,4 +39,4 @@ const op = await Tezos.contract.smartRollupAddMessages({
await op.confirmation();
```

- `message` property receives an array of encoded outbox messages. For more information on how to encode or what message gets encoded, refer to [this document](https://tezos.gitlab.io/mumbai/smart_rollups.html#sending-an-external-inbox-message)
- `message` property receives an array of encoded outbox messages. For more information on how to encode or what message gets encoded, refer to [this document](https://tezos.gitlab.io/mumbai/smart_rollups.html#sending-an-external-inbox-message)
42 changes: 0 additions & 42 deletions integration-tests/contract-batch-smart-rollup-originate.spec.ts

This file was deleted.

30 changes: 0 additions & 30 deletions integration-tests/contract-smart-rollup-originate.spec.ts

This file was deleted.

4 changes: 2 additions & 2 deletions integration-tests/data/allTestsCases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
codeContractWithConstant,
} from './contract_with_constant';
import { codeViewsTopLevel, storageViewsTopLevel } from './contract_views_top_level';
import { MichelsonV1Expression, OpKind, PvmKind } from '@taquito/rpc';
import { MichelsonV1Expression, OpKind } from '@taquito/rpc';
import { emitCode } from './code_with_emit';
import { lambdaRecCode } from './code_with_lambda_rec';

Expand Down Expand Up @@ -1327,7 +1327,7 @@ export const mumbaiCases: TestCase[] = [
counter: '3969',
gas_limit: '2849',
storage_limit: '6572',
pvm_kind: PvmKind.WASM2,
pvm_kind: 'wasm_2_0_0',
kernel:
'23212f7573722f62696e2f656e762073680a6578706f7274204b45524e454c3d22303036313733366430313030303030303031323830373630303337663766376630313766363030323766376630313766363030353766376637663766376630313766363030313766303036303031376630313766363030323766376630303630303030303032363130333131373336643631373237343566373236663663366337353730356636333666373236353061373236353631363435663639366537303735373430303030313137333664363137323734356637323666366336633735373035663633366637323635306337373732363937343635356636663735373437303735373430303031313137333664363137323734356637323666366336633735373035663633366637323635306237333734366637323635356637373732363937343635303030323033303530343033303430353036303530333031303030313037313430323033366436353664303230303061366236353732366536353663356637323735366530303036306161343031303432613031303237663431666130303266303130303231303132303030326630313030323130323230303132303032343730343430343165343030343131323431303034316534303034313030313030323161306230623038303032303030343163343030366230623530303130353766343166653030326430303030323130333431666330303266303130303231303232303030326430303030323130343230303032663031303032313035323030313130303432313036323030343230303334363034343032303030343130313661323030313431303136623130303131613035323030353230303234363034343032303030343130373661323030363130303131613062306230623164303130313766343164633031343138343032343139303163313030303231303034313834303232303030313030353431383430323130303330623062333830353030343165343030306231323266366236353732366536353663326636353665373632663732363536323666366637343030343166383030306230323030303130303431666130303062303230303032303034316663303030623032303030303030343166653030306230313031220a',
origination_proof:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Protocols } from '@taquito/taquito';
import { CONFIGS } from './config';
import { CONFIGS } from "./config";

CONFIGS().forEach(({ lib, rpc, setup, protocol }) => {
const Tezos = lib;
const limanet = protocol === Protocols.PtLimaPtL && !(rpc === 'http://localhost:20000') ? test : test.skip;
const flextesaLima = protocol === Protocols.PtLimaPtL && rpc === 'http://localhost:20000' ? test : test.skip;
const mumbaiAndAlpha = protocol === Protocols.PtMumbai2 || protocol === Protocols.ProtoALpha ? test : test.skip;
const mumbaiAndAlpha = protocol === Protocols.PtMumbai2 || protocol === Protocols.ProtoALpha ? test : test.skip;

describe(`Test injecting more than one manager operation in a block: ${rpc}`, () => {

Expand Down
10 changes: 5 additions & 5 deletions integration-tests/known-contracts-ProtoALph.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const knownContractProtoALph = "KT1EqE9uiQoodrX3hymdTsMzv4Ugh9Ba7WQh";
export const knownBigMapContractProtoALph = "KT1AhkcgTg5Yve1akqhp3L2VYe9wuJyr9Cf2";
export const knownTzip12BigMapOffChainContractProtoALph = "KT1L13TdpnvSnH9oax8BVsjsGwYUEAymvsUY";
export const knownSaplingContractProtoALph = "KT1REUu1WbovnUHgxP5ywV6Nc8WSTSquoRmw";
export const knownOnChainViewContractAddressProtoALph = "KT1NewFz74bCpfQw1qVkxGbN6MncRaVgaymH";
export const knownContractProtoALph = "KT1Xv5uq5qMQfV8jYeEMimLjUyTMcVStCBv2";
export const knownBigMapContractProtoALph = "KT1PEif4yNPaeDnmroV2zK9hshJqE6XHVUq8";
export const knownTzip12BigMapOffChainContractProtoALph = "KT1R6oieCZSFLf1w15yvjx3X38ZjhkdnyyHP";
export const knownSaplingContractProtoALph = "KT1TGQqMpzhsAMzAaCeDmL3oJRbqphjhFh9S";
export const knownOnChainViewContractAddressProtoALph = "KT1KmbQjCdEAX3NM5YoSZH6QPYK5foghn2Md";
15 changes: 2 additions & 13 deletions integration-tests/rpc-nodes.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CONFIGS } from './config';
import { DefaultContractType, Protocols } from "@taquito/taquito";
import { RpcClientCache, RpcClient, RPCRunViewParam, RPCRunScriptViewParam, PvmKind } from '@taquito/rpc';
import { RpcClientCache, RpcClient, RPCRunViewParam, RPCRunScriptViewParam } from '@taquito/rpc';
import { encodeExpr } from '@taquito/utils';
import { Schema } from '@taquito/michelson-encoder';
import { tokenBigmapCode, tokenBigmapStorage } from './data/token_bigmap';
Expand Down Expand Up @@ -444,7 +444,7 @@ CONFIGS().forEach(
expect(ticketBalance).toBeDefined();
done();
});

mumbaiAndAlpha('Verify that rpcClient.allTicketBalances will retrieve all tickets owned by the given contract', async (done) => {
const ticketBalances = await rpcClient.getAllTicketBalances(ticketContract.address);
expect(ticketBalances).toBeInstanceOf(Array)
Expand All @@ -454,17 +454,6 @@ CONFIGS().forEach(
expect(ticketBalances[0].amount).toBeDefined()
done();
});

mumbaiAndAlpha('Verify that rpcClient.getOriginationProof will retrieve the proof needed for smart rollup originate', async (done) => {
const proof = await rpcClient.getOriginationProof({
kernel: '23212f7573722f62696e2f656e762073680a6578706f7274204b45524e454c3d22303036313733366430313030303030303031323830373630303337663766376630313766363030323766376630313766363030353766376637663766376630313766363030313766303036303031376630313766363030323766376630303630303030303032363130333131373336643631373237343566373236663663366337353730356636333666373236353061373236353631363435663639366537303735373430303030313137333664363137323734356637323666366336633735373035663633366637323635306337373732363937343635356636663735373437303735373430303031313137333664363137323734356637323666366336633735373035663633366637323635306237333734366637323635356637373732363937343635303030323033303530343033303430353036303530333031303030313037313430323033366436353664303230303061366236353732366536353663356637323735366530303036306161343031303432613031303237663431666130303266303130303231303132303030326630313030323130323230303132303032343730343430343165343030343131323431303034316534303034313030313030323161306230623038303032303030343163343030366230623530303130353766343166653030326430303030323130333431666330303266303130303231303232303030326430303030323130343230303032663031303032313035323030313130303432313036323030343230303334363034343032303030343130313661323030313431303136623130303131613035323030353230303234363034343032303030343130373661323030363130303131613062306230623164303130313766343164633031343138343032343139303163313030303231303034313834303232303030313030353431383430323130303330623062333830353030343165343030306231323266366236353732366536353663326636353665373632663732363536323666366637343030343166383030306230323030303130303431666130303062303230303032303034316663303030623032303030303030343166653030306230313031220a',
kind: PvmKind.WASM2
})
const hexRegex = RegExp('^[a-fA-F0-9]+$');
expect(proof).toBeDefined();
expect(hexRegex.test(proof)).toEqual(true);
done();
})
});
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export class ReadWrapperContractsLibrary implements TzReadProvider {
hard_gas_limit_per_block: BigNumber;
hard_storage_limit_per_operation: BigNumber;
cost_per_byte: BigNumber;
smart_rollup_origination_size: number;
}> {
return this.readProvider.getProtocolConstants(block);
}
Expand Down
7 changes: 0 additions & 7 deletions packages/taquito-contracts-library/src/rpc-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import {
VotingPeriodBlockResult,
TicketTokenParams,
AllTicketBalances,
OriginationProofParams,
} from '@taquito/rpc';
import { ContractsLibrary } from './taquito-contracts-library';

Expand Down Expand Up @@ -322,10 +321,4 @@ export class RpcWrapperContractsLibrary implements RpcClientInterface {
): Promise<AllTicketBalances> {
return this.rpc.getAllTicketBalances(contract, { block });
}
async getOriginationProof(
params: OriginationProofParams,
{ block }: RPCOptions = defaultRPCOptions
): Promise<string> {
return this.rpc.getOriginationProof(params, { block });
}
}
Loading

0 comments on commit d5dd448

Please sign in to comment.