Skip to content

Commit

Permalink
fix: common abi type for ContractClassResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
notV4l committed Jun 12, 2023
1 parent e13d7eb commit 55a8d98
Show file tree
Hide file tree
Showing 58 changed files with 3,327 additions and 2,548 deletions.
12 changes: 2 additions & 10 deletions .github/workflows/_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,8 @@ jobs:
# TODO - periodically check if conditional services are supported; https://github.com/actions/runner/issues/822
services:
devnet:
# TODO - The image utilized is a temporary workaround to allow for the RPC request validation
# deactivation argument to be set since the service configuration lacks a corresponding
# functionality; https://github.com/actions/runner/issues/2276.
# It was generated from the following Dockerfile:
# FROM shardlabs/starknet-devnet:0.5.1-seed0
# CMD ["--disable-rpc-request-validation", "--timeout", "600"]
# Switch back to the standard Devnet image once a full release is available.
# image: penovicp/devnet-test:0.5.1
# image: shardlabs/starknet-devnet:0.5.1-seed0
image: ${{ inputs.is-rpc && 'penovicp/devnet-test:0.5.1' || 'shardlabs/starknet-devnet:0.5.2-seed0' }}
# image: ${{ inputs.is-rpc && 'shardlabs/starknet-devnet:0.5.3-seed0' || 'shardlabs/starknet-devnet:0.5.2-seed0' }}
image: shardlabs/starknet-devnet:0.5.3-seed0
ports:
- 5050:5050

Expand Down
42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,45 @@
# [5.13.0](https://github.com/0xs34n/starknet.js/compare/v5.12.0...v5.13.0) (2023-06-12)

### Bug Fixes

