You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix!: make datastore delete inputs JSON-deserializable (#87)
The Input types for the three datastore delete changesets and their
matching operations declared their key slices as `[]cldfdatastore.XKey`,
where `XKey` is a framework interface with unexported implementations.
`encoding/json` cannot unmarshal a JSON array into a slice of interface
values, so any YAML/JSON pipeline driving these changesets failed at the
deserialization boundary, and operation reports could not be re-executed
from disk.
Introduce `datastore/internal/keys/` with plain-DTO mirrors
(`ChainMetadataKey`, `ContractMetadataKey`, `AddressRefKey`) of the
framework key interfaces. Each exposes `ToFrameworkKey()` for conversion
at the boundary; only `AddressRefKey.ToFrameworkKey()` can fail (returns
`ErrAddressRefVersionRequired` when `Version` is nil). The six in-scope
input fields (three changesets, three operations) now hold `[]keys.X`
instead of `[]cldfdatastore.X`. The earlier inline `DeleteAddressRefKey`
from PR #84 is removed in favor of the shared `keys.AddressRefKey`.
Adds JSON-round-trip regression tests for each key type, JSON-driven
end-to-end tests for each delete changeset, and operation-report
round-trip tests for each delete operation.
BREAKING CHANGE: `DeleteChainMetadataChangesetInput.ChainMetadataKeys`,
`DeleteContractMetadataChangesetInput.ContractMetadataKeys`, and
`DeleteAddressRefChangesetInput.AddressRefKeys` — plus the matching
operation Input fields — now hold concrete key structs instead of the
framework interface. The `DeleteAddressRefKey` type previously exported
from `datastore/changesets/` is removed. In-Go callers should switch to
JSON construction (no in-tree callers in chainlink-deployments today).
wantErr: fmt.Sprintf("address ref entry for chain selector %v, type %v, version %v and qualifier %q does not exist", addressRef2.ChainSelector, addressRef2.Type, addressRef2.Version, addressRef2.Qualifier),
0 commit comments