Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement proper EVM-style types #6

Merged
merged 1 commit into from
Nov 29, 2018
Merged

Implement proper EVM-style types #6

merged 1 commit into from
Nov 29, 2018

Conversation

jakelang
Copy link
Member

@jakelang jakelang commented Aug 11, 2018

Implements the types u128, u160, and u256 with the aliases Value, Address, and Hash respectively.
This allows us to easily implement high-level functionality for EVM types in the Rust API, to be used by contract developers.

closes #4

src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
@axic
Copy link
Member

axic commented Aug 15, 2018

Needs to b rebased.

@jakelang
Copy link
Member Author

rebased

@jakelang
Copy link
Member Author

rebased again

@jakelang jakelang force-pushed the refactor-types branch 2 times, most recently from 4983e19 to 6f72842 Compare August 17, 2018 00:11
src/lib.rs Outdated Show resolved Hide resolved
@axic axic changed the title [WIP] Implement proper EVM-style types Implement proper EVM-style types Aug 17, 2018
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
@jakelang
Copy link
Member Author

Rebased

@@ -88,6 +88,29 @@ fn unsafe_alloc_buffer(len: usize) -> Vec<u8> {
ret
}

#[derive(Default, Copy, Clone)]
pub struct Uint128 {
pub bytes: [u8; 16],
Copy link
Member

Choose a reason for hiding this comment

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

Can we collapse these into "single member" structs?

Uint128([u8; 16]) ?

@jakelang jakelang force-pushed the refactor-types branch 3 times, most recently from 6283cd1 to ce4fb31 Compare November 29, 2018 19:36
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
@jakelang jakelang force-pushed the refactor-types branch 3 times, most recently from 00ce4ac to b748004 Compare November 29, 2018 19:47
@axic axic merged commit d261c59 into master Nov 29, 2018
@axic axic deleted the refactor-types branch November 29, 2018 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce higher level data types
2 participants