Skip to content

♻️ Extract wallet to context#193

Open
quentin-burg wants to merge 8 commits into
devfrom
extract-wallet-to-context
Open

♻️ Extract wallet to context#193
quentin-burg wants to merge 8 commits into
devfrom
extract-wallet-to-context

Conversation

@quentin-burg
Copy link
Copy Markdown
Collaborator

  • Extract BeaconWallet into Context
  • Extract TezosToolKit into Context
  • Rewrite Context to manage App State and Dispatch function

TODO : Problem with fetching proposals ... To be continued ...

Copy link
Copy Markdown
Collaborator

@Pilou97 Pilou97 left a comment

Choose a reason for hiding this comment

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

First review

Comment thread components/LoginModal.tsx
Comment thread components/LoginModal.tsx
Comment thread components/LoginModal.tsx
setError((e as Error).message);
setCurrentState(State.ERROR);
}
}, [data, state.p2pClient, state.attemptedInitialLogin]);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why state.attemptedInitialLogin is no more required?

Comment thread components/textInputWithComplete.tsx
Comment thread context/state.tsx
Comment thread context/wallet.tsx Outdated
Comment thread context/wallet.tsx
Comment thread context/wallet.tsx
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 22, 2024

Deploying tzsafe-ui-ghostnet with  Cloudflare Pages  Cloudflare Pages

Latest commit: e7811ab
Status: ✅  Deploy successful!
Preview URL: https://32076319.tzsafe-ui.pages.dev
Branch Preview URL: https://extract-wallet-to-context.tzsafe-ui.pages.dev

View logs

@quentin-burg quentin-burg marked this pull request as ready for review April 26, 2024 06:34
Copy link
Copy Markdown
Collaborator

@Pilou97 Pilou97 left a comment

Choose a reason for hiding this comment

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

Cool to have update the package.json and airgap

Comment thread context/state.tsx
case "p2pConnect": {
return { ...state, p2pClient: action.payload };
}
case "addDapp": {
if (!state.address) return state;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The address is always defined? I don't know what is addDapp but can it be triggered when the user is disconnected without any safe?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

address is no longer defined in the global state but in wallet context.
addDapp allows to connect an external dapp with Tzsafe and user have to import a contract to access to this feature, so I believe disconnected user cannot trigger this action

Comment thread dapps/tezosDomains.tsx
action: BUY_ADDRESS.name,
description: (
<p>
TzSafe doesn't support the entrypoint:{" "}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You don't need spaces anymore? I am wondering if we can use template string 🤔

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes you're right :-)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I updated all of occurrences of this string

Comment thread tests/e2eTest/v0.3.4.ts
expect(storage.owners).toEqual([owner]);
storage.metadata.get("").then((value: string) => {
expect(value).toEqual(char2Bytes(ipfs_file));
expect(value).toEqual(stringToBytes(ipfs_file));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

what is the difference between char2Bytes and stringToBytes ? Why do we need to change it?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

charToBytes and bytesToChar are deprecated => https://taquito.io/typedoc/functions/_taquito_utils.char2Bytes

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