Skip to content

Commit

Permalink
Merge branch 'develop' into 0.11.2/redeclare-ts
Browse files Browse the repository at this point in the history
  • Loading branch information
tabaktoni committed Jun 23, 2023
2 parents 10da77e + 1a63522 commit a5b628f
Show file tree
Hide file tree
Showing 18 changed files with 1,551 additions and 1,038 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
services:
devnet:
# image: ${{ inputs.is-rpc && 'shardlabs/starknet-devnet:0.5.3-seed0' || 'shardlabs/starknet-devnet:0.5.2-seed0' }}
image: shardlabs/starknet-devnet:244903999afbabb3171114a1c0fc96b171723d1f-seed0
image: shardlabs/starknet-devnet:0.5.4-seed0
ports:
- 5050:5050

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/manual-docs-version-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
uses: peter-evans/create-pull-request@v5
with:
branch: ci/docs-version
commiter: CI <[email protected]>
committer: CI <[email protected]>
author: CI <[email protected]>
commit-message: 'docs: generate documentation version'
title: 'CI documentation version'
Expand Down
169 changes: 61 additions & 108 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions __tests__/account.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@ describe('deploy and test Wallet', () => {
});

test('estimate fee bulk invoke functions', async () => {
// TODO @dhruvkelawala check expectation for feeTransactionVersion
// const innerInvokeEstFeeSpy = jest.spyOn(account.signer, 'signTransaction');
const estimatedFeeBulk = await account.estimateFeeBulk([
{
Expand Down Expand Up @@ -759,6 +760,7 @@ describe('deploy and test Wallet', () => {
// Order is important, declare c1 must be last else estimate and simulate will error
// with contract already declared
test('estimateInvokeFee Cairo 1', async () => {
// TODO @dhruvkelawala check expectation for feeTransactionVersion
// Cairo 1 contract
const ddc1: DeclareDeployUDCResponse = await account.declareAndDeploy({
contract: compiledHelloSierra,
Expand Down
10 changes: 9 additions & 1 deletion __tests__/cairo1.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
shortString,
stark,
} from '../src';
import { isCairo1Abi } from '../src/utils/calldata/cairo';
import { toHex } from '../src/utils/num';
import { starknetKeccak } from '../src/utils/selector';
import {
Expand Down Expand Up @@ -88,6 +89,13 @@ describeIfDevnet('Cairo 1 Devnet', () => {
expect(classResponse).toMatchSchemaRef('SierraContractClass');
});

test('isCairo1', async () => {
const isContractCairo1 = cairo1Contract.isCairo1();
expect(isContractCairo1).toBe(true);
const isAbiCairo1 = isCairo1Abi(cairo1Contract.abi);
expect(isAbiCairo1).toBe(true);
});

test('Cairo 1 Contract Interaction - skip invoke validation & call parsing', async () => {
const tx = await cairo1Contract.increase_balance(
CallData.compile({
Expand Down Expand Up @@ -167,7 +175,7 @@ describeIfDevnet('Cairo 1 Devnet', () => {
expect(status).toBe(123n);
});

test('Cairo1 simple getStorageAt variables retreaval', async () => {
test('Cairo1 simple getStorageAt variables retrieval', async () => {
// u8
let tx = await cairo1Contract.increase_balance(100);
await account.waitForTransaction(tx.transaction_hash);
Expand Down
9 changes: 8 additions & 1 deletion __tests__/contract.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BigNumberish, Contract, ContractFactory, RawArgs, json, stark } from '../src';
import { CallData } from '../src/utils/calldata';
import { felt, tuple, uint256 } from '../src/utils/calldata/cairo';
import { felt, isCairo1Abi, tuple, uint256 } from '../src/utils/calldata/cairo';
import { getSelectorFromName } from '../src/utils/hash';
import { hexToDecimalString, toBigInt } from '../src/utils/num';
import { encodeShortString } from '../src/utils/shortString';
Expand Down Expand Up @@ -50,6 +50,13 @@ describe('contract module', () => {
);
});

test('isCairo1', async () => {
const isContractCairo1: boolean = erc20Contract.isCairo1();
expect(isContractCairo1).toBe(false);
const isAbiCairo1: boolean = isCairo1Abi(erc20Contract.abi);
expect(isAbiCairo1).toBe(false);
});

test('populate transaction for initial balance of that account', async () => {
const res = await erc20Contract.populateTransaction.balanceOf(wallet);
expect(res).toHaveProperty('contractAddress');
Expand Down
Loading

0 comments on commit a5b628f

Please sign in to comment.