Skip to content

Commit

Permalink
Merge pull request #30 from horuslabsio/feature/add-contributors
Browse files Browse the repository at this point in the history
chore: remove duplicate interface
  • Loading branch information
codeWhizperer authored Jun 12, 2024
2 parents 8ebfa87 + 744c117 commit 7a43a80
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 46 deletions.
11 changes: 11 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,14 @@ If you believe you have found a security vulnerability in our code, please repor
## License

KARST is an open-source software licensed under the [MIT](https://github.com/horuslabsio/karst-core/blob/master/LICENSE.md).

## Contributors

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->
4 changes: 2 additions & 2 deletions src/interfaces/IPublication.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// *************************************************************************
use starknet::ContractAddress;
use karst::base::types::{
PostParams, MirrorParams, ReferencePubParams, PublicationType, Publication
PostParams, MirrorParams, ReferencePubParams, PublicationType, Publication, QuoteParams
};

#[starknet::interface]
Expand All @@ -28,7 +28,7 @@ pub trait IKarstPublications<T> {
fn mirror(
ref self: T, mirrorParams: MirrorParams, profile_contract_address: ContractAddress
) -> u256;

fn quote(ref self: T, quoteParams: QuoteParams) -> u256;
// *************************************************************************
// GETTERS
// *************************************************************************
Expand Down
45 changes: 1 addition & 44 deletions src/publication/publication.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,6 @@ use karst::base::types::{
use karst::interfaces::IProfile::{IKarstProfileDispatcher, IKarstProfileDispatcherTrait};
use core::option::OptionTrait;

// *************************************************************************
// INTERFACE of KARST PUBLICATIONS
// *************************************************************************
#[starknet::interface]
pub trait IKarstPublications<T> {
// *************************************************************************
// PUBLISHING FUNCTIONS
// *************************************************************************

fn post(
ref self: T,
contentURI: ByteArray,
profile_address: ContractAddress,
profile_contract_address: ContractAddress
) -> u256;
fn comment(
ref self: T,
profile_address: ContractAddress,
content_URI: ByteArray,
pointed_profile_address: ContractAddress,
pointed_pub_id: u256,
profile_contract_address: ContractAddress,
) -> u256;
fn mirror(
ref self: T, mirrorParams: MirrorParams, profile_contract_address: ContractAddress
) -> u256;
fn quote(ref self: T, quoteParams: QuoteParams) -> u256;
////// Getters//////
fn get_publication(self: @T, user: ContractAddress, pubIdAssigned: u256) -> Publication;
fn get_publication_type(
self: @T, profile_address: ContractAddress, pub_id_assigned: u256
) -> PublicationType;
fn get_publication_content_uri(
self: @T, profile_address: ContractAddress, pub_id: u256
) -> ByteArray;
}

#[starknet::contract]
pub mod Publications {
Expand All @@ -56,7 +20,7 @@ pub mod Publications {
PostParams, Publication, PublicationType, ReferencePubParams, CommentParams, QuoteParams,
MirrorParams
};
use super::IKarstPublications;
use karst::interfaces::IPublication::IKarstPublications;
use karst::interfaces::IProfile::{IKarstProfileDispatcher, IKarstProfileDispatcherTrait};
use karst::base::errors::Errors::{NOT_PROFILE_OWNER, BLOCKED_STATUS};
use karst::base::{hubrestricted::HubRestricted::hub_only};
Expand Down Expand Up @@ -102,10 +66,6 @@ pub mod Publications {
}


// *************************************************************************
// CONSTRUCTOR
// *************************************************************************

// *************************************************************************
// EXTERNAL FUNCTIONS
// *************************************************************************
Expand Down Expand Up @@ -175,8 +135,6 @@ pub mod Publications {
mirrorParams: MirrorParams,
profile_contract_address: ContractAddress
) -> u256 {
// logic here

assert!(
profile_contract_address.into() != 0, "Contract Profile Address cannot be zero"
);
Expand Down Expand Up @@ -219,7 +177,6 @@ pub mod Publications {
}

fn quote(ref self: ContractState, quoteParams: QuoteParams) -> u256 {
// logic here
0
}
// *************************************************************************
Expand Down

0 comments on commit 7a43a80

Please sign in to comment.