Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove needless type annotation #512

Merged
merged 1 commit into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions starknet/src/execution_strategies/vanilla.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ mod VanillaExecutionStrategy {
#[constructor]
fn constructor(ref self: ContractState, quorum: u256) {
// TODO: temporary until components are released
let mut state: SimpleQuorumExecutionStrategy::ContractState =
SimpleQuorumExecutionStrategy::unsafe_new_contract_state();
let mut state = SimpleQuorumExecutionStrategy::unsafe_new_contract_state();
SimpleQuorumExecutionStrategy::initializer(ref state, quorum);
}

Expand Down
12 changes: 6 additions & 6 deletions starknet/src/space/space.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ mod Space {
ReinitializableImpl::initialize(ref state);

//TODO: temporary component syntax
let mut state: Ownable::ContractState = Ownable::unsafe_new_contract_state();
let mut state = Ownable::unsafe_new_contract_state();
Ownable::initializer(ref state);
Ownable::transfer_ownership(ref state, owner);
_set_min_voting_duration(ref self, min_voting_duration);
Expand Down Expand Up @@ -398,7 +398,7 @@ mod Space {

fn cancel_proposal(ref self: ContractState, proposal_id: u256) {
//TODO: temporary component syntax
let state: Ownable::ContractState = Ownable::unsafe_new_contract_state();
let state = Ownable::unsafe_new_contract_state();
Ownable::assert_only_owner(@state);
let mut proposal = self._proposals.read(proposal_id);
assert_proposal_exists(@proposal);
Expand Down Expand Up @@ -434,7 +434,7 @@ mod Space {

fn owner(self: @ContractState) -> ContractAddress {
//TODO: temporary component syntax
let state: Ownable::ContractState = Ownable::unsafe_new_contract_state();
let state = Ownable::unsafe_new_contract_state();
Ownable::owner(@state)
}

Expand Down Expand Up @@ -481,7 +481,7 @@ mod Space {

fn update_settings(ref self: ContractState, input: UpdateSettingsCalldata) {
//TODO: temporary component syntax
let state: Ownable::ContractState = Ownable::unsafe_new_contract_state();
let state = Ownable::unsafe_new_contract_state();
Ownable::assert_only_owner(@state);

// if not NO_UPDATE
Expand Down Expand Up @@ -549,14 +549,14 @@ mod Space {

fn transfer_ownership(ref self: ContractState, new_owner: ContractAddress) {
//TODO: temporary component syntax
let mut state: Ownable::ContractState = Ownable::unsafe_new_contract_state();
let mut state = Ownable::unsafe_new_contract_state();
Ownable::assert_only_owner(@state);
Ownable::transfer_ownership(ref state, new_owner);
}

fn renounce_ownership(ref self: ContractState) {
//TODO: temporary component syntax
let mut state: Ownable::ContractState = Ownable::unsafe_new_contract_state();
let mut state = Ownable::unsafe_new_contract_state();
Ownable::assert_only_owner(@state);
Ownable::renounce_ownership(ref state);
}
Expand Down
3 changes: 1 addition & 2 deletions starknet/src/tests/mocks/space_v2.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ mod SpaceV2 {
impl SpaceV2 of ISpaceV2<ContractState> {
fn initialize(ref self: ContractState, var: felt252) {
// TODO: Temp component syntax
let mut state: Reinitializable::ContractState =
Reinitializable::unsafe_new_contract_state();
let mut state = Reinitializable::unsafe_new_contract_state();
ReinitializableImpl::initialize(ref state);
self._var.write(var);
}
Expand Down
6 changes: 2 additions & 4 deletions starknet/src/voting_strategies/eth_balance_of.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ mod EthBalanceOfVotingStrategy {
let slot_index = (*params[1]).into();

// TODO: temporary until components are released
let state: SingleSlotProof::ContractState =
SingleSlotProof::unsafe_new_contract_state();
let state = SingleSlotProof::unsafe_new_contract_state();

// Get the balance of the voter at the given block timestamp
let balance = SingleSlotProof::get_storage_slot(
Expand All @@ -43,8 +42,7 @@ mod EthBalanceOfVotingStrategy {
ref self: ContractState, facts_registry: ContractAddress, l1_headers_store: ContractAddress
) {
// TODO: temporary until components are released
let mut state: SingleSlotProof::ContractState =
SingleSlotProof::unsafe_new_contract_state();
let mut state = SingleSlotProof::unsafe_new_contract_state();
SingleSlotProof::initializer(ref state, facts_registry);
}
}
Loading