Ethereum
PoC-8
The C++ Implementation of Ethereum
Interface.cpp
Go to the documentation of this file.
1
/*
2
This file is part of cpp-ethereum.
3
4
cpp-ethereum is free software: you can redistribute it and/or modify
5
it under the terms of the GNU General Public License as published by
6
the Free Software Foundation, either version 3 of the License, or
7
(at your option) any later version.
8
9
cpp-ethereum is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
13
14
You should have received a copy of the GNU General Public License
15
along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
16
*/
22
#include "
Interface.h
"
23
using namespace
std
;
24
using namespace
dev
;
25
using namespace
eth;
26
27
void
Interface::submitTransaction(
Secret
const
& _secret,
u256
const
& _value,
Address
const
& _dest,
bytes
const
& _data,
u256
const
& _gas,
u256
const
& _gasPrice,
u256
const
& _nonce)
28
{
29
TransactionSkeleton
ts;
30
ts.
creation
=
false
;
31
ts.
value
= _value;
32
ts.
to
= _dest;
33
ts.
data
= _data;
34
ts.
gas
= _gas;
35
ts.
gasPrice
= _gasPrice;
36
ts.
nonce
= _nonce;
37
submitTransaction(ts, _secret);
38
}
39
40
BlockHeader
Interface::blockInfo(
BlockNumber
_block)
const
41
{
42
if
(_block == PendingBlock)
43
return
pendingInfo();
44
return
blockInfo(hashFromNumber(_block));
45
}
46
47
BlockDetails
Interface::blockDetails(
BlockNumber
_block)
const
48
{
49
if
(_block == PendingBlock)
50
return
pendingDetails();
51
return
blockDetails(hashFromNumber(_block));
52
}
dev::eth::TransactionSkeleton
Definition:
Common.h:184
dev::eth::TransactionSkeleton::to
Address to
Definition:
Common.h:187
dev::eth::BlockHeader
Encapsulation of a block header. Class to contain all of a block header's data. It is able to parse a...
Definition:
BlockHeader.h:97
dev::SecureFixedHash< 32 >
dev::eth::TransactionSkeleton::creation
bool creation
Definition:
Common.h:185
dev::eth::TransactionSkeleton::gasPrice
u256 gasPrice
Definition:
Common.h:192
dev::eth::TransactionSkeleton::value
u256 value
Definition:
Common.h:188
dev::eth::BlockDetails
Definition:
BlockDetails.h:42
dev::FixedHash< 20 >
dev::eth::TransactionSkeleton::nonce
u256 nonce
Definition:
Common.h:190
dev::eth::TransactionSkeleton::data
bytes data
Definition:
Common.h:189
Interface.h
dev::bytes
std::vector< byte > bytes
Definition:
Common.h:72
dev::eth::BlockNumber
unsigned BlockNumber
Definition:
Common.h:64
std
Definition:
FixedHash.h:393
dev::u256
boost::multiprecision::number< boost::multiprecision::cpp_int_backend< 256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void > > u256
Definition:
Common.h:121
dev
Definition:
Address.cpp:21
dev::eth::TransactionSkeleton::gas
u256 gas
Definition:
Common.h:191
libethereum
Interface.cpp
Generated on Fri Sep 20 2019 00:00:00 for Ethereum by
1.8.18