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

simpler declarative build #47

Open
nmushegian opened this issue Mar 1, 2022 · 0 comments
Open

simpler declarative build #47

nmushegian opened this issue Mar 1, 2022 · 0 comments

Comments

@nmushegian
Copy link
Member

Based on our current usage it seems like we can just have a single pure build function. (We should also still have stateful builder pattern).

const pack = dpack.build({
  network: hh.network.name,
  types: {
    'Gem': {
      artifact: hh.artifacts.readArtifact('Gem')
    },
  },
  objects: {
    'gemfab': {
      typename: 'Gem',
      address: gem.address,
      artifact: hh.artifacts.readArtifact('Gem'),
      alsoPackType: true
    }
  }
})

notice:

  • we can allow omitting redundant typename and objectname in places it can be inferred from the key. In later versions these could be distinct, but here they can't be
  • alsoPackType can be patched onto the object directly
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

No branches or pull requests

1 participant