Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose Porter domains using helper methods #312

Merged
merged 9 commits into from
Oct 17, 2023

Conversation

piotr-roslaniec
Copy link
Contributor

@piotr-roslaniec piotr-roslaniec commented Oct 5, 2023

Type of PR:

  • Feature

Required reviews:

  • 1

Issues fixed/closed:

Notes for reviewers:

@piotr-roslaniec piotr-roslaniec changed the title chore(examples): add a nextjs example Expose Porter domains from helper methods Oct 5, 2023
@piotr-roslaniec piotr-roslaniec changed the title Expose Porter domains from helper methods Expose Porter domains using helper methods Oct 5, 2023
@codecov-commenter
Copy link

codecov-commenter commented Oct 6, 2023

Codecov Report

Merging #312 (21f6d93) into monorepo (899c9d2) will decrease coverage by 0.08%.
Report is 10 commits behind head on monorepo.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##           monorepo     #312      +/-   ##
============================================
- Coverage     88.25%   88.17%   -0.08%     
============================================
  Files            33       33              
  Lines          2409     2394      -15     
  Branches        205      205              
============================================
- Hits           2126     2111      -15     
  Misses          254      254              
  Partials         29       29              
Files Coverage Δ
packages/pre/src/index.ts 100.00% <100.00%> (ø)
packages/taco/src/index.ts 100.00% <100.00%> (ø)
packages/taco/src/taco.ts 95.87% <100.00%> (-0.21%) ⬇️

@piotr-roslaniec piotr-roslaniec marked this pull request as ready for review October 6, 2023 10:20
@piotr-roslaniec piotr-roslaniec force-pushed the porter-domains branch 3 times, most recently from 8cf7e21 to e53419a Compare October 6, 2023 12:23
type PreDomain = 'oryx';

export const PRE_DOMAIN: Record<string, PreDomain> = {
TESTNET: 'oryx',
Copy link
Member

Choose a reason for hiding this comment

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

Was this supposed to be tapir?

Suggested change
TESTNET: 'oryx',
TESTNET: 'tapir',

Copy link
Contributor Author

@piotr-roslaniec piotr-roslaniec Oct 6, 2023

Choose a reason for hiding this comment

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

I'm not sure. I thought that @nucypher/[email protected], the vanilla PRE release, was working on oryx. tapir was used by tDec-PRE. I think these two are not compatible. Not sure what to do here, other than to update @nucypher/pre to use the current nucypher-core version and make sure it works on tapir.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Support tapir, mainnet and lynx networks. Test examples and demos against lynx.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@derekpierre What was the conclusion here? To support tapir, mainnet, and lynx networks in both PRE and TACo?

Copy link
Member

Choose a reason for hiding this comment

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

Yes. All possible TACo domains should be allowed: tapir, lynx, mainnet.

Comment on lines 21 to 23
export type PorterNetwork = keyof typeof porterUri;

export const getPorterUri = (network: Network): string => {
const uri = PORTER_URIS[network];
export const getPorterUri = (network: PorterNetwork): string => {
Copy link
Member

Choose a reason for hiding this comment

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

Can we use "domain" instead of "network"?

@@ -0,0 +1,17 @@
import { getPorterUri as doGetPorterUri } from '@nucypher/shared';

type PreDomain = 'oryx';
Copy link
Member

Choose a reason for hiding this comment

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

This domain is planned to be EOL after the next release, Shall we update it?

Suggested change
type PreDomain = 'oryx';
type PreDomain = PRE_DOMAIN.TESTNET;

Copy link
Contributor Author

@piotr-roslaniec piotr-roslaniec Oct 6, 2023

Choose a reason for hiding this comment

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

We can update it now, sure. I gather from comments in this PR that it's supposed to be tapir?

WRT to the line: Notice how type PreDomain = 'oryx'; is used in PRE_DOMAIN type definition:

export const PRE_DOMAIN: Record<string, PreDomain> = {
  TESTNET: 'oryx',
};

It works here like an enum - It describes the legal values in the PRE_DOMAIN dictionary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

4 participants