1. Apr 03, 2019
    • thiolliere's avatar
      implement contract events (#2161) · c98db99d
      thiolliere authored
      * implement contract events
      
      * update runtime
      
      * renaming
      
      * update test code hash
      
      * improve complexity details
      
      * add deposit event base cost
      
      * add test
      
      * Revert "add deposit event base cost"
      
      This reverts commit 58ec010c0f4f4f0e16935ad41da32aedd17a8c57.
      
      * update test
      
      * Revert "update test"
      
      This reverts commit 6fe61a593ccf0d41f09a0b97472b28ed8751a999.
      
      * Revert "Revert "add deposit event base cost""
      
      This reverts commit 145e8a9bac15313a4c380aa66b94fd4d36fa3f6d.
      
      * Fix format a bit
      c98db99d
  2. Mar 28, 2019
  3. Mar 06, 2019
  4. Feb 09, 2019
  5. Feb 07, 2019
  6. Jan 30, 2019
    • Benjamin Kampmann's avatar
      Document more TODOs as tickets (#1418) · 15ae7cfe
      Benjamin Kampmann authored
      Went through the TODOs, removed a bunch, which are outdated or nothing more than a regular comment, documented a bunch more as actual tickets and made them FIXMEs and unified their structure (`FIXME #TICKETNO DESC` for local tickets, `FIXME: DESC LINK` for external tickets) for easier in-editor support. Further more remove unnecessary remarks and related old code that I noticed in that instance.
      15ae7cfe
  7. Jan 24, 2019
  8. Jan 22, 2019
    • Sergei Pepyakin's avatar
      Dispatch Calls to other modules (#1473) · 58cd6530
      Sergei Pepyakin authored
      * WIP
      
      * Use system::Origin::Signed as an origin
      
      * Add a vm test for ext_dispatch_call
      
      * Take fee for dispatching a Call
      
      # Conflicts:
      #	node/runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm
      
      * Clean & Rebuild
      
      # Conflicts:
      #	node/runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm
      
      * Dispatch call test.
      
      * Rebuild the runtime.
      
      * Fix the length of the buffer.
      
      * Rebuild binaries.
      58cd6530
  9. Jan 21, 2019
  10. Jan 19, 2019
  11. Jan 17, 2019
    • Sergei Pepyakin's avatar
      Contracts module rejig (#1358) · c88b44f6
      Sergei Pepyakin authored
      
      
      * Move prepare under code.
      
      * Schedule update
      
      * CodeHash
      
      * create takes code_hash
      
      * pass mem def and use code in vm::execute
      
      * Actually save and load code
      
      * Use T::Hash as CodeHash
      
      * Explicit entrypoint name
      
      * Return code_hash and deposit an Event
      
      * Charge for deployed code with gas.
      
      * ImportSatisfyCheck and FunctionImplProvider
      
      * Progress.
      
      * Use new infrastructure for checking imports
      
      * Rename entrypoint to entrypoint_name
      
      * Use strings instead of a Error enum
      
      * Clean
      
      * WIP
      
      * Fix macro_define_env test.
      
      * Fix vm code tests.
      
      * Remove tests for now.
      
      * Fix borked merge
      
      * Fix build for wasm
      
      * fmt
      
      * Scaffolding for abstracting vm.
      
      * Hook up execution to exec layer.
      
      * Fix vm tests.
      
      * Use schedule directly in WasmLoader
      
      * Implement test language.
      
      * Add input_data test.
      
      * Max depth test
      
      * ext_caller
      
      * Simplify test.
      
      * Add TODO
      
      * Some tests and todos.
      
      * top_level
      
      * Clean.
      
      * Restore a couple of integration tests.
      
      * Add a few comments.
      
      * Add ext_address runtime call.
      
      * Deduplicate caller/self_account
      
      * Add not_exists test.
      
      * Change bool to TransferCause.
      
      * Add address tests.
      
      * Remove output_buf from parameter.
      
      * return from start fn.
      
      * Smart gas meter
      
      * Tracing
      
      * Fix prepare tests.
      
      * Code moving
      
      * Add ExecFeeToken
      
      * Use tokens everywhere.
      
      * Make it compile in no_std.
      
      * Lift all test requirements to TestAuxiliaries
      
      * A minor clean
      
      * First create tests
      
      * Remove unneeded TODO
      
      * Docs.
      
      * Code shuffling
      
      * Rename create → instantiate
      
      * Add test address.
      
      * Code shuffling
      
      * Add base_fee tests.
      
      * rejig the code
      
      * Add some comments
      
      * on_finalise comment
      
      * Move event deposit further
      
      * Update Cargo.lock
      
      * Use crates.io version of pwasm-utils
      
      * Format todo comments
      
      * Fix formatting
      
      * Comments
      
      * EmptyOutputBuf and OutputBuf split.
      
      * Restore code_hash
      
      * Fix node-executor.
      
      * Fix typo
      
      * Fix fmt
      
      * Update srml/contract/src/account_db.rs
      
      Co-Authored-By: default avatarpepyakin <[email protected]>
      
      * Update srml/contract/src/lib.rs
      
      Co-Authored-By: default avatarpepyakin <[email protected]>
      
      * Line wraps
      
      * Wrapping macros
      
      * Add _ prefix
      
      * Grumbles
      
      * Doc updates.
      
      * Update srml/contract/src/wasm/mod.rs
      
      Co-Authored-By: default avatarpepyakin <[email protected]>
      
      * Update srml/contract/src/lib.rs
      
      Co-Authored-By: default avatarpepyakin <[email protected]>
      
      * Add comment
      
      * Use saturation to signal overflow
      
      * Add prepare_test! macro
      
      * Require deploy function.
      
      * Add entry point tests
      
      * Add comment.
      
      * Rename code → code_cache to better describe
      
      * Get rid of weird match!
      
      * Recompile binaries
      
      * Add comments
      
      * refuse_instantiate_with_value_below_existential_deposit
      
      * Little fix
      
      * Make test more complete
      
      * Clean
      
      * Add integration test for instantiation
      
      * Rebuild runtime.
      
      * Add some tests.
      
      * Attach an issue to a TODO
      
      * Attach another issue
      
      * Apply suggestions from code review
      
      Co-Authored-By: default avatarpepyakin <[email protected]>
      
      * Update srml/contract/src/exec.rs
      
      Co-Authored-By: default avatarpepyakin <[email protected]>
      
      * Update srml/contract/src/exec.rs
      
      Co-Authored-By: default avatarpepyakin <[email protected]>
      
      * Recompile node_runtime
      c88b44f6
  12. Dec 12, 2018
  13. Nov 12, 2018
    • Sergey Pepyakin's avatar
      srml-contract: Extract schedule (#1044) · 1f0f3c8f
      Sergey Pepyakin authored
      * Rename Config → Schedule.
      
      * Fetch and pass config.
      
      * Integrate config everywhere.
      
      * <<<E as Ext>::T as Trait> → <<E::T as Trait>
      
      * Update roots
      
      * Cache existential_deposit
      
      * Update COMPLEXITY.md
      
      * Update roots.
      1f0f3c8f
  14. Nov 05, 2018
  15. Oct 17, 2018
  16. Sep 24, 2018
  17. Sep 21, 2018
  18. Sep 15, 2018
  19. Sep 12, 2018
    • Gav Wood's avatar
      Phase 1 of repo reorg (#719) · 1e011625
      Gav Wood authored and Arkadiy Paronyan's avatar Arkadiy Paronyan committed
      * Remove unneeded script
      
      * Rename Substrate Demo -> Substrate
      
      * Rename demo -> node
      
      * Build wasm from last rename.
      
      * Merge ed25519 into substrate-primitives
      
      * Minor tweak
      
      * Rename substrate -> core
      
      * Move substrate-runtime-support to core/runtime/support
      
      * Rename/move substrate-runtime-version
      
      * Move codec up a level
      
      * Rename substrate-codec -> parity-codec
      
      * Move environmental up a level
      
      * Move pwasm-* up to top, ready for removal
      
      * Remove requirement of s-r-support from s-r-primitives
      
      * Move core/runtime/primitives into core/runtime-primitives
      
      * Remove s-r-support dep from s-r-version
      
      * Remove dep of s-r-support from bft
      
      * Remove dep of s-r-support from node/consensus
      
      * Sever all other core deps from s-r-support
      
      * Forgot the no_std directive
      
      * Rename non-SRML modules to sr-* to avoid match clashes
      
      * Move runtime/* to srml/*
      
      * Rename substrate-runtime-* -> srml-*
      
      * Move srml to top-level
      1e011625
  20. Sep 10, 2018
    • Sergey Pepyakin's avatar
      Integrate contracts into substrate-demo runtime (#675) · 6c1b2c27
      Sergey Pepyakin authored
      * Introduce data and salt into ContractAddressFor
      
      * Accept salt arg in ext_create.
      
      * Integrate contracts into the demo runtime
      
      * Make libcontract compile to wasm
      
      * Remove salt parameter.
      
      This now is concern of userspace.
      
      * Rebuild binaries.
      6c1b2c27
  21. Sep 01, 2018
    • Sergey Pepyakin's avatar
      Contract runtime polishing (#601) · 73ad6734
      Sergey Pepyakin authored
      * Rename ext_transfer → ext_call
      
      There are several tests where gas was changed. This is due to shrinking
      the name and consequently a size of contracts.
      
      * Fix macros
      
      Specifically, make fixes that allows to use a function without arguments (apart from ctx).
      For example:
      
      ```rust
      ext_return_42(ctx) -> u32 => {
          Ok(42)
      }
      ```
      
      Also, add impl ConvertibleToWasm for u64.
      
      * Implement passing input data buffer from top-level
      
      This allows the transaction initiator to pass some input data that can be accessed from the executed contract.
      
      However, this only works for the top-level contract. The contract still cannot pass input data to the callee contract. The reason for that is that API doesn't support this presently.
      This will be addressed in the following commits.
      
      * Input data passing thru `ext_call`
      
      `ext_call` now takes a buffer (or more specifically, pointer  to the start of and size of a buffer).
      
      This allows contracts to pass input data while calling into other contracts.
      
      * Input data passing thru `ext_create`
      
      Same as previous commit but for `ext_create`.
      
      * Trap on decoding error instead of panicking
      
      * Don't cascade failure in ext_call
      
      Instead, if callee doesn't complete successfuly, return a non-zero status code.
      
      This will prevent cascading traps up to the top-level. Due to this some tests were altered so that they now expect successful transfer instead of a failure.
      
      * Don't cascade failure in ext_create
      
      Same as previous commit but for ext_create.
      
      * Specify how much gas to allot for a call
      
      * Specify how much gas to allot for a create
      
      * Update tests.rs
      73ad6734
  22. Aug 27, 2018
    • Sergey Pepyakin's avatar
      Contract signatures checking (#478) · 4e9f4084
      Sergey Pepyakin authored
      * Convert T in vm::Ext to a associated type
      
      * WIP
      
      * Fix BTreeMap
      
      * Extract prepare module from vm.
      
      * Move tests as well.
      
      * Fix doc comment.
      
      * macro for env defintion
      
      * Fix prepare tests.
      
      * Clean up
      
      * Renamings
      
      * Refactor scan_imports
      
      * Improve docs
      
      * Docs.
      
      * Add some tests for sandbox module
      
      * Clean up
      
      * Use Error::Instantiate instead of ::Deserialize
      
      * Add test for imports
      
      * Add wrong sig import
      
      * Clean up
      
      * Rebuild binaries.
      
      * Use "another_module" instead of obscure "vne"
      
      Since "vne" looks like an actual typo
      4e9f4084