- class / simulate types ([823e144](https://github.com/0xs34n/starknet.js/commit/823e144257cf3afdf8ca64f3e6e1afd1c2525161))
- getClass return type ([5251337](https://github.com/0xs34n/starknet.js/commit/52513373fc90af4764f3d8bf7f24a6a65db8dc52))
- removed doc modification ([f45b532](https://github.com/0xs34n/starknet.js/commit/f45b53204fbd4fe8a8ccc46fdf401cd32b732883))
- suggestedMaxFees to suggestedMaxFee ([80cfbb9](https://github.com/0xs34n/starknet.js/commit/80cfbb9c3eca55ddb0eae6a152523b72f3ba9699))
- test error ([2117e75](https://github.com/0xs34n/starknet.js/commit/2117e75b92c4b025e3d69a2719454fca3af76aa2))
- type ([67bf6d8](https://github.com/0xs34n/starknet.js/commit/67bf6d8c31c62107eb1ea4b21923b43e0ca7c921))
- type not requested anymore ([4446acb](https://github.com/0xs34n/starknet.js/commit/4446acbe8ab06fa981a8ccecb7fad67b2df73899))
- typescript wrong types for getStateUpdate ([0c309d5](https://github.com/0xs34n/starknet.js/commit/0c309d5c1e3450fa274e8fb798c510984b6467b5))
- uncomment sequencer simulate transaction test ([9a60b9f](https://github.com/0xs34n/starknet.js/commit/9a60b9ffae9a67a17b307aa5bbbffe897416ccab))
- update rpc versions, small fixes ([4f8b24f](https://github.com/0xs34n/starknet.js/commit/4f8b24fcd402b033415af9902f5e0137e03c5db9))
- wip simulate type cleanup, version bugfix ([045bb25](https://github.com/0xs34n/starknet.js/commit/045bb251a095ff1f7ec8eaa141547c247f3fabb2))

### Features

- accountInvocationsFactory ([acdaab4](https://github.com/0xs34n/starknet.js/commit/acdaab4458406b8bb55238cb9400c16724486da0))
- add EVENTS_CHUNK (PR 70 from starknet-specs) ([2f15593](https://github.com/0xs34n/starknet.js/commit/2f155932a748400d37926b45e4abe6fa894ae9b3))
- add replaced classes and rename properties (PR 76 from starknet-specs), rpc.ts fix coming next ([eb095c5](https://github.com/0xs34n/starknet.js/commit/eb095c583fe93a9e8157c5157885cbb19de8a00d))
- add simulate_transaction and sierra support (untested) ([47bca37](https://github.com/0xs34n/starknet.js/commit/47bca377f2f4cde658a467143cc54f80c385bc93))
- added missing TOO_MANY_KEYS_IN_FILTER error (PR 55 from starknet-specs) ([32e2bf5](https://github.com/0xs34n/starknet.js/commit/32e2bf5521461402b5d524311e1a53a7f434f314))
- consolidation of invokes in provider, except basic transactions ([92c2a98](https://github.com/0xs34n/starknet.js/commit/92c2a985538486065328b3243d22fc578b726ea6))
- fix remaining issues ([23d0a96](https://github.com/0xs34n/starknet.js/commit/23d0a96a525f7e2317021db5cfb9a2cf5a5ff9cf))
- implemented estimateFeeOriginal ([aba6707](https://github.com/0xs34n/starknet.js/commit/aba67074cadab64389908f0102bdfc904064ae5e))
- make transaction type explicit (PR 68 from starknet-specs) ([8857e08](https://github.com/0xs34n/starknet.js/commit/8857e08696df1e4ed8ca16ed922326350f74dc67))
- multiple updates and fixes for simulate and estimate, interface, wip ([12ed49b](https://github.com/0xs34n/starknet.js/commit/12ed49bf182da6ecfdb6560fd10d0659ad2acae9))
- simulate transaction implementation wip ([b604de0](https://github.com/0xs34n/starknet.js/commit/b604de005148a53d6ee6ac5f67e2e004e5222be5))
- simulate transaction rpc & sequencer ([8a47562](https://github.com/0xs34n/starknet.js/commit/8a475623799778a97f385b935d7f951f388cff13))
- starknet 0.11.0 adjustments (PR 65 from starknet-specs), rpc.ts fix coming next ([cffdaca](https://github.com/0xs34n/starknet.js/commit/cffdacaa66fe944dcbf050d8572d1e053d59480c))
- state update response split to pending/none pending (PR 74 from starknet-specs) ([2c6945f](https://github.com/0xs34n/starknet.js/commit/2c6945f03c9bd8ab5787cc2505a0fd803d0bbe72))
- supported multiple values in event filters (PR 55 from starknet-specs) ([4492704](https://github.com/0xs34n/starknet.js/commit/4492704224632f51990b1ba3b3138f4e4c902e65))
- supported new required properties (PR 67 from starknet-specs) ([1759ac4](https://github.com/0xs34n/starknet.js/commit/1759ac4c84d8bcea8460745f4e48518511976835))
- supported the new api bulk for estimateFee on existing rpc methods ([b8dd210](https://github.com/0xs34n/starknet.js/commit/b8dd2107ab614e0d5c99545d0fe61cbd727db5ab))

# [5.12.0](https://github.com/0xs34n/starknet.js/compare/v5.11.1...v5.12.0) (2023-06-12)

### Features

- add RawArgs in Account.populate ([6b539a3](https://github.com/0xs34n/starknet.js/commit/6b539a37815ecafb6c8b738b8585dd75d534b3cf))

## [5.11.1](https://github.com/0xs34n/starknet.js/compare/v5.11.0...v5.11.1) (2023-05-30)

### Bug Fixes
Expand Down
24 changes: 24 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,32 @@ Documentation can be archived by using JSDoc.

**Please update the npm lock file (`package-lock.json`) if you add or update dependencies.**

### Commit messages

**For commit messages use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/), like so: `feat(scope): topic`**

Note that the `feat` and `fix` commit messages are used for compiling the changelog. They should be relative to the current state of the target branch they should be merged into and not the feature branch where they are initially committed.

Example of **_incorrect_** commit messages:

```
fix: repair some bug
fix: rectify failing test
fix: adjust formatting
fix: add comments
fix: repair some other bug
```

Example of **_correct_** commit messages:

```
fix: repair some bug
test: rectify failing test
chore: adjust formatting
chore: add comments
fix: repair some other bug
```

### Pull request targets

For the most common pull requests such as bug fixes, feature additions, documentation changes, etc., target the `develop` branch.
Expand Down
48 changes: 5 additions & 43 deletions __mocks__/cairo/account/account.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ mod Account {
use super::Call;
use starknet::ContractAddress;
use zeroable::Zeroable;
use serde::ArraySerde;

struct Storage {
public_key: felt252
Expand Down Expand Up @@ -77,53 +78,14 @@ mod Account {

starknet::call_contract_syscall(
address: to, entry_point_selector: selector, calldata: calldata.span()
).unwrap_syscall()
)
.unwrap_syscall()
}
}

#[derive(Drop)]
#[derive(Drop, Serde)]
struct Call {
to: ContractAddress,
selector: felt252,
calldata: Array<felt252>
}

impl CallSerde of Serde<Call> {
fn serialize(self: @Call, ref output: Array<felt252>) {
let Call{to, selector, calldata } = self;
to.serialize(ref output);
selector.serialize(ref output);
calldata.serialize(ref output);
}

fn deserialize(ref serialized: Span<felt252>) -> Option<Call> {
let to = Serde::<ContractAddress>::deserialize(ref serialized)?;
let selector = Serde::<felt252>::deserialize(ref serialized)?;
let calldata = Serde::<Array<felt252>>::deserialize(ref serialized)?;
Option::Some(Call { to, selector, calldata })
}
}

fn serialize_array_call_helper(ref output: Array<felt252>, mut input: Array<Call>) {
gas::withdraw_gas().expect('Out of gas');
match input.pop_front() {
Option::Some(value) => {
value.serialize(ref output);
serialize_array_call_helper(ref output, input);
},
Option::None(_) => {},
}
}

fn deserialize_array_call_helper(
ref serialized: Span<felt252>, mut curr_output: Array<Call>, remaining: felt252
) -> Option<Array<Call>> {
if remaining == 0 {
return Option::Some(curr_output);
}

gas::withdraw_gas().expect('Out of gas');

curr_output.append(Serde::<Call>::deserialize(ref serialized)?);
deserialize_array_call_helper(ref serialized, curr_output, remaining - 1)
}
}
Loading

0 comments on commit 55a8d98

Please sign in to comment.