Skip to content

4.0.0-pre.1

Pre-release
Pre-release
Compare
Choose a tag to compare
@austinabell austinabell released this 23 Jul 17:05
· 389 commits to master since this release
004afcc
  • Implements new LazyOption type under unstable feature. Similar to Lazy but is optional to set a value. PR 444.
  • Move type aliases and core types to near-sdk to avoid coupling. PR 415.
  • Implements new Lazy type under the new unstable feature which is a lazily loaded storage value. PR 409.
  • fix(promise): PromiseOrValue now correctly sets should_return flag correctly on serialization. PR 407.
  • fix(tree_map): Correctly panic when range indices are exluded and start > end. PR 392.
  • Implement FromStr for json types to allow calling .parse() to convert them.
  • expose cur_block and genesis_config from RuntimeStandalone to configure simulation tests. PR 390.
  • fix(simulator): failing with long chains. PR 385.
  • Make block time configurable to sim contract tests. PR 378.
  • Deprecate env::log in favour of env::log_str. The logs assume that the bytes are utf8, so this will be a cleaner interface to use. PR 366.
  • Update syscall interface to no longer go through BLOCKCHAIN_INTERFACE. Instead uses near_sdk::sys which is under the unstable feature flag if needed. PR 417.
  • Set up global allocator by default for WASM architectures. PR 429.
    • This removes the re-export of wee_alloc because if this feature is enabled, the allocator will already be set.
    • Deprecates setup_alloc! macro as this will be set up by default, as long as the wee_alloc feature is not specifically disabled. In this case, the allocator can be overridden to a custom one or set manually if intended.
  • Update TreeMap iterator implementation to avoid unnecessary storage reads. PR 428.
  • Update AccountId to be a newtype with merged functionality from ValidAccountId
    • Removes ValidAccountId to avoid having multiple types for account IDs
    • This type will have ValidAccountId's JSON (de)serialization and the borsh serialization will be equivalent to what it was previously
  • Initializes default for BLOCKCHAIN_INTERFACE to avoid requiring to initialize testing environment for tests that don't require custom blockchain interface configuration
    • This default only affects outside of wasm32 environments and is optional/backwards compatible
  • Deprecates env::block_index and replaces it with env::block_height for more consistent naming
  • Updates internal NFT traits to not move the underlying type for methods
    • This should not be a breaking change if using the impl macros, only if implementing manually
  • Makes BLOCKCHAIN_INTERFACE a concrete type and no longer exports it.
    • If for testing you need this mocked blockchain, near_sdk::mock::with_mocked_blockchain can be used
    • near_sdk::env::take_blockchain_interface is removed, as this interface is no longer optional
    • removes BlockchainInterface trait, as this interface is only used in mocked contexts now
  • Updates Gas type to be a newtype, which makes the API harder to misuse.
    • This also changes the JSON serialization of this type to a string, to avoid precision loss when deserializing in JavaScript
  • PublicKey now utilizes Base58PublicKey instead of Vec<u8> directly PR 453. Usage of Base58PublicKey is deprecated
  • Expose Receipt and respective VmActions in mocked contexts through replacing with a local interface and types.