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
d218509f
Commit
d218509f
authored
Oct 24, 2019
by
Michael Müller
Committed by
Hero Bird
Oct 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Encode selectors as 4-byte array of hex strings (#214)
parent
48fb16f0
Pipeline
#54880
canceled with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
abi/src/specs.rs
abi/src/specs.rs
+5
-2
No files found.
abi/src/specs.rs
View file @
d218509f
...
...
@@ -808,7 +808,10 @@ fn serialize_selector<S>(s: &[u8; 4], serializer: S) -> Result<S::Ok, S::Error>
where
S
:
Serializer
,
{
let
hex
=
format!
(
"0x{:02X}{:02X}{:02X}{:02X}"
,
s
[
0
],
s
[
1
],
s
[
2
],
s
[
3
]);
let
hex
=
format!
(
r#"["0x{:02X}","0x{:02X}","0x{:02X}","0x{:02X}"]"#
,
s
[
0
],
s
[
1
],
s
[
2
],
s
[
3
]
);
serializer
.serialize_str
(
&
hex
)
}
...
...
@@ -834,7 +837,7 @@ mod tests {
// then
assert_eq!
(
json
,
"{
\"
name
\"
:1,
\"
selector
\"
:
\"
0x075BCD15
\"
,
\"
args
\"
:[],
\"
docs
\"
:[]}"
r#"{"name":1,"selector":"[\"0x07\",\"0x5B\",\"0xCD\",\"0x15\"]","args":[],"docs":[]}"#
);
}
}
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