-
Hero Bird authored
* [core] initial implementation of new env module * [core] add SRML implementations for some more Env trait methods * [core] replace SmallVec with Vec since it isn't ready yet * [core] add license header to ret_code.rs * [core] take generic buffer params &mut instead of by value * [core] add implementation of create_contract for SRML env * [core] remove unused SmallVec imports * [core] implement deposit_event for SRML contracts env * [core] implement invoke_runtime for SRML contract env * [core] adjust invoke_runtime at trait level * [core] implement restore_to for SRML contracts env * [core] fix minor warnings and formatting issues * [core] refactoring and clean ups Output is no longer a contract property since it was too hard to make it work properly and efficiently. * [core] add initial version of EnvAccess * [core] add runtime checks to EnvAccess for input and output * [core] GetProperty and SetProperty no longer return Result * [core] introduce macro to remove some duplicate code in EnvAccess * [core] make buffer always the first argument in Env * [core] some minor clean ups * [core] implement {get,set,clear}_contract_storage for EnvAccess * [core] make assert_not_yet_returned and set_has_interacted private fns * [core] implement EnvAccess::random * [core] implement EnvAccess::println * [core] implement EnvAccess::{invoke_contract, eval_contract, create_contract} * [core] refactor module imports and exports * [core] add DynEnv utility * [core] move EnvAccess{Mut} into their own sub-module * [core] improve docs and add docs where they were missing * [core] add Default impl for EnvAccess * [core] add DynEnv * [core] greatly improve module docs * [core] remove some warning-errors that were too strict * [core] introduce initial implementation of test env * [core] initial Storage implementation for TestEnv * [core] improve module documentation * [core] continue implementation of TestEnv * [core] improve byte_utils docs for negate_bytes * [core] add new DefaultSrmlTypes implementation * [core] continue initial TestEnv implementation * [core] add TypedEncoded utility that we might use in TestEnvInstance * [core] enhance TypedEncoded utility * [core] add Debug impl for Storage and Entry * [core] implement the TestEnvInstance part of TestEnv This is the part that actually holds the data in a generic fashion and is controlled later on by the TestEnv through thread_local storage. * [core] remove unnecessary imports * [core] remove unnecessary derive impls for some marker types * [core] greatly improve doc comment of TestEnvInstance * [core] implement Clone, PartialEq, Eq and Hash for any TypedEncoded<M> * [ci] update Travis CI rust version: nightly-2019-08-30 -> nightly-2019-09-25 * [core] include TestEnv or SrmlEnv conditionally exclusively * [core] apply rust fmt * [core] use Input::remaining_len to optimize scale::Decode impl for CallData * [core] align usage of PhantomData * [core] resolve call/create TODOs * [core] fix minor doc issues * [core] add a note to Env::println to make users aware of it being a debug utility * [core] apply rust fmt * [core] add Debug impl to Storage and Entry * [core] add PartialOrd and Ord impl to TypedEncoded * [core] split TestEnv TypedEncoded types into their own module * [core] add an account database for the TestEnv * [core] move impl_get_property_for next to its macro definition * [core] enhance test::AccountsDb * [core] make fields in TestEnvInstance pub * [core] fix some mod re-exports * [core] improve AccountsDb get and get_mut interface * [core] add TypedEncoded::{assign, try_assign} methods * [core] add 'static to all EnvTypes associated types * [core] add initial implementation of accessor for TestEnvInstance * [core] rename some fields in instance.rs * [core] implement the rest of the properties getters and setters for TestEnv * [core] move Input property getter into macro * [core] add initial stubs for Env impl of TestEnv * [core] slightly improve property getters * [core] implement Env::get_contract_storage for TestEnv * [ci] update nightly-2019-09-25 -> nightly-2019-10-03 * [core] improve Storage::write by using Entry API * [core] silence warning of unused buffer in Env impl for TestEnv * [core] implement Env::set_contract_storage for TestEnv * [core] impl Env::clear_contract_storage for TestEnv * [core] add dev-comments for implementations of many Env methods for TestEnv These need some explanation since they partly contradict the off-chain nature of the TestEnv. * [core] implement Env::random for TestEnv * [core] improve dev-comment for Env::create_contract * [core] implement Env::output for TestEnv * [core] add AccountIdGen to TestEnvInstance * [core] add records to test environment module Used for later use in recording implementations of Env for TestEnv. * [core] apply rustfmt * [core] fix some warnings * [core] add constructors for records * [core] make record constructors pub * [core] apply rustfmt * [core] implement Env::{invoke_contract, eval_contract} for TestEnv * [core] implement restoration and runtime invokation records * [core] implement Env::{emit_event, invoke_runtime, restore_to} for TestEnv * [core] implement AccountsDb::insert * [core] implement Env::create_contract for TestEnv * [core] add doc-comment for test environment module * [core] fix copy/paste error in accessor.rs * [core] add initialization routines to TestEnvInstance * [core] make use of TypedEncoded in record.rs * [core] re-export concrete Env impls as EnvImpl * [core] make most of the test environment definitions publicly visible * [core] apply rustfmt * [core] fix 2 compile errors in no_std mode * [core] add doc-comments to all test sub-modules * [core] add doc-comments to EnvImpl type alias * [core] add initial implementation of TestEnv::try_initialize * [core] add dev-notes to SrmlEnv * [ci] update travis nightly usage nightly-2019-10-03 -> nightly-2019-10-04
4107f98d