Skip to content
This repository has been archived by the owner on Feb 14, 2021. It is now read-only.

Fixed-size H* use, bigint #15

Merged
merged 2 commits into from
Sep 7, 2017
Merged

Fixed-size H* use, bigint #15

merged 2 commits into from
Sep 7, 2017

Conversation

lexfrl
Copy link
Contributor

@lexfrl lexfrl commented Sep 7, 2017

Tests refactoring to satisfy openethereum/pwasm-std#10

@lexfrl lexfrl requested a review from NikVolf September 7, 2017 18:22
Cargo.toml Outdated
@@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["NikVolf <nikvolf@gmail.com>"]

[dependencies]
pwasm-std = { git = "https://github.com/nikvolf/pwasm-std" }
pwasm-std = { git = "https://github.com/nikvolf/pwasm-std", branch = "store_hash" }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can reference master now

@NikVolf
Copy link
Collaborator

NikVolf commented Sep 7, 2017

lgtm!

@NikVolf NikVolf merged commit 230104d into master Sep 7, 2017
@NikVolf NikVolf deleted the fixed-size branch September 7, 2017 22:31

fn set_key_from_addr(key: u32, val: &[u8; 20]) {
fn set_key_from_addr(key: u32, val: &[u8]) {
let mut full_key = [0u8; 32];
let mut full_val = [0u8; 32];

write_u32(&mut full_key[0..4], key);
full_val[12..32].copy_from_slice(val);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will panic now if val length isn't 20

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a big deal, it's internal function used in limited number of cases
And we handle such panics inside wasm in a controlled way

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants