Backports for beta (#1628)

* Remove soft-fork stuff.

* Fix tests.

* Fix "pending" parameter on RPC block requests (#1602)

* Initial commit.

* Pending blocks work.

* Address grumbles.

* Fix up for new API.

* Fixed test
This commit is contained in:
Arkadiy Paronyan
2016-07-15 16:44:27 +02:00
committed by GitHub
parent b7caa24c2e
commit 68dfae8f06
31 changed files with 103 additions and 26871 deletions

View File

@@ -199,8 +199,7 @@ const TRANSACTION_COUNT_SPEC: &'static [u8] = br#"{
"durationLimit": "0x0d",
"blockReward": "0x4563918244F40000",
"registrar" : "0xc6d9d2cd449a754c494264e1809c50e34d64562b",
"frontierCompatibilityModeLimit": "0xffffffffffffffff",
"daoRescueSoftFork": false
"frontierCompatibilityModeLimit": "0xffffffffffffffff"
}
}
},

View File

@@ -28,7 +28,7 @@ pub enum BlockNumber {
/// Earliest block (genesis)
Earliest,
/// Pending block (being mined)
Pending
Pending,
}
impl Deserialize for BlockNumber {
@@ -63,8 +63,8 @@ impl Into<BlockID> for BlockNumber {
match self {
BlockNumber::Num(n) => BlockID::Number(n),
BlockNumber::Earliest => BlockID::Earliest,
// TODO: change this once blockid support pendingst,
BlockNumber::Pending | BlockNumber::Latest => BlockID::Latest,
BlockNumber::Latest => BlockID::Latest,
BlockNumber::Pending => BlockID::Pending,
}
}
}
@@ -87,7 +87,7 @@ mod tests {
assert_eq!(BlockID::Number(100), BlockNumber::Num(100).into());
assert_eq!(BlockID::Earliest, BlockNumber::Earliest.into());
assert_eq!(BlockID::Latest, BlockNumber::Latest.into());
assert_eq!(BlockID::Latest, BlockNumber::Pending.into());
assert_eq!(BlockID::Pending, BlockNumber::Pending.into());
}
}