Skip to content

Commit

Permalink
Merge pull request #1 from 0xs34n/develop
Browse files Browse the repository at this point in the history
merge
  • Loading branch information
PhilippeR26 authored Jun 30, 2023
2 parents b2e7a40 + e6b861a commit 7e6e136
Show file tree
Hide file tree
Showing 295 changed files with 145,050 additions and 8,860 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/
dist/
www/
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.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
173 changes: 99 additions & 74 deletions CHANGELOG.md

Large diffs are not rendered by default.

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 7e6e136

Please sign in to comment.