Skip to content

v0.6.0

Compare
Choose a tag to compare
@turbolent turbolent released this 14 Jul 18:19
· 11463 commits to master since this release

This is a small release with some bug fixes, internal improvements, and one breaking change for code that embeds Cadence.

πŸ’₯ Breaking Changes

  • Removed the unused controller parameter from the storage interface methods:

    • func GetValue(owner, controller, key []byte) (value []byte, err error)
      β†’ func GetValue(owner, key []byte) (value []byte, err error)

    • SetValue(owner, controller, key, value []byte) (err error)
      β†’ SetValue(owner, key, value []byte) (err error)

    • ValueExists(owner, controller, key []byte) (exists bool, err error)
      β†’ ValueExists(owner, key []byte) (exists bool, err error)

    This is only a breaking change in the implementation of Cadence, i.e for code that embeds Cadence, not in the Cadence language, i.e. for users of Cadence.

⭐ Features

  • Added an optional callback for writes with high-level values to the interface:

    type HighLevelStorage interface {
    
        // HighLevelStorageEnabled should return true
        // if the functions of HighLevelStorage should be called,
        // e.g. SetCadenceValue
        HighLevelStorageEnabled() bool
    
        // SetCadenceValue sets a value for the given key in the storage, owned by the given account.
        SetCadenceValue(owner Address, key string, value cadence.Value) (err error)
    }

    This is a feature in the implementation of Cadence, i.e for code that embeds Cadence, not in the Cadence language, i.e. for users of Cadence.

πŸ›  Improvements

  • Don't report an error for a restriction with an invalid type
  • Record the occurrences of types. This enables the "Go to definition" feature for types in the language server
  • Parse member expressions without a name. This allows the checker to run. This will enable adding code completion support or members in the future.

🐞 Bug Fixes

  • Fixed a crash when checking the invocation of a function on an undeclared variable
  • Fixed handling of functions in composite values in the JSON-CDC encoding
  • Fixed a potential stack overflow when checking member storability