Adding docs
This commit is contained in:
parent
28391d2f52
commit
a61bf90c17
@ -17,6 +17,8 @@
|
|||||||
#![warn(missing_docs)]
|
#![warn(missing_docs)]
|
||||||
#![cfg_attr(all(nightly, feature="dev"), feature(plugin))]
|
#![cfg_attr(all(nightly, feature="dev"), feature(plugin))]
|
||||||
#![cfg_attr(all(nightly, feature="dev"), plugin(clippy))]
|
#![cfg_attr(all(nightly, feature="dev"), plugin(clippy))]
|
||||||
|
// Generated by serde
|
||||||
|
#![cfg_attr(all(nightly, feature="dev"), allow(redundant_closure_call))]
|
||||||
|
|
||||||
//! Signer module
|
//! Signer module
|
||||||
//!
|
//!
|
||||||
|
@ -14,27 +14,13 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
// Copyright 2015, 2016 Ethcore (UK) Ltd.
|
|
||||||
// This file is part of Parity.
|
|
||||||
|
|
||||||
// Parity is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU General Public License as published by
|
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
|
||||||
// (at your option) any later version.
|
|
||||||
|
|
||||||
// Parity is distributed in the hope that it will be useful,
|
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
// GNU General Public License for more details.
|
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
use rustc_serialize::hex::ToHex;
|
use rustc_serialize::hex::ToHex;
|
||||||
use serde::{Serialize, Serializer, Deserialize, Deserializer, Error};
|
use serde::{Serialize, Serializer, Deserialize, Deserializer, Error};
|
||||||
use serde::de::Visitor;
|
use serde::de::Visitor;
|
||||||
use util::common::FromHex;
|
use util::common::FromHex;
|
||||||
|
|
||||||
|
///! Serializable wrapper around vector of bytes
|
||||||
|
|
||||||
/// Wrapper structure around vector of bytes.
|
/// Wrapper structure around vector of bytes.
|
||||||
#[derive(Debug, PartialEq, Eq, Default, Hash, Clone)]
|
#[derive(Debug, PartialEq, Eq, Default, Hash, Clone)]
|
||||||
pub struct Bytes(pub Vec<u8>);
|
pub struct Bytes(pub Vec<u8>);
|
||||||
@ -44,7 +30,10 @@ impl Bytes {
|
|||||||
pub fn new(bytes: Vec<u8>) -> Bytes {
|
pub fn new(bytes: Vec<u8>) -> Bytes {
|
||||||
Bytes(bytes)
|
Bytes(bytes)
|
||||||
}
|
}
|
||||||
pub fn to_vec(self) -> Vec<u8> { let Bytes(x) = self; x }
|
/// Convert back to vector
|
||||||
|
pub fn to_vec(self) -> Vec<u8> {
|
||||||
|
let Bytes(x) = self; x
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Serialize for Bytes {
|
impl Serialize for Bytes {
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
///! Reusable types with JSON Serialization.
|
||||||
|
|
||||||
pub mod transaction_request;
|
pub mod transaction_request;
|
||||||
pub mod bytes;
|
pub mod bytes;
|
||||||
|
@ -14,19 +14,29 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
//! `TransactionRequest` type
|
||||||
|
|
||||||
use util::hash::Address;
|
use util::hash::Address;
|
||||||
use util::numbers::U256;
|
use util::numbers::U256;
|
||||||
use types::bytes::Bytes;
|
use types::bytes::Bytes;
|
||||||
|
|
||||||
|
/// Transaction request coming from RPC
|
||||||
#[derive(Debug, Clone, Default, Eq, PartialEq, Hash, Deserialize)]
|
#[derive(Debug, Clone, Default, Eq, PartialEq, Hash, Deserialize)]
|
||||||
pub struct TransactionRequest {
|
pub struct TransactionRequest {
|
||||||
|
/// Sender
|
||||||
pub from: Address,
|
pub from: Address,
|
||||||
|
/// Recipient
|
||||||
pub to: Option<Address>,
|
pub to: Option<Address>,
|
||||||
|
/// Gas Price
|
||||||
#[serde(rename="gasPrice")]
|
#[serde(rename="gasPrice")]
|
||||||
pub gas_price: Option<U256>,
|
pub gas_price: Option<U256>,
|
||||||
|
/// Gas
|
||||||
pub gas: Option<U256>,
|
pub gas: Option<U256>,
|
||||||
|
/// Value of transaction in wei
|
||||||
pub value: Option<U256>,
|
pub value: Option<U256>,
|
||||||
|
/// Additional data sent with transaction
|
||||||
pub data: Option<Bytes>,
|
pub data: Option<Bytes>,
|
||||||
|
/// Transaction's nonce
|
||||||
pub nonce: Option<U256>,
|
pub nonce: Option<U256>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user