finish purging x! from ethcore

This commit is contained in:
Robert Habermeier 2016-05-31 17:18:21 +02:00
parent ff7c755930
commit 3abaeadcf3

View File

@ -59,19 +59,19 @@ mod test {
#[test] #[test]
fn create_delete() { fn create_delete() {
let a = PodState::from(map![ x!(1) => PodAccount::new(x!(69), x!(0), vec![], map![]) ]); let a = PodState::from(map![ 1.into() => PodAccount::new(69.into(), 0.into(), vec![], map![]) ]);
assert_eq!(StateDiff::diff_pod(&a, &PodState::new()), StateDiff(map![ assert_eq!(StateDiff::diff_pod(&a, &PodState::new()), StateDiff(map![
x!(1) => AccountDiff{ 1.into() => AccountDiff{
balance: Diff::Died(x!(69)), balance: Diff::Died(69.into()),
nonce: Diff::Died(x!(0)), nonce: Diff::Died(0.into()),
code: Diff::Died(vec![]), code: Diff::Died(vec![]),
storage: map![], storage: map![],
} }
])); ]));
assert_eq!(StateDiff::diff_pod(&PodState::new(), &a), StateDiff(map![ assert_eq!(StateDiff::diff_pod(&PodState::new(), &a), StateDiff(map![
x!(1) => AccountDiff{ 1.into() => AccountDiff{
balance: Diff::Born(x!(69)), balance: Diff::Born(69.into()),
nonce: Diff::Born(x!(0)), nonce: Diff::Born(0.into()),
code: Diff::Born(vec![]), code: Diff::Born(vec![]),
storage: map![], storage: map![],
} }
@ -80,23 +80,23 @@ mod test {
#[test] #[test]
fn create_delete_with_unchanged() { fn create_delete_with_unchanged() {
let a = PodState::from(map![ x!(1) => PodAccount::new(x!(69), x!(0), vec![], map![]) ]); let a = PodState::from(map![ 1.into() => PodAccount::new(69.into(), 0.into(), vec![], map![]) ]);
let b = PodState::from(map![ let b = PodState::from(map![
x!(1) => PodAccount::new(x!(69), x!(0), vec![], map![]), 1.into() => PodAccount::new(69.into(), 0.into(), vec![], map![]),
x!(2) => PodAccount::new(x!(69), x!(0), vec![], map![]) 2.into() => PodAccount::new(69.into(), 0.into(),, vec![], map![])
]); ]);
assert_eq!(StateDiff::diff_pod(&a, &b), StateDiff(map![ assert_eq!(StateDiff::diff_pod(&a, &b), StateDiff(map![
x!(2) => AccountDiff{ 2.into() => AccountDiff{
balance: Diff::Born(x!(69)), balance: Diff::Born(69.into()),
nonce: Diff::Born(x!(0)), nonce: Diff::Born(0.into()),
code: Diff::Born(vec![]), code: Diff::Born(vec![]),
storage: map![], storage: map![],
} }
])); ]));
assert_eq!(StateDiff::diff_pod(&b, &a), StateDiff(map![ assert_eq!(StateDiff::diff_pod(&b, &a), StateDiff(map![
x!(2) => AccountDiff{ 2.into() => AccountDiff{
balance: Diff::Died(x!(69)), balance: Diff::Died(69.into()),
nonce: Diff::Died(x!(0)), nonce: Diff::Died(0.into()),
code: Diff::Died(vec![]), code: Diff::Died(vec![]),
storage: map![], storage: map![],
} }
@ -106,17 +106,17 @@ mod test {
#[test] #[test]
fn change_with_unchanged() { fn change_with_unchanged() {
let a = PodState::from(map![ let a = PodState::from(map![
x!(1) => PodAccount::new(x!(69), x!(0), vec![], map![]), 1.into() => PodAccount::new(69.into(), 0.into(), vec![], map![]),
x!(2) => PodAccount::new(x!(69), x!(0), vec![], map![]) 2.into() => PodAccount::new(69.into(), 0.into(),, vec![], map![])
]); ]);
let b = PodState::from(map![ let b = PodState::from(map![
x!(1) => PodAccount::new(x!(69), x!(1), vec![], map![]), 1.into() => PodAccount::new(69.into(), 1.into(),, vec![], map![]),
x!(2) => PodAccount::new(x!(69), x!(0), vec![], map![]) 2.into() => PodAccount::new(69.into(), 0.into(),, vec![], map![])
]); ]);
assert_eq!(StateDiff::diff_pod(&a, &b), StateDiff(map![ assert_eq!(StateDiff::diff_pod(&a, &b), StateDiff(map![
x!(1) => AccountDiff{ 1.into() => AccountDiff{
balance: Diff::Same, balance: Diff::Same,
nonce: Diff::Changed(x!(0), x!(1)), nonce: Diff::Changed(0.into(), 1.into()),
code: Diff::Same, code: Diff::Same,
storage: map![], storage: map![],
} }