Skip to content
This repository has been archived by the owner on Jan 9, 2025. It is now read-only.

Commit

Permalink
Remove unused implicit args (#786)
Browse files Browse the repository at this point in the history
Time spent on this PR: 0.1

## Pull request type

Please check the type of change your PR introduces:

- [ ] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, renaming)
- [x] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] Documentation content changes
- [ ] Other (please describe):

## What is the current behavior?

Some functions declare unnecessary implicit args, which is not free.

## What is the new behavior?

Removed some unnecessary ones.
  • Loading branch information
ClementWalter authored Nov 3, 2023
1 parent 799aa8b commit babe8d4
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 20 deletions.
14 changes: 2 additions & 12 deletions src/kakarot/execution_context.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,7 @@ namespace ExecutionContext {
// @dev Initialize the execution context of a specific contract.
// @param call_context The call_context (see model.CallContext) to be executed.
// @return ExecutionContext The initialized execution context.
func init{
syscall_ptr: felt*,
pedersen_ptr: HashBuiltin*,
range_check_ptr,
bitwise_ptr: BitwiseBuiltin*,
}(call_context: model.CallContext*) -> model.ExecutionContext* {
func init(call_context: model.CallContext*) -> model.ExecutionContext* {
let stack = Stack.init();
let memory = Memory.init();
let state = State.init();
Expand Down Expand Up @@ -161,12 +156,7 @@ namespace ExecutionContext {
// TL;DR: ensure that the prover used values that are consistent with the dictionary.
// @param self The pointer to the execution context.
// @return Summary The pointer to the execution Summary.
func finalize{
syscall_ptr: felt*,
pedersen_ptr: HashBuiltin*,
range_check_ptr,
bitwise_ptr: BitwiseBuiltin*,
}(self: model.ExecutionContext*) -> Summary* {
func finalize{range_check_ptr}(self: model.ExecutionContext*) -> Summary* {
alloc_locals;
let memory_summary = Memory.finalize(self.memory);
let stack_summary = Stack.finalize(self.stack);
Expand Down
2 changes: 1 addition & 1 deletion src/kakarot/kakarot.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func get_starknet_address{syscall_ptr: felt*, pedersen_ptr: HashBuiltin*, range_
// @return starknet_contract_address The newly deployed starknet contract address.
@external
func deploy_externally_owned_account{
syscall_ptr: felt*, pedersen_ptr: HashBuiltin*, range_check_ptr, bitwise_ptr: BitwiseBuiltin*
syscall_ptr: felt*, pedersen_ptr: HashBuiltin*, range_check_ptr
}(evm_address: felt) -> (starknet_contract_address: felt) {
return Kakarot.deploy_externally_owned_account(evm_address);
}
Expand Down
5 changes: 1 addition & 4 deletions src/kakarot/library.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,7 @@ namespace Kakarot {
// @param evm_contract_address The evm address that is mapped to the newly deployed starknet contract address.
// @return starknet_contract_address The newly deployed starknet contract address.
func deploy_externally_owned_account{
syscall_ptr: felt*,
pedersen_ptr: HashBuiltin*,
range_check_ptr,
bitwise_ptr: BitwiseBuiltin*,
syscall_ptr: felt*, pedersen_ptr: HashBuiltin*, range_check_ptr
}(evm_contract_address: felt) -> (starknet_contract_address: felt) {
alloc_locals;

Expand Down
1 change: 0 additions & 1 deletion src/kakarot/memory.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ namespace Memory {
// @notice Initialize the memory.
// @return memory The pointer to the memory.
func init() -> model.Memory* {
alloc_locals;
let (word_dict_start: DictAccess*) = default_dict_new(0);
return new model.Memory(
word_dict_start=word_dict_start, word_dict=word_dict_start, bytes_len=0
Expand Down
1 change: 0 additions & 1 deletion src/kakarot/stack.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ namespace Stack {
// @notice Initialize the stack.
// @return The pointer to the stack.
func init() -> model.Stack* {
alloc_locals;
let (dict_ptr_start: DictAccess*) = default_dict_new(0);
return new model.Stack(dict_ptr_start, dict_ptr_start, 0);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/src/kakarot/accounts/eoa/mock_kakarot.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func get_starknet_address{syscall_ptr: felt*, pedersen_ptr: HashBuiltin*, range_
// @return starknet_contract_address The newly deployed starknet contract address.
@external
func deploy_externally_owned_account{
syscall_ptr: felt*, pedersen_ptr: HashBuiltin*, range_check_ptr, bitwise_ptr: BitwiseBuiltin*
syscall_ptr: felt*, pedersen_ptr: HashBuiltin*, range_check_ptr
}(evm_address: felt) -> (starknet_contract_address: felt) {
return Kakarot.deploy_externally_owned_account(evm_address);
}
Expand Down

0 comments on commit babe8d4

Please sign in to comment.