Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
I
ink
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
parity
ink
Commits
986bf5c0
Commit
986bf5c0
authored
Feb 17, 2019
by
Hero Bird
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[pdsl_model] Implement proper ContractInstance::deploy
parent
902a2b43
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
model/src/contract.rs
model/src/contract.rs
+12
-2
No files found.
model/src/contract.rs
View file @
986bf5c0
...
...
@@ -275,13 +275,23 @@ pub struct ContractInstance<State, DeployArgs, HandlerChain> {
handlers
:
HandlerChain
,
}
impl
<
State
,
DeployArgs
,
HandlerChain
>
Contract
for
ContractInstance
<
State
,
DeployArgs
,
HandlerChain
>
{
impl
<
State
,
DeployArgs
,
HandlerChain
>
Contract
for
ContractInstance
<
State
,
DeployArgs
,
HandlerChain
>
where
State
:
ContractState
,
DeployArgs
:
parity_codec
::
Decode
,
HandlerChain
:
crate
::
HandleCall
<
State
>
,
{
fn
deploy
(
self
)
{
// Deploys the contract state.
//
// Should be performed exactly once during contract lifetime.
// Consumes the contract since nothing should be done afterwards.
unimplemented!
()
use
pdsl_core
::
env
::
Env
;
let
input
=
pdsl_core
::
env
::
ContractEnv
::
input
();
let
deploy_params
=
DeployArgs
::
decode
(
&
mut
&
input
[
..
])
.unwrap
();
let
mut
this
=
self
;
(
this
.deployer.deploy_fn
)(
&
mut
this
.env
,
deploy_params
);
this
.env.state
.flush
()
}
fn
dispatch
(
self
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment