Andrew Jones
9fdd7df582
Default rent allowance to max_value ( #2461 )
...
* Default rent allowance to max_value
* Bump spec version
* Fix exec test
* Address grumbles
* Make test comment less specific
* Default rent_allowance to max_value in exec
* Check default balance on creation
* Check default balance in deploy
* Use hex constant
Co-Authored-By: ascjones <ascjones@gmail.com >
* More specific code const
Co-Authored-By: ascjones <ascjones@gmail.com >
* Update srml/contract/src/tests.rs
Co-Authored-By: ascjones <ascjones@gmail.com >
* Update srml/contract/src/tests.rs
Co-Authored-By: ascjones <ascjones@gmail.com >
* Update srml/contract/src/tests.rs
Co-Authored-By: ascjones <ascjones@gmail.com >
2019-05-04 13:59:14 +02:00
thiolliere
c7d9ca379d
Contract accounting removal ( #2230 )
...
* first partial implementation
* update rent allowance
* fmt
Co-Authored-By: thiolliere <gui.thiolliere@gmail.com >
* remove comments
* reward surcharge claims
* remove rent allowance in param + code_hash changed
* Fix bug
* fix tests
* fmt
* impl getter setter rent allowance
* fmt
Co-Authored-By: thiolliere <gui.thiolliere@gmail.com >
* comments
* doc + be->le
* doc
* doc
* fix improve fast return
* renamings
* rename + COMPLEXITY
* COMPLEXITY
* add test
* etrinsic claim surcharge delay configurable
* comment addressed
* move and rewrite of pay_rent
* remove child trie
* fmt
* use derive
* arithmetic operation
* fix
* fix storage root + checked_mul + test
* WIP: test
* WIP
* add tests and fix
* fmt
* typo and doc suggestions
Co-Authored-By: thiolliere <gui.thiolliere@gmail.com >
* WIP
* address some comments
divide tests + some docs
* use br_table
* remove unused function
* Bump the runtime version
* insert_with
* Add some comments.
* Refactor
* Shuffle and fix comments
* More comment fixes.
* dues limited
* Add comment
* Handicap
* Docs.
* Apply suggestions from code review
Co-Authored-By: pepyakin <s.pepyakin@gmail.com >
* Coalesce block_passed in a block
* Fix build
* Paid → Ok
* match → if
* Imrpove handicap description
2019-04-30 09:41:33 +02:00
Andrew Jones
4c115e3f2d
Replace Vec<u8> with [u8; 32] for contract storage key ( #2184 )
...
* Replace Vec<u8> with [u8; 32] for contract storage key
* Read storage keys from sandbox memory into fixed size buffer
* Increment `impl_version`
2019-04-03 10:12:54 +02:00
thiolliere
c98db99d80
implement contract events ( #2161 )
...
* 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
2019-04-03 08:20:01 +02:00
thiolliere
a0e6d96de0
keep track storage bytes ( #2154 )
...
* refactor
* fix accountinfo creation + impl mem_stored
* add comment
* improve syntax
Co-Authored-By: thiolliere <gui.thiolliere@gmail.com >
* rename current_mem_stored -> storage_size
* more explaination + more readable code
* bump impl version of node + builds
* delete builds
2019-04-01 19:14:55 +02:00
joe petrowski
0ddcbf747f
Convert all UK spelling to US ( #2138 )
...
* all the ise
* forgot a misspelling
* a few more replacements
* bump impl
* rollback and fixes
* bump impl again
* Add aliases for RPC
* Update on_demand.rs
2019-03-29 14:11:45 +01:00
thiolliere
29001cb469
Decouple contract from balances ( #2081 )
...
* decouple contract from balance
* update impls and builds
* set fees in contract module
* builds
2019-03-28 13:46:30 +01:00
cheme
dd47be51c3
Switch contract storage to child trie ( #2002 )
2019-03-22 18:01:06 +01:00
Gav Wood
dcd77a147c
Introduce safe types for handling imbalances ( #2048 )
...
* Be a little safer with total issuance.
* PairT instead of _Pair
* Remove rev causing upset
* Remove fees stuff.
* Fix build (including tests)
* Update runtime, bump version
* Fix
* Handle gas refunds properly.
* Rename identifier
ala #2025
* Address grumbles
* New not-quite-linear-typing API
* Slimmer API
* More linear-type test fixes
* Fix tests
* Tidy
* Fix some grumbles
* Keep unchecked functions private
* Remove another less-than-safe currency function and ensure that
contracts module can never create cash.
* Address a few grumbles and fix tests
2019-03-20 14:07:28 +01:00
Bastian Köcher
7927054f86
Update copyrights to 2019 ( #1932 )
2019-03-06 15:04:28 +01:00
Gav Wood
ccc11974ee
Aggregate all liquidity restrictions in a single place ( #1921 )
...
* Clean up session key rotation
* Fix build
* Bump version
* Introduce feature to balances.
* Move staking locking logic over to central point
* ^^^ rest
* First part of assimilation
* More assimilation
* More assimilation
* Fix most tests
* Fix build
* Move Balances to new locking system
* :q!
* Bump runtime version
* Build runtime
* Convenience function
* Test fix.
* Whitespace
* Improve type legibility.
* Fix comment.
* More tests.
* More tests.
* Bump version
* Caps
* Whitespace
* Whitespace
* Remove unneeded function.
2019-03-06 12:46:17 +01:00
Stanislav Tkach
ca69ad4c30
Migrate smrl-treasury and srml-upgrade-key to the 2018 edition ( #1725 )
2019-02-09 18:06:20 +01:00
thiolliere
e5dbcf6890
decouple balances from some modules ( #1641 )
...
* decouple balances from some module by creating a new traits in support/traits
* improve decl_event
2019-02-08 17:43:12 +01:00
Jordan Beauchamp
fb0f4dfb03
Expose block random seed and timestamp to contract ABI ( #1630 )
...
* Expose block random seed and timestamp to contract ABI
* Add tests
* Bump spec version
2019-02-07 10:58:02 +01:00
Sergei Pepyakin
a5cafa68b1
Update srml-contract to Rust 2018. ( #1510 )
...
* Fix imports.
* Remove redundant binding
* Clean extern crates.
* Add comment
* Re-export macros from prelude
* Build fixes
* Update core/sr-std/src/lib.rs
Co-Authored-By: pepyakin <s.pepyakin@gmail.com >
2019-01-24 16:26:53 +01:00
thiolliere
c0568ba3c6
update primitive-types and solve break changes ( #1535 )
2019-01-23 18:26:44 +01:00
Sergei Pepyakin
58cd6530be
Dispatch Calls to other modules ( #1473 )
...
* 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.
2019-01-22 13:10:14 +01:00
Sergei Pepyakin
0ad2a5fb96
Some trivial externalities added ( #1450 )
...
* Add gas_left, gas_price and balance externalities
* Add a value_transferred externality
2019-01-19 12:33:28 +01:00
Sergei Pepyakin
c88b44f6db
Contracts module rejig ( #1358 )
...
* 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: pepyakin <s.pepyakin@gmail.com >
* Update srml/contract/src/lib.rs
Co-Authored-By: pepyakin <s.pepyakin@gmail.com >
* Line wraps
* Wrapping macros
* Add _ prefix
* Grumbles
* Doc updates.
* Update srml/contract/src/wasm/mod.rs
Co-Authored-By: pepyakin <s.pepyakin@gmail.com >
* Update srml/contract/src/lib.rs
Co-Authored-By: pepyakin <s.pepyakin@gmail.com >
* 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: pepyakin <s.pepyakin@gmail.com >
* Update srml/contract/src/exec.rs
Co-Authored-By: pepyakin <s.pepyakin@gmail.com >
* Update srml/contract/src/exec.rs
Co-Authored-By: pepyakin <s.pepyakin@gmail.com >
* Recompile node_runtime
2019-01-17 12:01:12 +01:00
Sergei Pepyakin
ce91da6b89
srml-contract: introduce ext_caller external function ( #1255 )
...
* Implement ext_caller.
* Rebuild wasm.
* Update COMPLEIXTY.md
2018-12-12 14:00:21 +01:00
Sergey Pepyakin
1f0f3c8f6b
srml-contract: Extract schedule ( #1044 )
...
* 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.
2018-11-12 20:44:05 +01:00
Sergey Pepyakin
9e476ba0ab
Query dest balance only once + doc. ( #861 )
2018-10-03 13:25:14 +01:00
guanqun
bec80177c0
fix a warning ( #839 )
2018-09-29 09:34:53 +01:00
Sergey Pepyakin
955a5393d8
Load code from the overlay not from the database ( #828 )
2018-09-27 20:56:15 +01:00
Sergey Pepyakin
6af61b8649
Add test that ensures drain funds to death works ( #829 )
2018-09-27 20:55:45 +01:00
Sergey Pepyakin
98e0a3a55a
Contracts: Add transfer event ( #801 )
2018-09-25 20:49:18 +01:00
Sergey Pepyakin
ef97973178
Contracts: clean ( #788 )
...
* Extract `runtime` module
* Restructure & comment code to avoid confusion
2018-09-24 13:31:00 +02:00
Sergey Pepyakin
dcd181f31e
Contracts: return arbitrary sized buffers ( #711 )
...
* WIP
* Direct return of output data.
* Docs and renamings.
* Add get_storage test.
* Overwrite the scratch buffer.
2018-09-15 12:46:59 +02:00
Sergey Pepyakin
88ef57e4bd
Contracts: fix transfer function. ( #733 )
2018-09-13 14:25:20 +02:00
Gav Wood
1e01162505
Phase 1 of repo reorg ( #719 )
...
* 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
2018-09-12 11:13:31 +02:00