-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* better test compilation + structure * ci fix
- Loading branch information
Showing
20 changed files
with
687 additions
and
420 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ests/mocks/credential_registry_mock.cairo → ...stry/tests/mock_credential_registry.cairo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
contracts/src/credential_registry/tests/test_credential_registry.cairo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use kudos::credential_registry::ICredentialRegistry; | ||
|
||
use kudos::credential_registry::component::{ | ||
CredentialRegistryComponent, CredentialRegistryComponent::InternalImpl | ||
}; | ||
use super::mocks::mock_credential_registry::CredentialRegistryMock; | ||
|
||
// | ||
// Setup | ||
// | ||
|
||
type ComponentState = | ||
CredentialRegistryComponent::ComponentState<CredentialRegistryMock::ContractState>; | ||
|
||
impl ComponentStateDefault of Default<ComponentState> { | ||
fn default() -> ComponentState { | ||
CredentialRegistryComponent::component_state_for_testing() | ||
} | ||
} | ||
|
||
#[test] | ||
fn test_initial_values() { | ||
let mut registry: ComponentState = Default::default(); | ||
|
||
assert!(registry.get_total_credentials() == 0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#[starknet::interface] | ||
pub trait IKudos<TState> { | ||
fn give_kudos( | ||
ref self: TState, | ||
amount: felt252, | ||
sender_credentials: felt252, | ||
receiver_credentials: felt252, | ||
description: felt252, | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.