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
c945b48b
Commit
c945b48b
authored
Feb 13, 2019
by
Hero Bird
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[pdsl_model] NAME consts are now [u8] to indicate non unicode
parent
b55534e0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
model/src/lib.rs
model/src/lib.rs
+5
-1
model/src/state.rs
model/src/state.rs
+5
-4
No files found.
model/src/lib.rs
View file @
c945b48b
#![cfg_attr(not(feature
=
"std"
),
no_std)]
#![feature(const_fn)]
#![feature(
const_fn,
const_str_as_bytes,
)]
#![allow(unused)]
...
...
model/src/state.rs
View file @
c945b48b
...
...
@@ -16,9 +16,10 @@ pub trait ContractState:
///
/// # Note
///
/// - This should be a valid Rust identifier.
/// - Normally you simply want to use the name of the contract here.
const
NAME
:
&
'static
str
;
/// - This must be a valid Rust identifier.
/// - Normally this reflects the name of the contract.
// const NAME: &'static str;
const
NAME
:
&
'static
[
u8
];
}
/// Define contract state with less boilerplate code.
...
...
@@ -64,7 +65,7 @@ macro_rules! state {
}
impl
pdsl_model
::
state
::
ContractState
for
$state_name
{
const
NAME
:
&
'static
str
=
stringify!
(
$state_name
);
const
NAME
:
&
'static
[
u8
]
=
stringify!
(
$state_name
)
.as_bytes
(
);
}
};
}
...
...
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