Skip to content

Commit

Permalink
change EntryTypes to EntryDefinitions
Browse files Browse the repository at this point in the history
  • Loading branch information
LeosPrograms committed Apr 5, 2024
1 parent d5758ec commit 7c5fef0
Show file tree
Hide file tree
Showing 56 changed files with 212 additions and 315 deletions.
6 changes: 3 additions & 3 deletions lib/hdk_records/src/entry_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ pub fn create_entry<T, I: Clone, E>(
ScopedEntryDefIndex: for<'a> TryFrom<&'a T, Error = E>,
EntryVisibility: for<'a> From<&'a T>,
{
// use conversion traits to load HDK `EntryTypes` def for input entry data
// use conversion traits to load HDK `EntryDefinitions` def for input entry data
let wrapped_entry_struct: T = entry_struct.to_owned().into();
let ScopedEntryDefIndex {
zome_index, zome_type,
Expand Down Expand Up @@ -208,7 +208,7 @@ mod tests {
#[hdk_entry_types]
#[derive(Clone)]
#[unit_enum(UnitTypes)]
enum EntryTypes {
enum EntryDefinitions {
TestEntry(TestEntry),
}
#[hdk_entry_helper]
Expand All @@ -220,7 +220,7 @@ mod tests {
#[test]
fn test_roundtrip() {
let entry = TestEntry { field: None };
let wrapped_entry = EntryTypes::TestEntry(entry);
let wrapped_entry = EntryDefinitions::TestEntry(entry);

// CREATE
let (RevisionMeta { id: action_hash, .. }, entry_hash) = create_entry(wrapped_entry).unwrap();
Expand Down
22 changes: 11 additions & 11 deletions lib/hdk_semantic_indexes/client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ macro_rules! create_index {
$dest_record_type:ident.$inv_rel:ident($record_id:expr)
) => {
paste! {
manage_index::<EntryTypes, _, _, _, _, _, _, _, _, _>(
manage_index::<EntryDefinitions, _, _, _, _, _, _, _, _, _>(
[<read_ $record_type:lower:snake _index_zome>],
&stringify!([<_internal_index_ $record_type:lower:snake _ $rel:lower:snake>]),
$record_id,
Expand All @@ -74,7 +74,7 @@ macro_rules! create_index {
$record_type:ident($record_id:expr).$rel:ident($dest_record_id:expr)
) => {
paste! {
manage_index::<EntryTypes, _, _, _, _, _, _, _, _, _>(
manage_index::<EntryDefinitions, _, _, _, _, _, _, _, _, _>(
[<read_ $record_type:lower:snake _index_zome>],
&stringify!([<_internal_index_ $record_type:lower:snake _ $rel:lower:snake>]),
$record_id,
Expand All @@ -99,7 +99,7 @@ macro_rules! update_string_index {
) => { {
let string_hashes: Vec<$addressable_type> = string_index_hashes($dest_string_ids)?;
paste! {
manage_index::<EntryTypes, _, _, _, _, _, _, _, _, _>(
manage_index::<EntryDefinitions, _, _, _, _, _, _, _, _, _>(
[<read_ $record_type:lower:snake _index_zome>],
&stringify!([<_internal_index_ $record_type:lower:snake _ $rel:lower:snake>]),
$record_id,
Expand All @@ -118,7 +118,7 @@ macro_rules! update_string_index {
) => { {
let string_hashes: Vec<$addressable_type> = string_index_hashes($dest_string_ids)?;
paste! {
manage_index::<EntryTypes, _, _, _, _, _, _, _, _, _>(
manage_index::<EntryDefinitions, _, _, _, _, _, _, _, _, _>(
[<read_ $record_type:lower:snake _index_zome>],
&stringify!([<_internal_index_ $record_type:lower:snake _ $rel:lower:snake>]),
$record_id,
Expand All @@ -137,7 +137,7 @@ macro_rules! update_string_index {
let dest_string_hashes: Vec<$addressable_type> = string_index_hashes($dest_string_ids)?;
let remove_string_hashes: Vec<$addressable_type> = string_index_hashes($remove_string_ids)?;
paste! {
manage_index::<EntryTypes, _, _, _, _, _, _, _, _, _>(
manage_index::<EntryDefinitions, _, _, _, _, _, _, _, _, _>(
[<read_ $record_type:lower:snake _index_zome>],
&stringify!([<_internal_index_ $record_type:lower:snake _ $rel:lower:snake>]),
$record_id,
Expand Down Expand Up @@ -180,7 +180,7 @@ macro_rules! update_index {
$dest_record_type:ident.$inv_rel:ident($record_id:expr)
) => {
paste! {
manage_index::<EntryTypes, _, _, _, _, _, _, _, _, _>(
manage_index::<EntryDefinitions, _, _, _, _, _, _, _, _, _>(
[<read_ $record_type:lower:snake _index_zome>],
&stringify!([<_internal_index_ $record_type:lower:snake _ $rel:lower:snake>]),
$record_id,
Expand All @@ -199,7 +199,7 @@ macro_rules! update_index {
$dest_record_type:ident.$inv_rel:ident($record_id:expr)
) => {
paste! {
manage_index::<EntryTypes, _, _, _, _, _, _, _, _, _>(
manage_index::<EntryDefinitions, _, _, _, _, _, _, _, _, _>(
[<read_ $record_type:lower:snake _index_zome>],
&stringify!([<_internal_index_ $record_type:lower:snake _ $rel:lower:snake>]),
$record_id,
Expand All @@ -218,7 +218,7 @@ macro_rules! update_index {
$dest_record_type:ident.$inv_rel:ident($record_id:expr)
) => {
paste! {
manage_index::<EntryTypes, _, _, _, _, _, _, _, _, _>(
manage_index::<EntryDefinitions, _, _, _, _, _, _, _, _, _>(
[<read_ $record_type:lower:snake _index_zome>],
&stringify!([<_internal_index_ $record_type:lower:snake _ $rel:lower:snake>]),
$record_id,
Expand All @@ -237,7 +237,7 @@ macro_rules! update_index {
$record_type:ident($record_id:expr).$rel:ident($dest_record_ids:expr)
) => {
paste! {
manage_index::<EntryTypes, _, _, _, _, _, _, _, _, _>(
manage_index::<EntryDefinitions, _, _, _, _, _, _, _, _, _>(
[<read_ $record_type:lower:snake _index_zome>],
&stringify!([<_internal_index_ $record_type:lower:snake _ $rel:lower:snake>]),
$record_id,
Expand All @@ -255,7 +255,7 @@ macro_rules! update_index {
$record_type:ident($record_id:expr).$rel:ident.not($remove_record_ids:expr)
) => {
paste! {
manage_index::<EntryTypes, _, _, _, _, _, _, _, _, _>(
manage_index::<EntryDefinitions, _, _, _, _, _, _, _, _, _>(
[<read_ $record_type:lower:snake _index_zome>],
&stringify!([<_internal_index_ $record_type:lower:snake _ $rel:lower:snake>]),
$record_id,
Expand All @@ -273,7 +273,7 @@ macro_rules! update_index {
$record_type:ident($record_id:expr).$rel:ident($dest_record_ids:expr).not($remove_record_ids:expr)
) => {
paste! {
manage_index::<EntryTypes, _, _, _, _, _, _, _, _, _>(
manage_index::<EntryDefinitions, _, _, _, _, _, _, _, _, _>(
[<read_ $record_type:lower:snake _index_zome>],
&stringify!([<_internal_index_ $record_type:lower:snake _ $rel:lower:snake>]),
$record_id,
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,8 @@
"hygen": "^5.0.3",
"npm-run-all": "^4.1.5",
"npm-watch": "^0.6.0"
},
"dependencies": {
"tape": "^5.5.3"
}
}
Loading

0 comments on commit 7c5fef0

Please sign in to comment.