4.0.0-pre.1
Pre-release
Pre-release
·
389 commits
to master
since this release
- Implements new
LazyOption
type underunstable
feature. Similar toLazy
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 newunstable
feature which is a lazily loaded storage value. PR 409. - fix(promise):
PromiseOrValue
now correctly setsshould_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
andgenesis_config
fromRuntimeStandalone
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 ofenv::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 usesnear_sdk::sys
which is under theunstable
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 thewee_alloc
feature is not specifically disabled. In this case, the allocator can be overridden to a custom one or set manually if intended.
- This removes the re-export of
- Update
TreeMap
iterator implementation to avoid unnecessary storage reads. PR 428. - Update
AccountId
to be a newtype with merged functionality fromValidAccountId
- 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
- Removes
- 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
- This default only affects outside of
- Deprecates
env::block_index
and replaces it withenv::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
- This should not be a breaking change if using the
- 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
- If for testing you need this mocked blockchain,
- 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 utilizesBase58PublicKey
instead ofVec<u8>
directly PR 453. Usage ofBase58PublicKey
is deprecated- Expose
Receipt
and respectiveVmAction
s in mocked contexts through replacing with a local interface and types.