Skip to content

Commit

Permalink
fix: addressed pr comments and update testdapp to reasonable gaslimit
Browse files Browse the repository at this point in the history
  • Loading branch information
hui-an-yang committed Dec 8, 2022
1 parent d2ed3c0 commit 4236d9b
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion apps/taquito-test-dapp/src/lib/TestContainer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
let loading = false;
let success: boolean | undefined;
let opHash = "";
let input = { text: "", fee: 400, storageLimit: 400, gasLimit: 4000 };
let input = { text: "", fee: 400, storageLimit: 400, gasLimit: 1320 };
let testResult: { id: string; title: string; body: any };
const run = async () => {
Expand Down
12 changes: 8 additions & 4 deletions integration-tests/sandbox-drain-delegate-operation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { CONFIGS, sleep } from "./config";

CONFIGS().forEach(({ lib, rpc, setup, createAddress }) => {
const Tezos = lib;
const flextesanet = (rpc === 'http://localhost:20001') ? it : it.skip;
const flextesaLimaNet = (rpc === 'http://localhost:20000') ? it : it.skip;

describe(`Test Drain Delegate using: ${rpc}`, () => {
let Delegate: TezosToolkit;
Expand Down Expand Up @@ -40,16 +40,20 @@ CONFIGS().forEach(({ lib, rpc, setup, createAddress }) => {
}
done();
})
flextesanet('Should be able to inject drain_delegate operation', async (done) => {
flextesaLimaNet('Should be able to inject drain_delegate operation', async (done) => {
expect((await Delegate.rpc.getBalance(delegatePkh)).toNumber()).toBeGreaterThan(0);
let destinationBalanceBefore = (await Destination.rpc.getBalance(destinationPkh)).toNumber();

const drainOp = await Destination.contract.drainDelegate({
consensus_key: destinationPkh,
delegate: delegatePkh,
destination: destinationPkh,
});
await drainOp.confirmation();


expect(drainOp.includedInBlock).toBeDefined()
expect((await Delegate.rpc.getBalance(delegatePkh)).toNumber()).toEqual(0);
expect((await Destination.rpc.getBalance(destinationPkh)).toNumber()).toBeGreaterThan(0);
expect((await Destination.rpc.getBalance(destinationPkh)).toNumber()).toBeGreaterThan(destinationBalanceBefore);
done();
});
});
Expand Down
7 changes: 0 additions & 7 deletions integration-tests/sandbox-env-kathmandu.sh

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/sh
export RUN_LIMANET_WITH_SECRET_KEY=true
export SECRET_KEY=edsk3RFgDiCt7tWB2oe96w1eRw72iYiiqZPLu9nnEY23MYRp2d8Kkx
export TEZOS_RPC_LIMANET=http://localhost:20001
export TEZOS_RPC_LIMANET=http://localhost:20000
export POLLING_INTERVAL_MILLISECONDS=100
export RPC_CACHE_MILLISECONDS=0
export TEZOS_BAKER=tz1VSUr8wwNhLAzempoch5d6hLRiTh8Cjcjb
2 changes: 1 addition & 1 deletion packages/taquito/src/contract/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ export interface ContractProvider extends StorageProvider {

/**
*
* @description Submit drain delegate for an ongoing proposal
* @description Submit drain delegate operation
*
* @returns An operation handle with the result from the RPC node
*
Expand Down
3 changes: 2 additions & 1 deletion packages/taquito/src/contract/rpc-contract-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ import { TxRollupOriginationOperation } from '../operations/tx-rollup-originatio
import { TxRollupBatchOperation } from '../operations/tx-rollup-batch-operation';
import { TransferTicketOperation } from '../operations/transfer-ticket-operation';
import { IncreasePaidStorageOperation } from '../operations/increase-paid-storage-operation';
import { BallotOperation, DrainDelegateOperation } from '../operations';
import { BallotOperation } from '../operations/ballot-operation';
import { DrainDelegateOperation } from '../operations/drain-delegate-operation';
import { ProposalsOperation } from '../operations/proposals-operation';
import { UpdateConsensusKeyOperation } from '../operations/update-consensus-key-operation';

Expand Down

0 comments on commit 4236d9b

Please sign in to comment.