Skip to content

Commit

Permalink
chore: fix handle registry
Browse files Browse the repository at this point in the history
  • Loading branch information
Darlington02 committed Jun 3, 2024
1 parent b5298f0 commit 35ecaa0
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/interfaces.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ pub mod IProfile;
pub mod IFollowNFT;
pub mod IPublication;
pub mod IHandle;
pub mod IHandleRegistry;
30 changes: 22 additions & 8 deletions src/namespaces/handle_registry.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ mod HandleRegistry {
#[event]
#[derive(Drop, starknet::Event)]
enum Event {
Linked: Linked,
Unlinked: Unlinked,
Linked: HandleLinked,
Unlinked: HandleUnlinked,
}

#[derive(Drop, starknet::Event)]
Expand All @@ -48,7 +48,9 @@ mod HandleRegistry {
// CONSTRUCTOR
// *************************************************************************
#[constructor]
fn constructor(hub_address: ContractAddress, handle_address: ContractAddress) {
fn constructor(
ref self: ContractState, hub_address: ContractAddress, handle_address: ContractAddress
) {
self.hub_address.write(hub_address);
self.handle_address.write(handle_address);
}
Expand All @@ -70,21 +72,33 @@ mod HandleRegistry {
// *************************************************************************
// GETTERS
// *************************************************************************
fn resolve(self: @ContractState, handle_id: u256) -> ContractAddress {// TODO
fn resolve(self: @ContractState, handle_id: u256) -> ContractAddress {
// TODO
0.try_into().unwrap()
}

fn get_handle(self: @ContractState, profile_address: ContractAddress) -> u256 {// TODO
fn get_handle(self: @ContractState, profile_address: ContractAddress) -> u256 {
// TODO
0.try_into().unwrap()
}
}

// *************************************************************************
// PRIVATE FUNCTIONS
// *************************************************************************
// *************************************************************************
#[generate_trait]
impl Private of PrivateTrait {
fn _link(ref self: ContractState, handle_id: u256, profile_address: ContractAddress) {// TODO
fn _link(
ref self: ContractState, handle_id: u256, profile_address: ContractAddress
) { // TODO
}

fn _unlink(ref self: ContractState, handle_id: u256, profile_address: ContractAddress) {// TODO
fn _unlink(
ref self: ContractState,
handle_id: u256,
profile_address: ContractAddress,
caller: ContractAddress
) { // TODO
}
}
}
6 changes: 3 additions & 3 deletions src/publication/publication.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ pub mod Publications {
// logic here
0
}
//////////////////////////////////////////////////////////////
/// GETTERS//////////////////////////////////////////////////
/// /////////////////////////////////////////////////////////
// *************************************************************************
// GETTERS
// *************************************************************************
fn get_publication_content_uri(
self: @ContractState, profile_address: ContractAddress, pub_id: u256
) -> ByteArray {
Expand Down

0 comments on commit 35ecaa0

Please sign in to comment.