Skip to content

Conversation

nikgraf
Copy link
Collaborator

@nikgraf nikgraf commented Jan 14, 2025

My main goal was to consolidate asap so we can avoid creating tons of conflicts in upcoming PRs.

I moved all the packages in one commit. The benefit is that then git detects them as moves file and it's easier to go back in history of a file.

I would restructure a lot of the imports, but we can do this as a follow-up.

TIL: two Uint8Arrays can have the same content, but might have a different buffer length they won't be equal. That's why I wrapped several Uin8Array comparisons in tests again with a new Uint8Array. Then they won't have additional buffer length.

There is still one test that fails and I created a follow up issue: #90

@nikgraf nikgraf force-pushed the ng/consolidate-pkg branch from 689726c to 9f89641 Compare January 14, 2025 11:45
@nikgraf nikgraf force-pushed the ng/consolidate-pkg branch from 58c50b1 to 60b85e3 Compare January 14, 2025 13:00
@nikgraf nikgraf marked this pull request as ready for review January 14, 2025 13:05
@nikgraf nikgraf requested a review from cmwhited January 14, 2025 13:09
@nikgraf nikgraf changed the title consolidate packages consolidate packages & rename to hypergraph Jan 14, 2025
});

expect(decrypted).toEqual(message);
expect(new Uint8Array(decrypted)).toEqual(new Uint8Array(message));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran into the same issue in my branch. I created a Uint8Array comparison checker. But wondering what caused these tests to now fail


describe('identity encryption', () => {
it('should encrypt and decrypt an identity using a wallet', async () => {
it.skip('should encrypt and decrypt an identity using a wallet', async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran into this issue as well. I tried downgrading the deps to what is in the current pkg to try and fix it, and no luck. Not sure what is happening

it('should generate and verify ownership proofs', async () => {
// generate a random private key to simulate a user wallet
const account = privateKeyToAccount(bytesToHex(randomBytes(32)));
const account = privateKeyToAccount(bytesToHex(randomBytes(32)) as Hex);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated bytesToHex to return an instance of Hex would resolve this

@cmwhited cmwhited merged commit 5ea4aae into main Jan 14, 2025
1 check passed
@cmwhited cmwhited deleted the ng/consolidate-pkg branch January 14, 2025 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants