Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

WASM math test #6305

Merged
merged 2 commits into from
Aug 20, 2017
Merged

WASM math test #6305

merged 2 commits into from
Aug 20, 2017

Conversation

NikVolf
Copy link
Contributor

@NikVolf NikVolf commented Aug 15, 2017

  • auxiliary runtime changes

@NikVolf NikVolf added A3-inprogress ⏳ Pull request is in progress. No review needed at this stage. M4-core ⛓ Core client code / Rust. labels Aug 15, 2017
@NikVolf NikVolf added A0-pleasereview 🤓 Pull request needs code review. and removed A3-inprogress ⏳ Pull request is in progress. No review needed at this stage. labels Aug 18, 2017
@rphmeier rphmeier added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Aug 18, 2017
let x2 = context.value_stack.pop_as::<i32>()?;

let result = ((Runtime::bswap_32(x2 as u32) as u64) << 32
| Runtime::bswap_32(x1 as u32) as u64) as i64;
Copy link
Contributor

Choose a reason for hiding this comment

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

is that actually how it's supposed to work?
[a b c d e f g h] -> [d c b a h g f e]

instead of [h g f e d c b a]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Stack reverses the parameter ordering, so first parameter is popped last

@gavofyork gavofyork merged commit 9e4c122 into master Aug 20, 2017
@gavofyork gavofyork deleted the wasm-math branch August 20, 2017 04:03
@@ -414,3 +414,37 @@ fn storage_read() {
assert_eq!(gas_left, U256::from(99682));
assert_eq!(Address::from(&result[12..32]), address);
}


// Tests that contract's ability to read from a storage
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like there should be a different commentary..

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants