commit
a04d5c2af7
@ -1,4 +1,5 @@
|
|||||||
#![feature(op_assign_traits)]
|
#![feature(op_assign_traits)]
|
||||||
|
#![feature(augmented_assignments)]
|
||||||
#![feature(associated_consts)]
|
#![feature(associated_consts)]
|
||||||
#![feature(wrapping)]
|
#![feature(wrapping)]
|
||||||
//! Ethcore-util library
|
//! Ethcore-util library
|
||||||
|
@ -567,7 +567,7 @@ impl<Message> IoHandler<NetworkIoMessage<Message>> for Host<Message> where Messa
|
|||||||
self.add_node("enode://de471bccee3d042261d52e9bff31458daecc406142b401d4cd848f677479f73104b9fdeb090af9583d3391b7f10cb2ba9e26865dd5fca4fcdc0fb1e3b723c786@54.94.239.50:30303"); // BR
|
self.add_node("enode://de471bccee3d042261d52e9bff31458daecc406142b401d4cd848f677479f73104b9fdeb090af9583d3391b7f10cb2ba9e26865dd5fca4fcdc0fb1e3b723c786@54.94.239.50:30303"); // BR
|
||||||
self.add_node("enode://1118980bf48b0a3640bdba04e0fe78b1add18e1cd99bf22d53daac1fd9972ad650df52176e7c7d89d1114cfef2bc23a2959aa54998a46afcf7d91809f0855082@52.74.57.123:30303"); // SG
|
self.add_node("enode://1118980bf48b0a3640bdba04e0fe78b1add18e1cd99bf22d53daac1fd9972ad650df52176e7c7d89d1114cfef2bc23a2959aa54998a46afcf7d91809f0855082@52.74.57.123:30303"); // SG
|
||||||
// ETH/DEV cpp-ethereum (poc-9.ethdev.com)
|
// ETH/DEV cpp-ethereum (poc-9.ethdev.com)
|
||||||
self.add_node("enode://979b7fa28feeb35a4741660a16076f1943202cb72b6af70d327f053e248bab9ba81760f39d0701ef1d8f89cc1fbd2cacba0710a12cd5314d5e0c9021aa3637f9@5.1.83.226:30303");
|
self.add_node("enode://979b7fa28feeb35a4741660a16076f1943202cb72b6af70d327f053e248bab9ba81760f39d0701ef1d8f89cc1fbd2cacba0710a12cd5314d5e0c9021aa3637f9@5.1.83.226:30303");
|
||||||
}
|
}
|
||||||
|
|
||||||
fn stream_hup<'s>(&'s mut self, io: &mut IoContext<'s, NetworkIoMessage<Message>>, stream: StreamToken) {
|
fn stream_hup<'s>(&'s mut self, io: &mut IoContext<'s, NetworkIoMessage<Message>>, stream: StreamToken) {
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
/** libkeccak-tiny
|
/** libkeccak-tiny
|
||||||
|
93
src/uint.rs
93
src/uint.rs
@ -585,6 +585,68 @@ macro_rules! construct_uint {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: optimise and traitify.
|
||||||
|
|
||||||
|
impl<'a> AddAssign<&'a $name> for $name {
|
||||||
|
fn add_assign(&mut self, other: &'a Self) {
|
||||||
|
*self = self.add(*other);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'a> SubAssign<&'a $name> for $name {
|
||||||
|
fn sub_assign(&mut self, other: &'a Self) {
|
||||||
|
*self = self.sub(*other);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'a> MulAssign<&'a $name> for $name {
|
||||||
|
fn mul_assign(&mut self, other: &'a Self) {
|
||||||
|
*self = self.mul(*other);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'a> DivAssign<&'a $name> for $name {
|
||||||
|
fn div_assign(&mut self, other: &'a Self) {
|
||||||
|
*self = self.div(*other);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'a> RemAssign<&'a $name> for $name {
|
||||||
|
fn rem_assign(&mut self, other: &'a Self) {
|
||||||
|
*self = self.rem(*other);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl AddAssign<$name> for $name {
|
||||||
|
fn add_assign(&mut self, other: Self) {
|
||||||
|
*self = self.add(other);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl SubAssign<$name> for $name {
|
||||||
|
fn sub_assign(&mut self, other: Self) {
|
||||||
|
*self = self.sub(other);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl MulAssign<$name> for $name {
|
||||||
|
fn mul_assign(&mut self, other: Self) {
|
||||||
|
*self = self.mul(other);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl DivAssign<$name> for $name {
|
||||||
|
fn div_assign(&mut self, other: Self) {
|
||||||
|
*self = self.div(other);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl RemAssign<$name> for $name {
|
||||||
|
fn rem_assign(&mut self, other: Self) {
|
||||||
|
*self = self.rem(other);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl BitAnd<$name> for $name {
|
impl BitAnd<$name> for $name {
|
||||||
type Output = $name;
|
type Output = $name;
|
||||||
|
|
||||||
@ -855,6 +917,37 @@ mod tests {
|
|||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use std::num::wrapping::OverflowingOps;
|
use std::num::wrapping::OverflowingOps;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
pub fn assign_ops() {
|
||||||
|
let x: U256 = x!(69);
|
||||||
|
let y: U256 = x!(42);
|
||||||
|
{
|
||||||
|
let mut z = x;
|
||||||
|
z += y;
|
||||||
|
assert_eq!(z, x + y);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
let mut z = x;
|
||||||
|
z -= y;
|
||||||
|
assert_eq!(z, x - y);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
let mut z = x;
|
||||||
|
z *= y;
|
||||||
|
assert_eq!(z, x * y);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
let mut z = x;
|
||||||
|
z /= y;
|
||||||
|
assert_eq!(z, x / y);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
let mut z = x;
|
||||||
|
z %= y;
|
||||||
|
assert_eq!(z, x % y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
pub fn uint256_from() {
|
pub fn uint256_from() {
|
||||||
let e = U256([10, 0, 0, 0]);
|
let e = U256([10, 0, 0, 0]);
|
||||||
|
Loading…
Reference in New Issue
Block a user