Releases: near/near-workspaces-rs
0.6.1
0.6.0
This release contains a couple bug fixes that should alleviate problems like sandbox processes still living after a test if a user kills the test early before termination. Recommended to upgrade to this release at the earliest convenience.
Added
Account::view
API exposed: #202
Changed
- Unstable
compile_project
uses new the workspaces errors: #204 ValueOrReceiptId::Value(String)
changed toValueOrReceiptId::Value(Value)
: #208Value
type offers convenient APIs likeraw_bytes
,json
, andborsh
like one would find from aExecutionFinalResult
.
- internal dependencies like near-jsonrpc-client upgraded to 0.4.0 from 0.4.0-beta: #210
- Note, the RNG for
SecretKey::{from_random, from_seed}(KeyType::SECP256K1, ...)
has been changed as well, and will produce different keys than before.
- Note, the RNG for
Fixed
0.5.0
This release contains a lot breaking changes, and finally removes the requirement of having to provide worker
to each function call when submitting a transaction or view request. For a full list of the breaking changes look below:
Added
- Error handling with opaque
workspaces::error::Error
type: #149 - Require
#[must_use]
on the Execution value returned bytransact()
: #150- Added
ExecutionFinalResult
,ExecutionResult
,ExecutionSuccess
andExecutionFailure
types - Added
into_result()
to easily handle#[must_use] ExecutionFinalResult
- Added
unwrap()
to not care about Err variant inExecutionResult
s
- Added
Changed
- Renamed CallExecution* types: #150
- Renamed
CallExecution`` to
Execution` - Renamed
CallExecutionDetails
toExecutionFinalResult
- Renamed
args_json
andargs_borsh
no longer returnResult
s and are deferred till later whentransact()
ed: #149- API changes from removing
worker
parameter from function calls: #181Account::from_file
function signature change, requiring a&worker
to be passed in.workspaces::prelude::*
import no longer necessary, where we no longer able to importworkspaces::prelude::DevAccountDeployer
directly.
Removed
- Removed impls from exection result: #150
- Removed
impl<T> From<CallExecution<T>> for Result<T>
- Removed
impl From<FinalExecutionOutcomeView> for CallExecutionDetails
- Removed
- No longer require
worker
to be passed in for each transaction: #181
Fixed
0.4.1
This patch release is to fix tests that would fail on macOS non-deterministically
Added
- Derive
Eq
onAccountDetails
type: https://github.com/near/workspaces-rs/pull/177/files
Fixed
- Fix macOS non-deterministic overflow error when starting up sandbox: #179
0.4.0
This release mainly adds support for M1 Macs! For other API changes, look below.
Additionally, there's potentially dependencies that aren't being resolved correctly after this update. Consider doing rm -r ~/.cargo/registry/{cache, src}
and cargo clean
to resolve this if you end up stumbling there.
Added
- Mac M1 Support: #169
- Added
Account::secret_key
to grab the account's secret key: #144 Debug
/Clone
impls forAccount
/Contract
, andDebug
forWorker
: #167ExecutionOutcome::tokens_burnt
is now available: #168
Fixed
- internally no longer creating a new RPC client per call: #154
- upped near dependencies to fix transitive vulnerabilities: #169
Changed
- Default sandbox version is now using commit hash master/13a66dda709a4148f6395636914dca2a55df1390 (July 18, 2022): #169
0.3.1
Newest patch release contains fixes for RPC timeouts being too short by upping it to 10 seconds. This caused CI services to fail from time to time especially on MacOS related builds. This also adds an env variable to customize this value if needed.
Added
- Raw bytes API similar to
json
/borsh
calls: https://github.com/near/workspaces-rs/pull/133/files - Expose
types
module and addedSecretKey
creation: #139
Fixed
0.3.0
This release includes upping the sandbox version to include the new weighted gas protocol change from near/nearcore#6285
Added
- Added betanet support #116
Changed
- Updated default sandbox version to
97c0410de519ecaca369aaee26f0ca5eb9e7de06
commit of nearcore to include 1.26 protocol changes #134
0.2.1
0.2.0
Context
This new release contains a lot of new additions. Find the relevant ones following this section. Going forward, sim-tests will be deprecated once the examples, documentation, and content around workspaces-rs have been updated. workspaces
will be the standard testing framework, providing much simpler and unified testing developer experience.
Added
- Time-traveling - the ability to go forwards in block height within tests. This allows to test time specific data changing within contracts: #73
- Credentials created from account/contract creation are now allowed to be stored and specified by users. #98
- [Unstable] Allow users to compile contract projects within tests without having to manually go through this step. #77
- Batch transactions or transactions with multiple actions are now possible. #72
- Sandbox node (nearcore binary) logs are now suppressed and can be re-enabled if desired. #85
- Results now expose logs, receipts, and transaction outcome values. #70
- Convenience methods
Worker::view_code
,Worker::view_latest_block
,Worker::view_account
,Account::view_account
,Contract::view_account
,Contract::view_code
now available. #82 - Improve error handling. If a transaction fails, this error will now be apart of the
Result
return initially. #83 - Added
tracing
logging to internal code and examples. #55 and #75 - Convenient
CallExecutionDetails::{is_success, is_failure}
for testing outcomes of transactions. #58 - Added
mainnet_archival
andtestnet_archival
, whereref-finance
example now usesmainnet_archival
. #57 and #94
Fixes
- key type for
patch_state
now a slice and no longer requireStoreKey
. #109 - Reorganized imports internally for better maintainability. #102
- No longer running into non-deterministic query failures if RPC isn't available, but this is a breaking API. All
workspaces::{sandbox, testnet, mainnet}
now require.await?
at the end. #99 - TLA trait no longer apart of all networks -- only dev-networks (sandbox, testnet). #101
- Retry times have now been shorten and should take a maximum of 1 second. #92
- doc builds on docs.rs has now been fixed. #90
patch_state
now takes in slices. #80 and #79- Make
access_key
call do optimistic queries which led to better retry times. #60 - Functions no longer take in owned but referenced
AccountId
s now. #52
Removed
- Empty JSON array is no longer a valid default argument supplied to transactions. Recommended to supply empty
{}
in the case of JSON if all function arguments in the contract are optional types. #84
0.1.1
This release includes a bugfix for installing the sandbox binaries which could potentially error out multiple tests if ran for the first time