Merge branch 'ui-2' into menu
This commit is contained in:
commit
c37c579585
@ -254,7 +254,7 @@ linux-armv7:
|
||||
- cat .cargo/config
|
||||
- cargo build -j $(nproc) --target $PLATFORM --features final --release $CARGOFLAGS
|
||||
- arm-linux-gnueabihf-strip target/$PLATFORM/release/parity
|
||||
- export SHA3=$(rhash --sha3-256 ~/Core/parity/target/release/parity -p %h)
|
||||
- export SHA3=$(rhash --sha3-256 target/$PLATFORM/release/parity -p %h)
|
||||
- md5sum target/$PLATFORM/release/parity > parity.md5
|
||||
- sh scripts/deb-build.sh armhf
|
||||
- cp target/$PLATFORM/release/parity deb/usr/bin/parity
|
||||
@ -300,7 +300,7 @@ linux-arm:
|
||||
- cat .cargo/config
|
||||
- cargo build -j $(nproc) --target $PLATFORM --features final --release $CARGOFLAGS
|
||||
- arm-linux-gnueabihf-strip target/$PLATFORM/release/parity
|
||||
- export SHA3=$(rhash --sha3-256 ~/Core/parity/target/release/parity -p %h)
|
||||
- export SHA3=$(rhash --sha3-256 target/$PLATFORM/release/parity -p %h)
|
||||
- md5sum target/$PLATFORM/release/parity > parity.md5
|
||||
- sh scripts/deb-build.sh armhf
|
||||
- cp target/$PLATFORM/release/parity deb/usr/bin/parity
|
||||
@ -346,7 +346,7 @@ linux-armv6:
|
||||
- cat .cargo/config
|
||||
- cargo build -j $(nproc) --target $PLATFORM --features final --release $CARGOFLAGS
|
||||
- arm-linux-gnueabi-strip target/$PLATFORM/release/parity
|
||||
- export SHA3=$(rhash --sha3-256 ~/Core/parity/target/release/parity -p %h)
|
||||
- export SHA3=$(rhash --sha3-256 target/$PLATFORM/release/parity -p %h)
|
||||
- md5sum target/$PLATFORM/release/parity > parity.md5
|
||||
- aws configure set aws_access_key_id $s3_key
|
||||
- aws configure set aws_secret_access_key $s3_secret
|
||||
@ -385,7 +385,7 @@ linux-aarch64:
|
||||
- cat .cargo/config
|
||||
- cargo build -j $(nproc) --target $PLATFORM --features final --release $CARGOFLAGS
|
||||
- aarch64-linux-gnu-strip target/$PLATFORM/release/parity
|
||||
- export SHA3=$(rhash --sha3-256 ~/Core/parity/target/release/parity -p %h)
|
||||
- export SHA3=$(rhash --sha3-256 target/$PLATFORM/release/parity -p %h)
|
||||
- md5sum target/$PLATFORM/release/parity > parity.md5
|
||||
- sh scripts/deb-build.sh arm64
|
||||
- cp target/$PLATFORM/release/parity deb/usr/bin/parity
|
||||
@ -522,10 +522,10 @@ docker-build:
|
||||
script:
|
||||
- if [ "$CI_BUILD_REF_NAME" == "beta-release" ]; then DOCKER_TAG="latest"; else DOCKER_TAG=$CI_BUILD_REF_NAME; fi
|
||||
- docker login -u $Docker_Hub_User -p $Docker_Hub_Pass
|
||||
- sh scripts/docker-build.sh $DOCKER_TAG
|
||||
- sh scripts/docker-build.sh $DOCKER_TAG ethcore
|
||||
- docker logout
|
||||
- docker login -u $Docker_Hub_User_Parity -p $Docker_Hub_Pass_Parity
|
||||
- sh scripts/docker-build.sh $DOCKER_TAG
|
||||
- sh scripts/docker-build.sh $DOCKER_TAG parity
|
||||
- docker logout
|
||||
tags:
|
||||
- docker
|
||||
|
15
Cargo.lock
generated
15
Cargo.lock
generated
@ -1705,6 +1705,7 @@ dependencies = [
|
||||
"jsonrpc-ipc-server 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)",
|
||||
"jsonrpc-macros 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)",
|
||||
"jsonrpc-minihttp-server 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)",
|
||||
"jsonrpc-pubsub 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)",
|
||||
"jsonrpc-ws-server 7.0.0 (git+https://github.com/paritytech/jsonrpc.git?branch=parity-1.7)",
|
||||
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"multihash 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -1712,6 +1713,7 @@ dependencies = [
|
||||
"parity-reactor 0.1.0",
|
||||
"parity-updater 1.7.0",
|
||||
"pretty_assertions 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rlp 0.1.0",
|
||||
"rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -1721,6 +1723,7 @@ dependencies = [
|
||||
"serde_json 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"stats 0.1.0",
|
||||
"time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"tokio-timer 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"transient-hashmap 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
@ -1778,7 +1781,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "parity-ui-precompiled"
|
||||
version = "1.4.0"
|
||||
source = "git+https://github.com/paritytech/js-precompiled.git#15530d00f0a48462e764a909e15a0c74870b1fad"
|
||||
source = "git+https://github.com/paritytech/js-precompiled.git#0826776d9190ee6945bfe481e10b19ec05b3a049"
|
||||
dependencies = [
|
||||
"parity-dapps-glue 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
@ -2553,6 +2556,15 @@ dependencies = [
|
||||
"futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tokio-timer"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"futures 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tokio-uds"
|
||||
version = "0.1.4"
|
||||
@ -2986,6 +2998,7 @@ dependencies = [
|
||||
"checksum tokio-proto 0.1.0 (git+https://github.com/tomusdrw/tokio-proto)" = "<none>"
|
||||
"checksum tokio-proto 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7c0d6031f94d78d7b4d509d4a7c5e1cdf524a17e7b08d1c188a83cf720e69808"
|
||||
"checksum tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "24da22d077e0f15f55162bdbdc661228c1581892f52074fb242678d015b45162"
|
||||
"checksum tokio-timer 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "86f33def658c14724fc13ec6289b3875a8152ee8ae767a5b1ccbded363b03db8"
|
||||
"checksum tokio-uds 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bd209039933255ea77c6d7a1d18abc20b997d161acb900acca6eb74cdd049f31"
|
||||
"checksum toml 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)" = "fcd27a04ca509aff336ba5eb2abc58d456f52c4ff64d9724d88acb85ead560b6"
|
||||
"checksum toml 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a442dfc13508e603c3f763274361db7f79d7469a0e95c411cde53662ab30fc72"
|
||||
|
@ -377,7 +377,7 @@ impl Client {
|
||||
let chain = self.chain.read();
|
||||
// Check the block isn't so old we won't be able to enact it.
|
||||
let best_block_number = chain.best_block_number();
|
||||
if best_block_number >= self.history && header.number() <= best_block_number - self.history {
|
||||
if self.pruning_info().earliest_state > header.number() {
|
||||
warn!(target: "client", "Block import failed for #{} ({})\nBlock is ancient (current best block: #{}).", header.number(), header.hash(), best_block_number);
|
||||
return Err(());
|
||||
}
|
||||
@ -770,7 +770,7 @@ impl Client {
|
||||
let db = self.state_db.lock().boxed_clone();
|
||||
|
||||
// early exit for pruned blocks
|
||||
if db.is_pruned() && self.chain.read().best_block_number() >= block_number + self.history {
|
||||
if db.is_pruned() && self.pruning_info().earliest_state > block_number {
|
||||
return None;
|
||||
}
|
||||
|
||||
@ -871,7 +871,7 @@ impl Client {
|
||||
let best_block_number = self.chain_info().best_block_number;
|
||||
let block_number = self.block_number(at).ok_or(snapshot::Error::InvalidStartingBlock(at))?;
|
||||
|
||||
if best_block_number > self.history + block_number && db.is_pruned() {
|
||||
if db.is_pruned() && self.pruning_info().earliest_state > block_number {
|
||||
return Err(snapshot::Error::OldBlockPrunedDB.into());
|
||||
}
|
||||
|
||||
@ -1354,8 +1354,7 @@ impl BlockChainClient for Client {
|
||||
.collect();
|
||||
match (transaction, previous_receipts) {
|
||||
(Some(transaction), Some(previous_receipts)) => {
|
||||
let schedule = self.engine().schedule(block_number);
|
||||
Some(transaction_receipt(&schedule, transaction, previous_receipts))
|
||||
Some(transaction_receipt(self.engine(), transaction, previous_receipts))
|
||||
},
|
||||
_ => None,
|
||||
}
|
||||
@ -1748,7 +1747,7 @@ impl Drop for Client {
|
||||
|
||||
/// Returns `LocalizedReceipt` given `LocalizedTransaction`
|
||||
/// and a vector of receipts from given block up to transaction index.
|
||||
fn transaction_receipt(schedule: &Schedule, mut tx: LocalizedTransaction, mut receipts: Vec<Receipt>) -> LocalizedReceipt {
|
||||
fn transaction_receipt(engine: &Engine, mut tx: LocalizedTransaction, mut receipts: Vec<Receipt>) -> LocalizedReceipt {
|
||||
assert_eq!(receipts.len(), tx.transaction_index + 1, "All previous receipts are provided.");
|
||||
|
||||
let sender = tx.sender();
|
||||
@ -1772,7 +1771,7 @@ fn transaction_receipt(schedule: &Schedule, mut tx: LocalizedTransaction, mut re
|
||||
gas_used: receipt.gas_used - prior_gas_used,
|
||||
contract_address: match tx.action {
|
||||
Action::Call(_) => None,
|
||||
Action::Create => Some(contract_address(schedule.create_address, &sender, &tx.nonce, &tx.data.sha3()))
|
||||
Action::Create => Some(contract_address(engine.create_address_scheme(block_number), &sender, &tx.nonce, &tx.data.sha3()))
|
||||
},
|
||||
logs: receipt.logs.into_iter().enumerate().map(|(i, log)| LocalizedLogEntry {
|
||||
entry: log,
|
||||
@ -1827,17 +1826,17 @@ mod tests {
|
||||
#[test]
|
||||
fn should_return_correct_log_index() {
|
||||
use super::transaction_receipt;
|
||||
use evm::schedule::Schedule;
|
||||
use ethkey::KeyPair;
|
||||
use log_entry::{LogEntry, LocalizedLogEntry};
|
||||
use receipt::{Receipt, LocalizedReceipt};
|
||||
use transaction::{Transaction, LocalizedTransaction, Action};
|
||||
use util::Hashable;
|
||||
use tests::helpers::TestEngine;
|
||||
|
||||
// given
|
||||
let key = KeyPair::from_secret_slice(&"test".sha3()).unwrap();
|
||||
let secret = key.secret();
|
||||
let schedule = Schedule::new_homestead();
|
||||
let engine = TestEngine::new(0);
|
||||
|
||||
let block_number = 1;
|
||||
let block_hash = 5.into();
|
||||
@ -1881,7 +1880,7 @@ mod tests {
|
||||
}];
|
||||
|
||||
// when
|
||||
let receipt = transaction_receipt(&schedule, transaction, receipts);
|
||||
let receipt = transaction_receipt(&engine, transaction, receipts);
|
||||
|
||||
// then
|
||||
assert_eq!(receipt, LocalizedReceipt {
|
||||
|
@ -48,6 +48,7 @@ use receipt::Receipt;
|
||||
use snapshot::SnapshotComponents;
|
||||
use spec::CommonParams;
|
||||
use transaction::{UnverifiedTransaction, SignedTransaction};
|
||||
use evm::CreateContractAddress;
|
||||
|
||||
use ethkey::Signature;
|
||||
use util::*;
|
||||
@ -294,4 +295,9 @@ pub trait Engine : Sync + Send {
|
||||
fn snapshot_components(&self) -> Option<Box<SnapshotComponents>> {
|
||||
None
|
||||
}
|
||||
|
||||
/// Returns new contract address generation scheme at given block number.
|
||||
fn create_address_scheme(&self, number: BlockNumber) -> CreateContractAddress {
|
||||
if number >= self.params().eip86_transition { CreateContractAddress::FromCodeHash } else { CreateContractAddress::FromSenderAndNonce }
|
||||
}
|
||||
}
|
||||
|
@ -278,7 +278,7 @@ lazy_static! {
|
||||
arr[RETURN as usize] = InstructionInfo::new("RETURN", 0, 2, 0, true, GasPriceTier::Zero);
|
||||
arr[DELEGATECALL as usize] = InstructionInfo::new("DELEGATECALL", 0, 6, 1, true, GasPriceTier::Special);
|
||||
arr[SUICIDE as usize] = InstructionInfo::new("SUICIDE", 0, 1, 0, true, GasPriceTier::Special);
|
||||
arr[CREATE_P2SH as usize] = InstructionInfo::new("CREATE_P2SH", 0, 3, 1, true, GasPriceTier::Special);
|
||||
arr[CREATE2 as usize] = InstructionInfo::new("CREATE2", 0, 3, 1, true, GasPriceTier::Special);
|
||||
arr
|
||||
};
|
||||
}
|
||||
@ -555,7 +555,7 @@ pub const RETURN: Instruction = 0xf3;
|
||||
/// like CALLCODE but keeps caller's value and sender
|
||||
pub const DELEGATECALL: Instruction = 0xf4;
|
||||
/// create a new account and set creation address to sha3(sender + sha3(init code)) % 2**160
|
||||
pub const CREATE_P2SH: Instruction = 0xfb;
|
||||
pub const CREATE2: Instruction = 0xfb;
|
||||
/// halt execution and register account for later deletion
|
||||
pub const SUICIDE: Instruction = 0xff;
|
||||
|
||||
|
@ -223,7 +223,7 @@ impl<Gas: CostType> Gasometer<Gas> {
|
||||
|
||||
Request::GasMemProvide(gas, mem, Some(requested))
|
||||
},
|
||||
instructions::CREATE | instructions::CREATE_P2SH => {
|
||||
instructions::CREATE | instructions::CREATE2 => {
|
||||
let gas = Gas::from(schedule.create_gas);
|
||||
let mem = mem_needed(stack.peek(1), stack.peek(2))?;
|
||||
|
||||
|
@ -183,7 +183,7 @@ impl<Cost: CostType> Interpreter<Cost> {
|
||||
let schedule = ext.schedule();
|
||||
|
||||
if (instruction == instructions::DELEGATECALL && !schedule.have_delegate_call) ||
|
||||
(instruction == instructions::CREATE_P2SH && !schedule.have_create_p2sh) {
|
||||
(instruction == instructions::CREATE2 && !schedule.have_create2) {
|
||||
|
||||
return Err(evm::Error::BadInstruction {
|
||||
instruction: instruction
|
||||
@ -268,12 +268,12 @@ impl<Cost: CostType> Interpreter<Cost> {
|
||||
instructions::JUMPDEST => {
|
||||
// ignore
|
||||
},
|
||||
instructions::CREATE | instructions::CREATE_P2SH => {
|
||||
instructions::CREATE | instructions::CREATE2 => {
|
||||
let endowment = stack.pop_back();
|
||||
let init_off = stack.pop_back();
|
||||
let init_size = stack.pop_back();
|
||||
|
||||
let address_scheme = if instruction == instructions::CREATE { ext.schedule().create_address } else { CreateContractAddress::FromSenderAndCodeHash };
|
||||
let address_scheme = if instruction == instructions::CREATE { CreateContractAddress::FromSenderAndNonce } else { CreateContractAddress::FromSenderAndCodeHash };
|
||||
let create_gas = provided.expect("`provided` comes through Self::exec from `Gasometer::get_gas_cost_mem`; `gas_gas_mem_cost` guarantees `Some` when instruction is `CALL`/`CALLCODE`/`DELEGATECALL`/`CREATE`; this is `CREATE`; qed");
|
||||
|
||||
let contract_code = self.mem.read_slice(init_off, init_size);
|
||||
|
@ -15,7 +15,6 @@
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
//! Cost schedule and other parameterisations for the EVM.
|
||||
use evm::CreateContractAddress;
|
||||
|
||||
/// Definition of the cost schedule and other parameterisations for the EVM.
|
||||
pub struct Schedule {
|
||||
@ -24,7 +23,7 @@ pub struct Schedule {
|
||||
/// Does it have a delegate cal
|
||||
pub have_delegate_call: bool,
|
||||
/// Does it have a CREATE_P2SH instruction
|
||||
pub have_create_p2sh: bool,
|
||||
pub have_create2: bool,
|
||||
/// VM stack limit
|
||||
pub stack_limit: usize,
|
||||
/// Max number of nested calls/creates
|
||||
@ -102,8 +101,6 @@ pub struct Schedule {
|
||||
pub no_empty: bool,
|
||||
/// Kill empty accounts if touched.
|
||||
pub kill_empty: bool,
|
||||
/// Contract address generation scheme
|
||||
pub create_address: CreateContractAddress,
|
||||
}
|
||||
|
||||
impl Schedule {
|
||||
@ -118,11 +115,11 @@ impl Schedule {
|
||||
}
|
||||
|
||||
/// Schedule for the post-EIP-150-era of the Ethereum main net.
|
||||
pub fn new_post_eip150(max_code_size: usize, fix_exp: bool, no_empty: bool, kill_empty: bool, have_create_p2sh: bool) -> Schedule {
|
||||
pub fn new_post_eip150(max_code_size: usize, fix_exp: bool, no_empty: bool, kill_empty: bool, have_metropolis_instructions: bool) -> Schedule {
|
||||
Schedule {
|
||||
exceptional_failed_code_deposit: true,
|
||||
have_delegate_call: true,
|
||||
have_create_p2sh: have_create_p2sh,
|
||||
have_create2: have_metropolis_instructions,
|
||||
stack_limit: 1024,
|
||||
max_depth: 1024,
|
||||
tier_step_gas: [0, 2, 3, 5, 8, 10, 20, 0],
|
||||
@ -161,7 +158,6 @@ impl Schedule {
|
||||
sub_gas_cap_divisor: Some(64),
|
||||
no_empty: no_empty,
|
||||
kill_empty: kill_empty,
|
||||
create_address: if have_create_p2sh { CreateContractAddress::FromCodeHash } else { CreateContractAddress::FromSenderAndNonce },
|
||||
}
|
||||
}
|
||||
|
||||
@ -174,7 +170,7 @@ impl Schedule {
|
||||
Schedule {
|
||||
exceptional_failed_code_deposit: efcd,
|
||||
have_delegate_call: hdc,
|
||||
have_create_p2sh: false,
|
||||
have_create2: false,
|
||||
stack_limit: 1024,
|
||||
max_depth: 1024,
|
||||
tier_step_gas: [0, 2, 3, 5, 8, 10, 20, 0],
|
||||
@ -213,7 +209,6 @@ impl Schedule {
|
||||
sub_gas_cap_divisor: None,
|
||||
no_empty: false,
|
||||
kill_empty: false,
|
||||
create_address: CreateContractAddress::FromSenderAndNonce,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ impl<'a, B: 'a + StateBackend> Executive<'a, B> {
|
||||
let (gas_left, output) = match t.action {
|
||||
Action::Create => {
|
||||
let code_hash = t.data.sha3();
|
||||
let new_address = contract_address(schedule.create_address, &sender, &nonce, &code_hash);
|
||||
let new_address = contract_address(self.engine.create_address_scheme(self.info.number), &sender, &nonce, &code_hash);
|
||||
let params = ActionParams {
|
||||
code_address: new_address.clone(),
|
||||
code_hash: code_hash,
|
||||
@ -386,8 +386,8 @@ impl<'a, B: 'a + StateBackend> Executive<'a, B> {
|
||||
vm_tracer: &mut V,
|
||||
) -> evm::Result<U256> where T: Tracer, V: VMTracer {
|
||||
|
||||
let schedule = self.engine.schedule(self.info.number);
|
||||
if schedule.create_address != CreateContractAddress::FromSenderAndNonce && self.state.exists(¶ms.address)? {
|
||||
let scheme = self.engine.create_address_scheme(self.info.number);
|
||||
if scheme != CreateContractAddress::FromSenderAndNonce && self.state.exists_and_has_code(¶ms.address)? {
|
||||
return Err(evm::Error::OutOfGas);
|
||||
}
|
||||
|
||||
@ -398,6 +398,7 @@ impl<'a, B: 'a + StateBackend> Executive<'a, B> {
|
||||
let mut unconfirmed_substate = Substate::new();
|
||||
|
||||
// create contract and transfer value to it if necessary
|
||||
let schedule = self.engine.schedule(self.info.number);
|
||||
let nonce_offset = if schedule.no_empty {1} else {0}.into();
|
||||
let prev_bal = self.state.balance(¶ms.address)?;
|
||||
if let ActionValue::Transfer(val) = params.value {
|
||||
|
@ -1048,7 +1048,7 @@ impl MinerService for Miner {
|
||||
Action::Call(_) => None,
|
||||
Action::Create => {
|
||||
let sender = tx.sender();
|
||||
Some(contract_address(self.engine.schedule(pending.header().number()).create_address, &sender, &tx.nonce, &tx.data.sha3()))
|
||||
Some(contract_address(self.engine.create_address_scheme(pending.header().number()), &sender, &tx.nonce, &tx.data.sha3()))
|
||||
}
|
||||
},
|
||||
logs: receipt.logs.clone(),
|
||||
|
@ -238,7 +238,7 @@ pub fn check_proof(
|
||||
/// Reverting a checkpoint with `revert_to_checkpoint` involves copying
|
||||
/// original values from the latest checkpoint back into `cache`. The code
|
||||
/// takes care not to overwrite cached storage while doing that.
|
||||
/// checkpoint can be discateded with `discard_checkpoint`. All of the orignal
|
||||
/// checkpoint can be discarded with `discard_checkpoint`. All of the orignal
|
||||
/// backed-up values are moved into a parent checkpoint (if any).
|
||||
///
|
||||
pub struct State<B: Backend> {
|
||||
@ -433,6 +433,11 @@ impl<B: Backend> State<B> {
|
||||
self.ensure_cached(a, RequireCache::None, false, |a| a.map_or(false, |a| !a.is_null()))
|
||||
}
|
||||
|
||||
/// Determine whether an account exists and has code.
|
||||
pub fn exists_and_has_code(&self, a: &Address) -> trie::Result<bool> {
|
||||
self.ensure_cached(a, RequireCache::CodeSize, false, |a| a.map_or(false, |a| a.code_size().map_or(false, |size| size != 0)))
|
||||
}
|
||||
|
||||
/// Get the balance of account `a`.
|
||||
pub fn balance(&self, a: &Address) -> trie::Result<U256> {
|
||||
self.ensure_cached(a, RequireCache::None, true,
|
||||
|
@ -34,6 +34,9 @@ pub const KEY_LENGTH: usize = 32;
|
||||
pub const KEY_ITERATIONS: usize = 10240;
|
||||
pub const KEY_LENGTH_AES: usize = KEY_LENGTH / 2;
|
||||
|
||||
/// Default MAC to use (in RPC).
|
||||
pub const DEFAULT_MAC: [u8; 2] = [0, 0];
|
||||
|
||||
#[derive(PartialEq, Debug)]
|
||||
pub enum ScryptError {
|
||||
// log(N) < r / 16
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "parity.js",
|
||||
"version": "1.7.65",
|
||||
"version": "1.7.69",
|
||||
"main": "release/index.js",
|
||||
"jsnext:main": "src/index.js",
|
||||
"author": "Parity Team <admin@parity.io>",
|
||||
@ -148,7 +148,7 @@
|
||||
"stylelint": "7.9.0",
|
||||
"stylelint-config-standard": "16.0.0",
|
||||
"to-source": "2.0.3",
|
||||
"uglify-js": "2.8.16",
|
||||
"uglify-js": "2.8.22",
|
||||
"url-loader": "0.5.7",
|
||||
"webpack": "2.2.1",
|
||||
"webpack-bundle-size-analyzer": "2.5.0",
|
||||
@ -162,6 +162,7 @@
|
||||
"@parity/abi": "file:src/abi",
|
||||
"@parity/api": "file:src/api",
|
||||
"@parity/jsonrpc": "file:src/jsonrpc",
|
||||
"@parity/shared": "file:src/shared",
|
||||
"@parity/ui": "file:src/ui",
|
||||
"@parity/wordlist": "1.0.1",
|
||||
"base32.js": "0.1.0",
|
||||
|
@ -99,15 +99,15 @@ export default class Event {
|
||||
const namedTokens = {};
|
||||
|
||||
topicParams.forEach((param, idx) => {
|
||||
namedTokens[param.name] = topicTokens[idx];
|
||||
namedTokens[param.name || idx] = topicTokens[idx];
|
||||
});
|
||||
dataParams.forEach((param, idx) => {
|
||||
namedTokens[param.name] = dataTokens[idx];
|
||||
namedTokens[param.name || idx] = dataTokens[idx];
|
||||
});
|
||||
|
||||
const inputParamTypes = this.inputParamTypes();
|
||||
const decodedParams = this.inputParamNames()
|
||||
.map((name, idx) => new DecodedLogParam(name, inputParamTypes[idx], namedTokens[name]));
|
||||
.map((name, idx) => new DecodedLogParam(name, inputParamTypes[idx], namedTokens[name || idx]));
|
||||
|
||||
return new DecodedLog(decodedParams, address);
|
||||
}
|
||||
|
@ -182,10 +182,11 @@ export default class Contract {
|
||||
log.params = {};
|
||||
log.event = event.name;
|
||||
|
||||
decoded.params.forEach((param) => {
|
||||
decoded.params.forEach((param, index) => {
|
||||
const { type, value } = param.token;
|
||||
const key = param.name || index;
|
||||
|
||||
log.params[param.name] = { type, value };
|
||||
log.params[key] = { type, value };
|
||||
});
|
||||
|
||||
return log;
|
||||
|
@ -93,6 +93,16 @@ export function outChainStatus (status) {
|
||||
}
|
||||
|
||||
export function outDate (date) {
|
||||
if (typeof date.toISOString === 'function') {
|
||||
return date;
|
||||
}
|
||||
|
||||
try {
|
||||
if (typeof date === 'string' && (new Date(date)).toISOString() === date) {
|
||||
return new Date(date);
|
||||
}
|
||||
} catch (error) {}
|
||||
|
||||
return new Date(outNumber(date).toNumber() * 1000);
|
||||
}
|
||||
|
||||
|
@ -70,11 +70,21 @@ export default class Parity {
|
||||
.execute('parity_checkRequest', inNumber16(requestId));
|
||||
}
|
||||
|
||||
cidV0 (data) {
|
||||
return this._transport
|
||||
.execute('parity_cidV0', inData(data));
|
||||
}
|
||||
|
||||
closeVault (vaultName) {
|
||||
return this._transport
|
||||
.execute('parity_closeVault', vaultName);
|
||||
}
|
||||
|
||||
composeTransaction (options) {
|
||||
return this._transport
|
||||
.execute('parity_composeTransaction', inOptions(options));
|
||||
}
|
||||
|
||||
consensusCapability () {
|
||||
return this._transport
|
||||
.execute('parity_consensusCapability');
|
||||
|
@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import builtinsJson from '~/config/dappsBuiltin.json';
|
||||
import builtinsJson from '@parity/shared/config/dappsBuiltin.json';
|
||||
|
||||
const REGISTER_URLS = {
|
||||
console: 'https://raw.githubusercontent.com/paritytech/console/3ea0dbfefded359ccdbea37bc4cf350c0aa16948/console.jpeg',
|
||||
|
@ -14,7 +14,8 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import abi from '~/contracts/abi/badgereg';
|
||||
import abi from '@parity/shared/contracts/abi/badgereg';
|
||||
|
||||
import { compiler, source as sourceUrl, output as byteCode } from './code/badgereg';
|
||||
|
||||
const id = 'badgereg';
|
||||
|
@ -14,7 +14,8 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import abi from '~/contracts/abi/dappreg';
|
||||
import abi from '@parity/shared/contracts/abi/dappreg';
|
||||
|
||||
import { compiler, source as sourceUrl, output as byteCode } from './code/dappreg';
|
||||
|
||||
const id = 'dappreg'; // 7bbc4f1a27628781b96213e781a1b8eec6982c1db8fac739af6e4c5a55862c03
|
||||
|
@ -14,7 +14,8 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import abi from '~/contracts/abi/gavcoin';
|
||||
import abi from '@parity/shared/contracts/abi/gavcoin';
|
||||
|
||||
import { compiler, source as sourceUrl, output as byteCode } from './code/gavcoin';
|
||||
|
||||
const isExternal = true;
|
||||
|
@ -14,7 +14,8 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import abi from '~/contracts/abi/githubhint';
|
||||
import abi from '@parity/shared/contracts/abi/githubhint';
|
||||
|
||||
import { compiler, source as sourceUrl, output as byteCode } from './code/githubhint';
|
||||
|
||||
const id = 'githubhint';
|
||||
|
@ -14,7 +14,8 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import abi from '~/contracts/abi/registry2';
|
||||
import abi from '@parity/shared/contracts/abi/registry2';
|
||||
|
||||
import { compiler, source as sourceUrl, output as byteCode } from './code/registry';
|
||||
|
||||
const id = 'registry';
|
||||
|
@ -14,7 +14,8 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import abi from '~/contracts/abi/signaturereg';
|
||||
import abi from '@parity/shared/contracts/abi/signaturereg';
|
||||
|
||||
import { compiler, source as sourceUrl, output as byteCode } from './code/signaturereg';
|
||||
|
||||
const id = 'signaturereg';
|
||||
|
@ -14,7 +14,8 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import abi from '~/contracts/abi/basiccoinmanager';
|
||||
import abi from '@parity/shared/contracts/abi/basiccoinmanager';
|
||||
|
||||
import { compiler, source as sourceUrl, output as byteCode } from './code/tokendeploy';
|
||||
|
||||
const id = 'basiccoinmgr';
|
||||
|
@ -14,7 +14,8 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import abi from '~/contracts/abi/tokenreg';
|
||||
import abi from '@parity/shared/contracts/abi/tokenreg';
|
||||
|
||||
import { compiler, source as sourceUrl, output as byteCode } from './code/tokenreg';
|
||||
|
||||
const id = 'tokenreg';
|
||||
|
@ -14,7 +14,8 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import abi from '~/contracts/abi/email-verification';
|
||||
import abi from '@parity/shared/contracts/abi/email-verification';
|
||||
|
||||
import { compiler, source as sourceUrl, output as byteCode } from './code/verifyEmail';
|
||||
|
||||
const isBadge = true;
|
||||
|
@ -14,7 +14,8 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import abi from '~/contracts/abi/sms-verification';
|
||||
import abi from '@parity/shared/contracts/abi/sms-verification';
|
||||
|
||||
import { compiler, source as sourceUrl, output as byteCode } from './code/verifySms';
|
||||
|
||||
const isBadge = true;
|
||||
|
@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import { walletCompiler as compiler, walletLibrary as byteCode, walletLibraryABI as abiJson, walletLibraryRegKey as id, walletSource as sourceUrl } from '~/contracts/code/wallet';
|
||||
import { walletCompiler as compiler, walletLibrary as byteCode, walletLibraryABI as abiJson, walletLibraryRegKey as id, walletSource as sourceUrl } from '@parity/shared/contracts/code/wallet';
|
||||
|
||||
const abi = JSON.parse(abiJson);
|
||||
const deployParams = [];
|
||||
|
@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import builtins from '~/config/dappsBuiltin.json';
|
||||
import builtins from '@parity/shared/config/dappsBuiltin.json';
|
||||
|
||||
const id = 'console';
|
||||
const app = builtins.find((app) => app.url === id);
|
||||
|
@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import builtins from '~/config/dappsBuiltin.json';
|
||||
import builtins from '@parity/shared/config/dappsBuiltin.json';
|
||||
|
||||
const id = 'dappreg';
|
||||
const app = builtins.find((app) => app.url === id);
|
||||
|
@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import builtins from '~/config/dappsBuiltin.json';
|
||||
import builtins from '@parity/shared/config/dappsBuiltin.json';
|
||||
|
||||
const id = 'githubhint';
|
||||
const app = builtins.find((app) => app.url === id);
|
||||
|
@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import builtins from '~/config/dappsBuiltin.json';
|
||||
import builtins from '@parity/shared/config/dappsBuiltin.json';
|
||||
|
||||
const id = 'localtx';
|
||||
const app = builtins.find((app) => app.url === id);
|
||||
|
@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import builtins from '~/config/dappsBuiltin.json';
|
||||
import builtins from '@parity/shared/config/dappsBuiltin.json';
|
||||
|
||||
const id = 'registry';
|
||||
const app = builtins.find((app) => app.url === id);
|
||||
|
@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import builtins from '~/config/dappsBuiltin.json';
|
||||
import builtins from '@parity/shared/config/dappsBuiltin.json';
|
||||
|
||||
const id = 'signaturereg';
|
||||
const app = builtins.find((app) => app.url === id);
|
||||
|
@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import builtins from '~/config/dappsBuiltin.json';
|
||||
import builtins from '@parity/shared/config/dappsBuiltin.json';
|
||||
|
||||
const id = 'tokendeploy';
|
||||
const app = builtins.find((app) => app.url === id);
|
||||
|
@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import builtins from '~/config/dappsBuiltin.json';
|
||||
import builtins from '@parity/shared/config/dappsBuiltin.json';
|
||||
|
||||
const id = 'tokenreg';
|
||||
const app = builtins.find((app) => app.url === id);
|
||||
|
@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import builtins from '~/config/dappsBuiltin.json';
|
||||
import builtins from '@parity/shared/config/dappsBuiltin.json';
|
||||
|
||||
const id = 'web';
|
||||
const app = builtins.find((app) => app.url === id);
|
||||
|
@ -18,9 +18,9 @@ import BigNumber from 'bignumber.js';
|
||||
import { action, computed, observable, transaction } from 'mobx';
|
||||
import { flatten } from 'lodash';
|
||||
|
||||
import * as abis from '~/contracts/abi';
|
||||
import Contracts from '~/contracts';
|
||||
import builtinJson from '~/config/dappsBuiltin.json';
|
||||
import * as abis from '@parity/shared/contracts/abi';
|
||||
import Contracts from '@parity/shared/contracts';
|
||||
import builtinJson from '@parity/shared/config/dappsBuiltin.json';
|
||||
|
||||
import Dapp from './dappStore.js';
|
||||
import { deleteDapp, registerDapp, updateDapp } from './utils';
|
||||
|
@ -14,7 +14,8 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import * as abis from '~/contracts/abi';
|
||||
import * as abis from '@parity/shared/contracts/abi';
|
||||
|
||||
import { api } from './parity';
|
||||
|
||||
let defaultSubscriptionId;
|
||||
|
@ -17,7 +17,7 @@
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import '../../../environment/tests';
|
||||
import '@parity/shared/environment/tests';
|
||||
|
||||
import Application from './application';
|
||||
|
||||
|
@ -17,8 +17,8 @@
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
|
||||
import '../../../environment/tests';
|
||||
import EthApi from '../../../api';
|
||||
import EthApi from '@parity/api';
|
||||
import '@parity/shared/environment/tests';
|
||||
|
||||
// Mock API for tests
|
||||
import * as Api from '../parity';
|
||||
|
19
js/src/dapps/package.json
Normal file
19
js/src/dapps/package.json
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "@parity/dapps",
|
||||
"description": "Parity dapps",
|
||||
"version": "0.0.0",
|
||||
"main": "index.js",
|
||||
"author": "Parity Team <admin@parity.io>",
|
||||
"maintainers": [],
|
||||
"contributors": [],
|
||||
"license": "GPL-3.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/paritytech/parity.git"
|
||||
},
|
||||
"keywords": [],
|
||||
"scripts": {},
|
||||
"devDependencies": {},
|
||||
"dependencies": {},
|
||||
"peerDependencies": {}
|
||||
}
|
@ -22,7 +22,8 @@ const muiTheme = getMuiTheme(lightBaseTheme);
|
||||
import CircularProgress from 'material-ui/CircularProgress';
|
||||
import { Card, CardText } from 'material-ui/Card';
|
||||
|
||||
import { nullableProptype } from '~/util/proptypes';
|
||||
import { nullableProptype } from '@parity/shared/util/proptypes';
|
||||
|
||||
import { api } from '../parity';
|
||||
|
||||
import styles from './application.css';
|
||||
|
@ -18,7 +18,7 @@ import React, { Component, PropTypes } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { bindActionCreators } from 'redux';
|
||||
|
||||
import { nullableProptype } from '~/util/proptypes';
|
||||
import { nullableProptype } from '@parity/shared/util/proptypes';
|
||||
|
||||
import Application from './Application';
|
||||
import * as actions from './actions';
|
||||
|
@ -25,7 +25,7 @@ import DropDownMenu from 'material-ui/DropDownMenu';
|
||||
import MenuItem from 'material-ui/MenuItem';
|
||||
import keycode from 'keycode';
|
||||
|
||||
import { nullableProptype } from '~/util/proptypes';
|
||||
import { nullableProptype } from '@parity/shared/util/proptypes';
|
||||
|
||||
import Address from '../ui/address.js';
|
||||
import renderImage from '../ui/image.js';
|
||||
|
@ -24,7 +24,8 @@ import MenuItem from 'material-ui/MenuItem';
|
||||
import RaisedButton from 'material-ui/RaisedButton';
|
||||
import CheckIcon from 'material-ui/svg-icons/navigation/check';
|
||||
|
||||
import { nullableProptype } from '~/util/proptypes';
|
||||
import { nullableProptype } from '@parity/shared/util/proptypes';
|
||||
|
||||
import { fromWei } from '../parity.js';
|
||||
|
||||
import { clearError, reserve, drop } from './actions';
|
||||
|
@ -24,7 +24,8 @@ import MenuItem from 'material-ui/MenuItem';
|
||||
import RaisedButton from 'material-ui/RaisedButton';
|
||||
import SaveIcon from 'material-ui/svg-icons/content/save';
|
||||
|
||||
import { nullableProptype } from '~/util/proptypes';
|
||||
import { nullableProptype } from '@parity/shared/util/proptypes';
|
||||
|
||||
import { clearError, update } from './actions';
|
||||
import styles from './records.css';
|
||||
|
||||
|
@ -21,7 +21,8 @@ import {
|
||||
Card, CardHeader, CardText, TextField, DropDownMenu, MenuItem, RaisedButton
|
||||
} from 'material-ui';
|
||||
|
||||
import { nullableProptype } from '~/util/proptypes';
|
||||
import { nullableProptype } from '@parity/shared/util/proptypes';
|
||||
|
||||
import { AddIcon, CheckIcon } from '~/ui/Icons';
|
||||
import { clearError, confirm, propose } from './actions';
|
||||
import styles from './reverse.css';
|
||||
|
@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import Contracts from '~/contracts';
|
||||
import Contracts from '@parity/shared/contracts';
|
||||
|
||||
import { api } from './parity.js';
|
||||
import * as addresses from './addresses/actions.js';
|
||||
|
@ -17,10 +17,11 @@
|
||||
import React, { Component, PropTypes } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import { nullableProptype } from '@parity/shared/util/proptypes';
|
||||
|
||||
import Hash from './hash';
|
||||
import etherscanUrl from '../util/etherscan-url';
|
||||
import IdentityIcon from '../IdentityIcon';
|
||||
import { nullableProptype } from '~/util/proptypes';
|
||||
|
||||
import styles from './address.css';
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { parityNode } from '../../../environment';
|
||||
import { parityNode } from '@parity/shared/environment';
|
||||
|
||||
const styles = {
|
||||
padding: '.5em',
|
||||
|
@ -14,7 +14,8 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import * as abis from '~/contracts/abi';
|
||||
import * as abis from '@parity/shared/contracts/abi';
|
||||
|
||||
import { api } from './parity';
|
||||
|
||||
const sortEvents = (a, b) => b.blockNumber.cmp(a.blockNumber) || b.logIndex.cmp(a.logIndex);
|
||||
|
@ -17,7 +17,7 @@
|
||||
import BigNumber from 'bignumber.js';
|
||||
import React, { Component, PropTypes } from 'react';
|
||||
|
||||
import { eip20 } from '~/contracts/abi';
|
||||
import { eip20 } from '@parity/shared/contracts/abi';
|
||||
|
||||
import { api } from '../../parity';
|
||||
import { loadBalances } from '../../services';
|
||||
|
@ -17,7 +17,8 @@
|
||||
import BigNumber from 'bignumber.js';
|
||||
|
||||
import { url as etherscanUrl } from '~/3rdparty/etherscan/links';
|
||||
import * as abis from '~/contracts/abi';
|
||||
import * as abis from '@parity/shared/contracts/abi';
|
||||
|
||||
import { api } from './parity';
|
||||
|
||||
let managerInstance;
|
||||
|
@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import Contracts from '~/contracts';
|
||||
import Contracts from '@parity/shared/contracts';
|
||||
|
||||
import { loadToken, setTokenPending, deleteToken, setTokenData } from '../Tokens/actions';
|
||||
import { api } from '../parity';
|
||||
|
@ -30,7 +30,7 @@ import styles from './token.css';
|
||||
import { metaDataKeys } from '../../constants';
|
||||
|
||||
import { api } from '../../parity';
|
||||
import { parityNode } from '../../../../environment';
|
||||
import { parityNode } from '@parity/shared/environment';
|
||||
|
||||
export default class Token extends Component {
|
||||
static propTypes = {
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
import { api } from './parity';
|
||||
|
||||
import { eip20 as eip20Abi } from '~/contracts/abi';
|
||||
import { eip20 as eip20Abi } from '@parity/shared/contracts/abi';
|
||||
|
||||
export const INVALID_URL_HASH = '0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470';
|
||||
export const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
|
||||
|
@ -296,19 +296,6 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
getBlockHeaderByNumber: {
|
||||
section: SECTION_NET,
|
||||
desc: 'Returns block header information by number (same as eth_getBlockByNumber without transactions and uncles)',
|
||||
params: [
|
||||
{
|
||||
type: BlockNumber,
|
||||
desc: 'integer of a block number, or the string `\'earliest\'`, `\'latest\'` or `\'pending\'`, as in the [default block parameter](#the-default-block-parameter).',
|
||||
example: fromDecimal(436)
|
||||
}
|
||||
],
|
||||
returns: 'See [eth_getBlockByHash](#eth_getblockbyhash) (without transactions and uncles)'
|
||||
},
|
||||
|
||||
getVaultMeta: {
|
||||
section: SECTION_VAULT,
|
||||
desc: 'Returns the metadata for a specific vault',
|
||||
@ -1927,5 +1914,87 @@ export default {
|
||||
desc: 'Message signature.',
|
||||
example: '0x1d9e33a8cf8bfc089a172bca01da462f9e359c6cb1b0f29398bc884e4d18df4f78588aee4fb5cc067ca62d2abab995e0bba29527be6ac98105b0320020a2efaf00'
|
||||
}
|
||||
},
|
||||
|
||||
composeTransaction: {
|
||||
desc: 'Given partial transaction request produces transaction with all fields filled in. Such transaction can be then signed externally.',
|
||||
params: [
|
||||
{
|
||||
type: TransactionRequest,
|
||||
desc: 'see [`eth_sendTransaction`](JSONRPC-eth-module#eth_sendtransaction).',
|
||||
format: 'inputCallFormatter',
|
||||
example: {
|
||||
from: '0xb60e8dd61c5d32be8058bb8eb970870f07233155',
|
||||
to: '0xd46e8dd67c5d32be8058bb8eb970870f07244567',
|
||||
value: fromDecimal(2441406250)
|
||||
}
|
||||
}
|
||||
],
|
||||
returns: {
|
||||
type: Object,
|
||||
desc: 'Transaction object (same as the parameter) with missing optional fields filled in by defaults.',
|
||||
example: {
|
||||
condition: null,
|
||||
data: '0x',
|
||||
from: '0xb60e8dd61c5d32be8058bb8eb970870f07233155',
|
||||
gas: '0xe57e0',
|
||||
gasPrice: '0x4a817c800',
|
||||
nonce: '0x0',
|
||||
to: '0xd46e8dd67c5d32be8058bb8eb970870f07244567',
|
||||
value: '0x9184e72a'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
getBlockHeaderByNumber: {
|
||||
desc: 'Get block header. Same as [`eth_getBlockByNumber`](JSONRPC-eth-module#eth_getblockbynumber) but without uncles and transactions.',
|
||||
params: [
|
||||
{
|
||||
type: BlockNumber,
|
||||
desc: 'integer of a block number, or the string `\'earliest\'`, `\'latest\'` or `\'pending\'`, as in the [default block parameter](#the-default-block-parameter).',
|
||||
example: fromDecimal(436)
|
||||
}
|
||||
],
|
||||
returns: {
|
||||
type: Object,
|
||||
desc: 'Block header',
|
||||
example: {
|
||||
author: '0xbb7b8287f3f0a933474a79eae42cbca977791171',
|
||||
difficulty: '0x4ea3f27bc',
|
||||
extraData: '0x476574682f4c5649562f76312e302e302f6c696e75782f676f312e342e32',
|
||||
gasLimit: '0x1388',
|
||||
gasUsed: '0x0',
|
||||
hash: '0xdc0818cf78f21a8e70579cb46a43643f78291264dda342ae31049421c82d21ae',
|
||||
logsBloom: '0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
|
||||
miner: '0xbb7b8287f3f0a933474a79eae42cbca977791171',
|
||||
mixHash: '0x4fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843',
|
||||
nonce: '0x689056015818adbe',
|
||||
number: '0x1b4',
|
||||
parentHash: '0xe99e022112df268087ea7eafaf4790497fd21dbeeb6bd7a1721df161a6657a54',
|
||||
receiptsRoot: '0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421',
|
||||
sealFields: ['0xa04fffe9ae21f1c9e15207b1f472d5bbdd68c9595d461666602f2be20daf5e7843', '0x88689056015818adbe'],
|
||||
sha3Uncles: '0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347',
|
||||
size: '0x21b',
|
||||
stateRoot: '0xddc8b0234c2e0cad087c8b389aa7ef01f7d79b2570bccb77ce48648aa61c904d',
|
||||
timestamp: '0x55ba467c',
|
||||
transactionsRoot: '0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
cidV0: {
|
||||
desc: 'Compute a v0 IPFS Content ID from protobuf encoded bytes.',
|
||||
params: [
|
||||
{
|
||||
type: Data,
|
||||
desc: 'to encode.',
|
||||
example: '0x666f6f626172'
|
||||
}
|
||||
],
|
||||
returns: {
|
||||
type: String,
|
||||
desc: 'Base58 encoded CID',
|
||||
example: 'QmSbFjqjd6nFwNHqsBCC7SK8GShGcayLUEtysJjNGhZAnC'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -18,7 +18,7 @@ import { uniq } from 'lodash';
|
||||
import store from 'store';
|
||||
|
||||
import Api from '@parity/api';
|
||||
import { LOG_KEYS, getLogger } from '~/config';
|
||||
import { LOG_KEYS, getLogger } from '@parity/shared/config';
|
||||
|
||||
const log = getLogger(LOG_KEYS.Signer);
|
||||
|
||||
|
@ -16,13 +16,11 @@
|
||||
|
||||
import toolbox from 'sw-toolbox';
|
||||
|
||||
toolbox.precache(self.serviceWorkerOption.assets);
|
||||
|
||||
/**
|
||||
* Cache the SOLC files : if not available, make a network request
|
||||
*/
|
||||
toolbox.router.any(/raw.githubusercontent.com\/ethereum\/solc-bin(.+)list\.json$/, toolbox.cacheFirst);
|
||||
toolbox.router.any(/raw.githubusercontent.com\/ethereum\/solc-bin(.+)soljson(.+)\.js$/, toolbox.cacheFirst);
|
||||
toolbox.router.any(/rawgit.com\/ethereum\/solc-bin(.+)list\.json$/, toolbox.networkFirst);
|
||||
toolbox.router.any(/rawgit.com\/ethereum\/solc-bin(.+)soljson(.+)\.js$/, toolbox.cacheFirst);
|
||||
|
||||
self.addEventListener('install', (event) => {
|
||||
event.waitUntil(self.skipWaiting());
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user