Skip to content

Commit

Permalink
remove needless type annotation (#512)
Browse files Browse the repository at this point in the history
  • Loading branch information
pscott authored Aug 23, 2023
1 parent ab5657b commit d243d3c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
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 @@ -401,7 +401,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 @@ -437,7 +437,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 @@ -484,7 +484,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 @@ -552,14 +552,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);
}
}

0 comments on commit d243d3c

Please sign in to comment.