Skip to content

simpler declarative build #47

@nmushegian

Description

@nmushegian

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions