github codama-idl/codama @codama/visitors-core@2.0.0-rc.1

latest releases: codama@2.0.0-rc.1, @codama/nodes-from-anchor@2.0.0-rc.1, @codama/visitors@2.0.0-rc.1...
pre-releaseone hour ago

Minor Changes

  • #1293 638cd1c Thanks @lorisleiva! - Walk the children of every node in the declaration order of the spec, in both the merge and the identity visitors, like the Rust visitors. Previously, a few nodes walked some children first, e.g. the pdas of a programNode before its accounts and instructions, or the count of an arrayTypeNode before its item, and the identity visitor visited every single child of a node before its list children. Results are unchanged, but the order in which visitors, interceptors and node selectors see nodes changes, including which siblings are visited before an identity visitor drops a node whose required child returns null, and so do the output of getDebugStringVisitor and the order of validation items. A pda link now resolves to the pda of its program rather than to a pda of the same identifier inlined in a pdaValueNode.

    visit(arrayTypeNode(publicKeyTypeNode(), prefixedCountNode(integerTypeNode('u64'))), getDebugStringVisitor());
    // Before: arrayTypeNode(prefixedCountNode(integerTypeNode[u64]), publicKeyTypeNode)
    // After:  arrayTypeNode(publicKeyTypeNode, prefixedCountNode(integerTypeNode[u64]))

Patch Changes

  • #1285 9146ad3 Thanks @lorisleiva! - Carry the resolved signer and optionality of a default account along a chain of defaults in getResolvedInstructionInputsVisitor. An account defaulting to an account that itself defaults to a non-signer, e.g. a → b → c, now resolves to an 'either' signer rather than a required one, and likewise inherits the resolved optionality of its default account.

  • #1286 9210c1f Thanks @lorisleiva! - Check the transforms, counts, prefixes, sizes and zero values of types that may stop a recursion in getHasFiniteValueVisitor. A constant of a type being visited hidden in, e.g., the transforms of a link or an option, or in a sentinel count, can never be created, so hasDefinedTypeFiniteValue now reports that type as having no finite value instead of accepting it.

  • #1289 f56fc28 Thanks @lorisleiva! - Depend on a PDA value's programId when it is a dataValueNode in getResolvedInstructionInputsVisitor, so the data field resolves before the PDA value, and keep the instruction account in the path of CANNOT_USE_OPTIONAL_ACCOUNT_AS_PDA_SEED_VALUE whenever the PDA value is the account's own, including when resolving an injected seed within it rebuilt the value.

  • Updated dependencies [141998e]:

    • @codama/nodes@2.0.0-rc.1
    • @codama/errors@2.0.0-rc.1
    • @codama/fragments@2.0.0-rc.1

Don't miss a new codama release

NewReleases is sending notifications on new releases.