I see that the address of the dna entry is different from the “official” DNA ADDRESS.
So using hdk::link_entries(&*hdk::DNA_ADDRESS, ...) doesn’t work since that’s not a valid base address for a link.
Instead I have to do a workaround of querying for the dna entry with hdk::query(EntryType::Dna) and use that address when linking.
If its a bug, can it be fixed so we can do hdk::link_entries(&*hdk::DNA_ADDRESS, ...) ?
Otherwise can we add a global for it like DNA_ENTRY_ADDRESS, so I don’t have to query the entry everytime I need this base address?
I wanted to look into it, and ended up reproducing it to do that… so I am seeing what you are seeing, having written it up in a test, from a fresh hc-happ-create project folder.
I’ll add this with steps to reproduce to the GH issue
Looking ever deeper into this (dang curiousity!)
Looks like in a lot of the places where the DNA address is returned, it is dealing in the thing stored as content INSIDE the Entry::Dna … so the raw DNA.
The get_dna function which is called in many places returns
That returned dna struct is then used around the code to call dna.address()
This line makes it more obvious how that address will differ from the committed Entry::Dna(dna) entry, if we return its address using something like…
...
let dna_entry = Entry::Dna(dna);
let dna_address = dna_entry.address();
during initialization, the dna entry is committed to the chain as