Browse Source

Merge branch 'develop' of github.com:ethereum/cpp-ethereum into develop

cl-refactor
Gav Wood 10 years ago
parent
commit
24893c588b
  1. 6
      libdevcore/RLP.cpp
  2. 2
      libdevcore/RLP.h
  3. 29
      mix/qml/CodeEditorView.qml
  4. 8
      mix/qml/WebCodeEditor.qml
  5. 2
      mix/qml/WebPreview.qml
  6. 1
      mix/qml/html/WebContainer.html
  7. 65
      mix/qml/html/cm/inkpot.css
  8. 3
      mix/qml/html/codeeditor.html
  9. 9
      mix/qml/html/codeeditor.js
  10. 1
      mix/web.qrc
  11. 120
      test/JSON_test.sol
  12. 247
      test/bcJS_API_TestFiller.json
  13. 579
      test/bcRPC_API_TestFiller.json
  14. 22
      test/blockchain.cpp

6
libdevcore/RLP.cpp

@ -166,6 +166,9 @@ unsigned RLP::length() const
{
if ((int)m_data.size() <= n - c_rlpDataIndLenZero)
BOOST_THROW_EXCEPTION(BadRLP());
if ((int)m_data.size() > 1)
if (m_data[1] == 0)
BOOST_THROW_EXCEPTION(BadRLP());
for (int i = 0; i < n - c_rlpDataIndLenZero; ++i)
ret = (ret << 8) | m_data[i + 1];
}
@ -175,6 +178,9 @@ unsigned RLP::length() const
{
if ((int)m_data.size() <= n - c_rlpListIndLenZero)
BOOST_THROW_EXCEPTION(BadRLP());
if ((int)m_data.size() > 1)
if (m_data[1] == 0)
BOOST_THROW_EXCEPTION(BadRLP());
for (int i = 0; i < n - c_rlpListIndLenZero; ++i)
ret = (ret << 8) | m_data[i + 1];
}

2
libdevcore/RLP.h

@ -308,7 +308,7 @@ private:
/// Single-byte data payload.
bool isSingleByte() const { return !isNull() && m_data[0] < c_rlpDataImmLenStart; }
/// @returns the bytes used to encode the length of the data. Valid for all types.
/// @returns the amount of bytes used to encode the length of the data. Valid for all types.
unsigned lengthSize() const { if (isData() && m_data[0] > c_rlpDataIndLenZero) return m_data[0] - c_rlpDataIndLenZero; if (isList() && m_data[0] > c_rlpListIndLenZero) return m_data[0] - c_rlpListIndLenZero; return 0; }
/// @returns the size in bytes of the payload, as given by the RLP as opposed to as inferred from m_data.

29
mix/qml/CodeEditorView.qml

@ -3,6 +3,7 @@ import QtQuick.Window 2.0
import QtQuick.Layouts 1.0
import QtQuick.Controls 1.0
import QtQuick.Dialogs 1.1
import Qt.labs.settings 1.0
Item {
id: codeEditorView
@ -74,6 +75,7 @@ Item {
}
editor.document = document;
editor.sourceName = document.documentId;
editor.setFontSize(editorSettings.fontSize);
editor.setText(data, document.syntaxMode);
editor.changeGeneration();
}
@ -158,6 +160,14 @@ Item {
}
}
function setFontSize(size) {
if (size <= 10 || size >= 48)
return;
editorSettings.fontSize = size;
for (var i = 0; i < editors.count; i++)
editors.itemAt(i).item.setFontSize(size);
}
Component.onCompleted: projectModel.codeEditor = codeEditorView;
Connections {
@ -317,4 +327,23 @@ Item {
ListModel {
id: editorListModel
}
Action {
id: increaseFontSize
text: qsTr("Increase Font Size")
shortcut: "Ctrl+="
onTriggered: setFontSize(editorSettings.fontSize + 1)
}
Action {
id: decreaseFontSize
text: qsTr("Decrease Font Size")
shortcut: "Ctrl+-"
onTriggered: setFontSize(editorSettings.fontSize - 1)
}
Settings {
id: editorSettings
property int fontSize: 12;
}
}

8
mix/qml/WebCodeEditor.qml

@ -19,6 +19,7 @@ Item {
property var currentBreakpoints: []
property string sourceName
property var document
property int fontSize: 0
function setText(text, mode) {
currentText = text;
@ -76,6 +77,12 @@ Item {
editorBrowser.runJavaScript("goToCompilationError()", function(result) {});
}
function setFontSize(size) {
fontSize = size;
if (initialized && editorBrowser)
editorBrowser.runJavaScript("setFontSize(" + size + ")", function(result) {});
}
Clipboard
{
id: clipboard
@ -108,6 +115,7 @@ Item {
{
if (!loading && editorBrowser) {
initialized = true;
setFontSize(fontSize);
setText(currentText, currentMode);
runJavaScript("getTextChanged()", function(result) { });
pollTimer.running = true;

2
mix/qml/WebPreview.qml

@ -186,7 +186,7 @@ Item {
if (documentName === urlInput.text.replace(httpServer.url + "/", "")) {
//root page, inject deployment script
content = "<script>web3=parent.web3;contracts=parent.contracts;</script>\n" + content;
content = "<script>web3=parent.web3;BigNumber=parent.BigNumber;contracts=parent.contracts;</script>\n" + content;
_request.setResponseContentType("text/html");
}
_request.setResponse(content);

1
mix/qml/html/WebContainer.html

@ -21,6 +21,7 @@ updateContracts = function(contracts) {
if (window.web3) {
window.web3.reset();
window.contracts = {};
window.BigNumber = require('bignumber.js');
for (var c in contracts) {
var contractProto = window.web3.eth.contract(contracts[c].interface);
var contract = new contractProto(contracts[c].address);

65
mix/qml/html/cm/inkpot.css

@ -0,0 +1,65 @@
/*
Inkpot theme for code-mirror
https://github.com/ciaranm/inkpot
*/
/* Color scheme for code-mirror */
.cm-s-inkpot.CodeMirror {
color: #cfbfad;
text-shadow: #1e1e27 0 1px;
background-color: #1e1e27;
line-height: 1.45em;
color-profile: sRGB;
rendering-intent: auto;
}
.cm-s-inkpot .CodeMirror-gutters { background: #2e2e2e; border-right: 0px solid #aaa; }
.cm-s-inkpot .CodeMirror-linenumber { color: #8b8bcd; }
.cm-s-inkpot .CodeMirror-cursor { border-left: 1px solid white !important; }
.cm-s-inkpot span.cm-comment { color: #cd8b00; }
.cm-s-inkpot span.cm-def { color: #cfbfad; font-weight:bold; }
.cm-s-inkpot span.cm-keyword { color: #808bed; }
.cm-s-inkpot span.cm-builtin { color: #cfbfad; }
.cm-s-inkpot span.cm-variable { color: #cfbfad; }
.cm-s-inkpot span.cm-string { color: #ffcd8b; }
.cm-s-inkpot span.cm-number { color: #f0ad6d; }
.cm-s-inkpot span.cm-atom { color: #cb6ecb; }
.cm-s-inkpot span.cm-variable-2 { color: #ffb8ff; }
.cm-s-inkpot span.cm-meta { color: #409090; }
.cm-s-inkpot span.cm-qualifier { color: #808bed; }
.cm-s-inkpot span.cm-tag { color: #808bed; }
.cm-s-inkpot span.cm-attribute { color: #FF5555; }
.cm-s-inkpot span.cm-error { color: #f00; }
.cm-s-inkpot .cm-bracket { color: #cb4b16; }
.cm-s-inkpot .CodeMirror-matchingbracket { color: #859900; }
.cm-s-inkpot .CodeMirror-nonmatchingbracket { color: #dc322f; }
.cm-s-inkpot .CodeMirror-selected { background: #4e4e8f !important; }
span.CodeMirror-selectedtext { color: #ffffff !important; }
/* Code execution */
.CodeMirror-exechighlight {
border-bottom: double 1px #94A2A2;
}
/* Error annotation */
.CodeMirror-errorannotation {
border-bottom: 1px solid #DD3330;
margin-bottom: 4px;
}
.CodeMirror-errorannotation-context {
font-family: monospace;
color: #EEE9D5;
background: #b58900;
padding: 2px;
text-shadow: none !important;
border-top: solid 2px #063742;
}

3
mix/qml/html/codeeditor.html

@ -1,7 +1,8 @@
<!doctype html>
<meta charset="utf-8"/>
<link rel="stylesheet" href="cm/codemirror.css">
<link rel="stylesheet" href="cm/solarized.css">
<!--link rel="stylesheet" href="cm/solarized.css"-->
<link rel="stylesheet" href="cm/inkpot.css">
<link rel="stylesheet" href="cm/fullscreen.css">
<link rel="stylesheet" href="cm/dialog.css">
<link rel="stylesheet" href="cm/show-hint.css">

9
mix/qml/html/codeeditor.js

@ -9,7 +9,7 @@ var editor = CodeMirror(document.body, {
});
var ternServer;
editor.setOption("theme", "solarized dark");
editor.setOption("theme", "inkpot");
editor.setOption("indentUnit", 4);
editor.setOption("indentWithTabs", true);
editor.setOption("fullScreen", true);
@ -194,4 +194,11 @@ goToCompilationError = function()
editor.setCursor(annotation.line, annotation.column)
}
setFontSize = function(size)
{
editor.getWrapperElement().style["font-size"] = size + "px";
editor.refresh();
}
editor.setOption("extraKeys", extraKeys);

1
mix/web.qrc

@ -32,6 +32,7 @@
<file>qml/html/cm/show-hint.js</file>
<file>qml/html/cm/signal.js</file>
<file>qml/html/cm/solarized.css</file>
<file>qml/html/cm/inkpot.css</file>
<file>qml/html/cm/solidity.js</file>
<file>qml/html/cm/solidityToken.js</file>
<file>qml/html/cm/tern.js</file>

120
test/JSON_test.sol

@ -0,0 +1,120 @@
contract JSON_Test {
event Log0(uint value) ;
event Log0Anonym (uint value) anonymous;
event Log1(bool indexed aBool, uint value);
event Log1Anonym(bool indexed aBool, uint value) anonymous;
event Log2(bool indexed aBool, address indexed aAddress, uint value);
event Log2Anonym(bool indexed aBool, address indexed aAddress, uint value) anonymous;
event Log3(bool indexed aBool, address indexed aAddress, bytes32 indexed aBytes32, uint value);
event Log3Anonym(bool indexed aBool, address indexed aAddress, bytes32 indexed aBytes32, uint value) anonymous;
event Log4(bool indexed aBool, address indexed aAddress, bytes32 indexed aBytes32, int8 aInt8, uint value);
event Log4Anonym(bool indexed aBool, address indexed aAddress, bytes32 indexed aBytes32, int8 aInt8, uint value) anonymous;
function JSON_Test() {
}
function setBool(bool _bool) {
myBool = _bool;
}
function setInt8(int8 _int8) {
myInt8 = _int8;
}
function setUint8(uint8 _uint8) {
myUint8 = _uint8;
}
function setInt256(int256 _int256) {
myInt256 = _int256;
}
function setUint256(uint256 _uint256) {
myUint256 = _uint256;
}
function setAddress(address _address) {
myAddress = _address;
}
function setBytes32(bytes32 _bytes32) {
myBytes32 = _bytes32;
}
function getBool() returns (bool ret) {
return myBool;
}
function getInt8() returns (int8 ret) {
return myInt8;
}
function getUint8() returns (uint8 ret) {
return myUint8;
}
function getInt256() returns (int256 ret) {
return myInt256;
}
function getUint256() returns (uint256 ret) {
return myUint256;
}
function getAddress() returns (address ret) {
return myAddress;
}
function getBytes32() returns (bytes32 ret) {
return myBytes32;
}
function fireEventLog0() {
Log0(42);
}
function fireEventLog0Anonym() {
Log0Anonym(42);
}
function fireEventLog1() {
Log1(true, 42);
}
function fireEventLog1Anonym() {
Log1Anonym(true, 42);
}
function fireEventLog2() {
Log2(true, msg.sender, 42);
}
function fireEventLog2Anonym() {
Log2Anonym(true, msg.sender, 42);
}
function fireEventLog3() {
Log3(true, msg.sender, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, 42);
}
function fireEventLog3Anonym() {
Log3Anonym(true, msg.sender, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, 42);
}
function fireEventLog4() {
Log4(true, msg.sender, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, -23, 42);
}
function fireEventLog4Anonym() {
Log4Anonym(true, msg.sender, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, -23, 42);
}
bool myBool;
int8 myInt8;
uint8 myUint8;
int256 myInt256;
uint256 myUint256;
address myAddress;
bytes32 myBytes32;
}

247
test/bcJS_API_TestFiller.json

@ -1,247 +0,0 @@
{
"JS_API_Tests" : {
"genesisBlockHeader" : {
"bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
"difficulty" : "131072",
"extraData" : "0x42",
"gasLimit" : "3141592",
"gasUsed" : "0",
"number" : "0",
"parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
"receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"stateRoot" : "0xf99eb1626cfa6db435c0836235942d7ccaa935f1ae247d3f1c21e495685f903a",
"timestamp" : "0x54c98c81",
"mixHash" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"nonce" : "0x0102030405060708",
"transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
},
"expect" : {
"095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
"balance" : "70"
},
"6295ee1b4f6dd65047762f924ecd367c17eabf8f" : {
"storage" : {
"0x" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"0x01" : "0x42",
"0x02" : "0x23",
"0x03" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"0x04" : "0x01",
"0x05" : "0x55114a49"
}
}
},
"pre" : {
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "10000000000000",
"nonce" : "0",
"code" : "",
"storage": {}
},
"6295ee1b4f6dd65047762f924ecd367c17eabf8f" : {
"balance" : "100000",
"code" : "0x60003560e060020a9004806343d726d61461004257806391b7f5ed14610050578063d686f9ee14610061578063f5bade661461006f578063fcfff16f1461008057005b61004a6101de565b60006000f35b61005b6004356100bf565b60006000f35b610069610304565b60006000f35b61007a60043561008e565b60006000f35b6100886100f0565b60006000f35b600054600160a060020a031633600160a060020a031614156100af576100b4565b6100bc565b806001819055505b50565b600054600160a060020a031633600160a060020a031614156100e0576100e5565b6100ed565b806002819055505b50565b600054600160a060020a031633600160a060020a031614806101255750600354600160a060020a031633600160a060020a0316145b61012e57610161565b60016004819055507f59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a560006000a16101dc565b60045460011480610173575060015434105b6101b85760016004819055507f59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a560006000a142600581905550336003819055506101db565b33600160a060020a03166000346000600060006000848787f16101d757005b5050505b5b565b60006004546000146101ef576101f4565b610301565b600054600160a060020a031633600160a060020a031614801561022c5750600054600160a060020a0316600354600160a060020a0316145b61023557610242565b6000600481905550610301565b600354600160a060020a031633600160a060020a03161461026257610300565b600554420360025402905060015481116102c757600354600160a060020a0316600082600154036000600060006000848787f161029b57005b505050600054600160a060020a03166000826000600060006000848787f16102bf57005b5050506102ee565b600054600160a060020a031660006001546000600060006000848787f16102ea57005b5050505b60006004819055506000546003819055505b5b50565b6000600054600160a060020a031633600160a060020a031614156103275761032c565b61037e565b600554420360025402905060015481116103455761037d565b600054600160a060020a031660006001546000600060006000848787f161036857005b50505060006004819055506000546003819055505b5b5056",
"nonce" : "0",
"storage" : {
"0x" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"0x01" : "0x42",
"0x02" : "0x23",
"0x03" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"0x05" : "0x54c98c81"
}
}
},
"blocks" : [
{
"transactions" : [
{
"data" : "0x60406103ca600439600451602451336000819055506000600481905550816001819055508060028190555042600581905550336003819055505050610381806100496000396000f30060003560e060020a9004806343d726d61461004257806391b7f5ed14610050578063d686f9ee14610061578063f5bade661461006f578063fcfff16f1461008057005b61004a6101de565b60006000f35b61005b6004356100bf565b60006000f35b610069610304565b60006000f35b61007a60043561008e565b60006000f35b6100886100f0565b60006000f35b600054600160a060020a031633600160a060020a031614156100af576100b4565b6100bc565b806001819055505b50565b600054600160a060020a031633600160a060020a031614156100e0576100e5565b6100ed565b806002819055505b50565b600054600160a060020a031633600160a060020a031614806101255750600354600160a060020a031633600160a060020a0316145b61012e57610161565b60016004819055507f59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a560006000a16101dc565b60045460011480610173575060015434105b6101b85760016004819055507f59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a560006000a142600581905550336003819055506101db565b33600160a060020a03166000346000600060006000848787f16101d757005b5050505b5b565b60006004546000146101ef576101f4565b610301565b600054600160a060020a031633600160a060020a031614801561022c5750600054600160a060020a0316600354600160a060020a0316145b61023557610242565b6000600481905550610301565b600354600160a060020a031633600160a060020a03161461026257610300565b600554420360025402905060015481116102c757600354600160a060020a0316600082600154036000600060006000848787f161029b57005b505050600054600160a060020a03166000826000600060006000848787f16102bf57005b5050506102ee565b600054600160a060020a031660006001546000600060006000848787f16102ea57005b5050505b60006004819055506000546003819055505b5b50565b6000600054600160a060020a031633600160a060020a031614156103275761032c565b61037e565b600554420360025402905060015481116103455761037d565b600054600160a060020a031660006001546000600060006000848787f161036857005b50505060006004819055506000546003819055505b5b505600000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000000000000000000000000000000023",
"gasLimit" : "600000",
"gasPrice" : "1",
"nonce" : "0",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "",
"value" : "100000"
}
],
"uncleHeaders" : [
]
},
{
"transactions" : [
{
"data" : "",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "1",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "10"
}
],
"uncleHeaders" : [
]
},
{
"transactions" : [
{
"data" : "0xfcfff16f",
"gasLimit" : "600000",
"gasPrice" : "1",
"nonce" : "2",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"value" : "0x42"
}
],
"uncleHeaders" : [
]
},
{
"transactions" : [
{
"data" : "",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "3",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "10"
}
],
"uncleHeaders" : [
{
"bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"coinbase" : "a94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"difficulty" : "131072",
"extraData" : "0x",
"gasLimit" : "3141592",
"gasUsed" : "0",
"hash" : "9de9879b6a81d1b6c4993c63c90a3c9d1e775f14572694778e828bc64972ae04",
"mixHash" : "b557f905d29ed0fca99d65d0adcce698dee97cf72a13c7cd8d7a7826b8eee770",
"nonce" : "18a524c1790fa83b",
"number" : "2",
"parentHash" : "6134fc6b5d99ee03c4aab1592640f6f9dcbc850668d75d631aee34989b938fae",
"receiptTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"stateRoot" : "ff640b30d613c35dad43e3693329e1b1ee6350f989cf46a288025a1cbfdab9cd",
"timestamp" : "0x54c98c82",
"transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
},
{
"bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"coinbase" : "bcde5374fce5edbc8e2a8697c15331677e6ebf0b",
"difficulty" : "131072",
"extraData" : "0x",
"gasLimit" : "3141592",
"gasUsed" : "0",
"hash" : "9de9879b6a81d1b6c4993c63c90a3c9d1e775f14572694778e828bc64972ae04",
"mixHash" : "b557f905d29ed0fca99d65d0adcce698dee97cf72a13c7cd8d7a7826b8eee770",
"nonce" : "18a524c1790fa83b",
"number" : "2",
"parentHash" : "6134fc6b5d99ee03c4aab1592640f6f9dcbc850668d75d631aee34989b938fae",
"receiptTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"stateRoot" : "ff640b30d613c35dad43e3693329e1b1ee6350f989cf46a288025a1cbfdab9cd",
"timestamp" : "0x54c98c82",
"transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
}
]
},
{
"transactions" : [
{
"data" : "",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "4",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "10"
}
],
"uncleHeaders" : [
]
},
{
"transactions" : [
{
"data" : "",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "5",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "10"
}
],
"uncleHeaders" : [
{
"bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"coinbase" : "bcde5374fce5edbc8e2a8697c15331677e6ebf0b",
"difficulty" : "131072",
"extraData" : "0x",
"gasLimit" : "314159",
"gasUsed" : "0",
"hash" : "9de9879b6a81d1b6c4993c63c90a3c9d1e775f14572694778e828bc64972ae04",
"mixHash" : "b557f905d29ed0fca99d65d0adcce698dee97cf72a13c7cd8d7a7826b8eee770",
"nonce" : "18a524c1790fa83b",
"number" : "2",
"parentHash" : "6134fc6b5d99ee03c4aab1592640f6f9dcbc850668d75d631aee34989b938fae",
"receiptTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"stateRoot" : "ff640b30d613c35dad43e3693329e1b1ee6350f989cf46a288025a1cbfdab9cd",
"timestamp" : "0x54c98c82",
"transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
}
]
},
{
"transactions" : [
{
"data" : "",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "6",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "10"
}
],
"uncleHeaders" : [
]
},
{
"transactions" : [
{
"data" : "",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "7",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "10"
}
],
"uncleHeaders" : [
]
},
{
"transactions" : [
{
"data" : "",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "8",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
"value" : "10"
}
],
"uncleHeaders" : [
]
}
]
}
}

579
test/bcRPC_API_TestFiller.json

@ -0,0 +1,579 @@
{
"RPC_API_Test" : {
"genesisBlockHeader" : {
"bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
"difficulty" : "131072",
"extraData" : "0x42",
"gasLimit" : "3141592",
"gasUsed" : "0",
"number" : "0",
"parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
"receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"stateRoot" : "0xf99eb1626cfa6db435c0836235942d7ccaa935f1ae247d3f1c21e495685f903a",
"timestamp" : "0x54c98c81",
"mixHash" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"nonce" : "0x0102030405060708",
"transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
},
"pre" : {
"a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
"balance" : "10000000000000",
"nonce" : "0",
"code" : "",
"storage": {}
}
},
"blocks" : [
{
"transactions" : [
{
"data" : "create contract: 6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"data" : "0x5b5b610705806100106000396000f3006000357c010000000000000000000000000000000000000000000000000000000090048063102accc11461012c57806312a7b9141461013a5780631774e6461461014c5780631e26fd331461015d5780631f9030371461016e578063343a875d1461018057806338cc4831146101955780634e7ad367146101bd57806357cb2fc4146101cb57806365538c73146101e057806368895979146101ee57806376bc21d9146102005780639a19a9531461020e5780639dc2c8f51461021f578063a53b1c1e1461022d578063a67808571461023e578063b61c05031461024c578063c2b12a731461025a578063d2282dc51461026b578063e30081a01461027c578063e8beef5b1461028d578063f38b06001461029b578063f5b53e17146102a9578063fd408767146102bb57005b6101346104d6565b60006000f35b61014261039b565b8060005260206000f35b610157600435610326565b60006000f35b6101686004356102c9565b60006000f35b610176610442565b8060005260206000f35b6101886103d3565b8060ff1660005260206000f35b61019d610413565b8073ffffffffffffffffffffffffffffffffffffffff1660005260206000f35b6101c56104c5565b60006000f35b6101d36103b7565b8060000b60005260206000f35b6101e8610454565b60006000f35b6101f6610401565b8060005260206000f35b61020861051f565b60006000f35b6102196004356102e5565b60006000f35b610227610693565b60006000f35b610238600435610342565b60006000f35b610246610484565b60006000f35b610254610493565b60006000f35b61026560043561038d565b60006000f35b610276600435610350565b60006000f35b61028760043561035e565b60006000f35b6102956105b4565b60006000f35b6102a3610547565b60006000f35b6102b16103ef565b8060005260206000f35b6102c3610600565b60006000f35b80600060006101000a81548160ff021916908302179055505b50565b80600060016101000a81548160ff02191690837f01000000000000000000000000000000000000000000000000000000000000009081020402179055505b50565b80600060026101000a81548160ff021916908302179055505b50565b806001600050819055505b50565b806002600050819055505b50565b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908302179055505b50565b806004600050819055505b50565b6000600060009054906101000a900460ff1690506103b4565b90565b6000600060019054906101000a900460000b90506103d0565b90565b6000600060029054906101000a900460ff1690506103ec565b90565b600060016000505490506103fe565b90565b60006002600050549050610410565b90565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905061043f565b90565b60006004600050549050610451565b90565b7f65c9ac8011e286e89d02a269890f41d67ca2cc597b2c76c7c69321ff492be5806000602a81526020016000a15b565b6000602a81526020016000a05b565b60017f81933b308056e7e85668661dcd102b1f22795b4431f9cf4625794f381c271c6b6000602a81526020016000a25b565b60016000602a81526020016000a15b565b3373ffffffffffffffffffffffffffffffffffffffff1660017f0e216b62efbb97e751a2ce09f607048751720397ecfb9eef1e48a6644948985b6000602a81526020016000a35b565b3373ffffffffffffffffffffffffffffffffffffffff1660016000602a81526020016000a25b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660017f317b31292193c2a4f561cc40a95ea0d97a2733f14af6d6d59522473e1f3ae65f6000602a81526020016000a45b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660016000602a81526020016000a35b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff1660017fd5f0a30e4be0c6be577a71eceb7464245a796a7e6a55c0d971837b250de05f4e60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe98152602001602a81526020016000a45b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6001023373ffffffffffffffffffffffffffffffffffffffff16600160007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe98152602001602a81526020016000a35b56",
"gasLimit" : "3141592",
"gasPrice" : "1",
"nonce" : "0",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "",
"value" : "10"
}
],
"uncleHeaders" : [
]
},
{
"transactions" : [
{
"data" : "getBool",
"data" : "0x12a7b914",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "1",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"value" : "10"
}
],
"uncleHeaders" : [
]
},
{
"transactions" : [
{
"data" : "getInt8",
"data" : "0x57cb2fc4",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "2",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"value" : "10"
}
],
"uncleHeaders" : [
]
},
{
"transactions" : [
{
"data" : "getUint8",
"data" : "0x343a875d",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "3",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"value" : "10"
}
],
"uncleHeaders" : [
{
"bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"coinbase" : "a94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"difficulty" : "131072",
"extraData" : "0x",
"gasLimit" : "3141592",
"gasUsed" : "0",
"hash" : "9de9879b6a81d1b6c4993c63c90a3c9d1e775f14572694778e828bc64972ae04",
"mixHash" : "b557f905d29ed0fca99d65d0adcce698dee97cf72a13c7cd8d7a7826b8eee770",
"nonce" : "18a524c1790fa83b",
"number" : "2",
"parentHash" : "6134fc6b5d99ee03c4aab1592640f6f9dcbc850668d75d631aee34989b938fae",
"receiptTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"stateRoot" : "ff640b30d613c35dad43e3693329e1b1ee6350f989cf46a288025a1cbfdab9cd",
"timestamp" : "0x54c98c82",
"transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
},
{
"bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"coinbase" : "bcde5374fce5edbc8e2a8697c15331677e6ebf0b",
"difficulty" : "131072",
"extraData" : "0x",
"gasLimit" : "3141592",
"gasUsed" : "0",
"hash" : "9de9879b6a81d1b6c4993c63c90a3c9d1e775f14572694778e828bc64972ae04",
"mixHash" : "b557f905d29ed0fca99d65d0adcce698dee97cf72a13c7cd8d7a7826b8eee770",
"nonce" : "18a524c1790fa83b",
"number" : "2",
"parentHash" : "6134fc6b5d99ee03c4aab1592640f6f9dcbc850668d75d631aee34989b938fae",
"receiptTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"stateRoot" : "ff640b30d613c35dad43e3693329e1b1ee6350f989cf46a288025a1cbfdab9cd",
"timestamp" : "0x54c98c82",
"transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
}
]
},
{
"transactions" : [
{
"data" : "getInt256",
"data" : "0xf5b53e17",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "4",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"value" : "10"
}
],
"uncleHeaders" : [
]
},
{
"transactions" : [
{
"data" : "getUint256",
"data" : "0x68895979",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "5",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"value" : "10"
}
],
"uncleHeaders" : [
]
},
{
"transactions" : [
{
"data" : "getAddress",
"data" : "0x38cc4831",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "6",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"value" : "10"
}
],
"uncleHeaders" : [
]
},
{
"transactions" : [
{
"data" : "getBytes32",
"data" : "0x1f903037",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "7",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"value" : "10"
}
],
"uncleHeaders" : [
]
},
{
"transactions" : [
{
"data" : "setBool",
"data" : "0x1e26fd330000000000000000000000000000000000000000000000000000000000000001",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "8",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"value" : "10"
}
],
"uncleHeaders" : [
]
},
{
"transactions" : [
{
"data" : "setBool",
"data" : "0x1e26fd330000000000000000000000000000000000000000000000000000000000000001",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "9",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"value" : "10"
}
],
"uncleHeaders" : [
]
},
{
"transactions" : [
{
"data" : "setInt8",
"data" : "0x9a19a953fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "10",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"value" : "10"
}
],
"uncleHeaders" : [
]
},
{
"transactions" : [
{
"data" : "setUint8",
"data" : "0x1774e6460000000000000000000000000000000000000000000000000000000000000008",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "11",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"value" : "10"
}
],
"uncleHeaders" : [
]
},
{
"transactions" : [
{
"data" : "setInt256",
"data" : "0xa53b1c1effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffee",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "12",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"value" : "10"
}
],
"uncleHeaders" : [
]
},
{
"transactions" : [
{
"data" : "setUint256",
"data" : "0xd2282dc5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffee",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "13",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"value" : "10"
}
],
"uncleHeaders" : [
]
},
{
"transactions" : [
{
"data" : "setAddress",
"data" : "0xe30081a0aabbccffffffffffffffffffffffffffffffffffffffffffffffffffffffffee",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "14",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"value" : "10"
}
],
"uncleHeaders" : [
]
},
{
"transactions" : [
{
"data" : "setBytes32",
"data" : "0xc2b12a73aabbccffffffffffffffffffffffffffffffffffffffffffffffffffffffffee",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "15",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"value" : "10"
}
],
"uncleHeaders" : [
]
},
{
"transactions" : [
{
"data" : "getInt8",
"data" : "0x57cb2fc4",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "16",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"value" : "10"
}
],
"uncleHeaders" : [
]
},
{
"transactions" : [
{
"data" : "getUint8",
"data" : "0x343a875d",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "17",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"value" : "10"
}
],
"uncleHeaders" : [
]
},
{
"transactions" : [
{
"data" : "getInt256",
"data" : "0xf5b53e17",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "18",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"value" : "10"
}
],
"uncleHeaders" : [
]
},
{
"transactions" : [
{
"data" : "getUint256",
"data" : "0x68895979",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "19",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"value" : "10"
}
],
"uncleHeaders" : [
]
},
{
"transactions" : [
{
"data" : "getAddress",
"data" : "0x38cc4831",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "20",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"value" : "10"
}
],
"uncleHeaders" : [
]
},
{
"transactions" : [
{
"data" : "getBytes32",
"data" : "0x1f903037",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "21",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"value" : "10"
}
],
"uncleHeaders" : [
]
},
{
"transactions" : [
{
"data" : "log0",
"data" : "0x65538c73",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "22",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"value" : "10"
}
],
"uncleHeaders" : [
]
},
{
"transactions" : [
{
"data" : "log0a",
"data" : "0xa6780857",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "23",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"value" : "10"
}
],
"uncleHeaders" : [
]
},
{
"transactions" : [
{
"data" : "log1",
"data" : "0xb61c0503",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "24",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"value" : "10"
}
],
"uncleHeaders" : [
]
},
{
"transactions" : [
{
"data" : "log1a",
"data" : "0x4e7ad367",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "25",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"value" : "10"
}
],
"uncleHeaders" : [
]
},
{
"transactions" : [
{
"data" : "log2",
"data" : "0x102accc1",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "26",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"value" : "10"
}
],
"uncleHeaders" : [
]
},
{
"transactions" : [
{
"data" : "log2a",
"data" : "0x76bc21d9",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "27",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"value" : "10"
}
],
"uncleHeaders" : [
]
},
{
"transactions" : [
{
"data" : "log3",
"data" : "0xf38b0600",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "28",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"value" : "10"
}
],
"uncleHeaders" : [
]
},
{
"transactions" : [
{
"data" : "log3a",
"data" : "0xe8beef5b",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "29",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"value" : "10"
}
],
"uncleHeaders" : [
]
},
{
"transactions" : [
{
"data" : "log4",
"data" : "0xfd408767",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "30",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"value" : "10"
}
],
"uncleHeaders" : [
]
},
{
"transactions" : [
{
"data" : "log4a",
"data" : "0x9dc2c8f5",
"gasLimit" : "314159",
"gasPrice" : "1",
"nonce" : "31",
"secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
"to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f",
"value" : "10"
}
],
"uncleHeaders" : [
]
}
]
}
}

22
test/blockchain.cpp

@ -52,8 +52,10 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin)
BOOST_REQUIRE(o.count("pre"));
ImportTest importer(o["pre"].get_obj());
State state(OverlayDB(), BaseState::Empty, biGenesisBlock.coinbaseAddress);
State stateTemp(OverlayDB(), BaseState::Empty, biGenesisBlock.coinbaseAddress);
TransientDirectory td_stateDB;
TransientDirectory td_stateDB_tmp;
State state(OverlayDB(State::openDB(td_stateDB.path())), BaseState::Empty, biGenesisBlock.coinbaseAddress);
State stateTemp(OverlayDB(State::openDB(td_stateDB_tmp.path())), BaseState::Empty, biGenesisBlock.coinbaseAddress);
importer.importState(o["pre"].get_obj(), state);
o["pre"] = fillJsonWithState(state);
state.commit();
@ -289,6 +291,7 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin)
state = stateTemp; //revert state as if it was before executing this block
}
blArray.push_back(blObj);
this_thread::sleep_for(chrono::seconds(1));
} //for blocks
if (o.count("expect") > 0)
@ -625,11 +628,11 @@ void writeBlockHeaderToJson(mObject& _o, BlockInfo const& _bi)
_o["transactionsTrie"] = toString(_bi.transactionsRoot);
_o["receiptTrie"] = toString(_bi.receiptsRoot);
_o["bloom"] = toString(_bi.logBloom);
_o["difficulty"] = "0x" + toHex(toCompactBigEndian(_bi.difficulty), 1);
_o["number"] = "0x" + toHex(toCompactBigEndian(_bi.number), 1);
_o["gasLimit"] = "0x" + toHex(toCompactBigEndian(_bi.gasLimit), 1);
_o["gasUsed"] = "0x" + toHex(toCompactBigEndian(_bi.gasUsed), 1);
_o["timestamp"] = "0x" + toHex(toCompactBigEndian(_bi.timestamp), 1);
_o["difficulty"] = "0x" + toHex(toCompactBigEndian(_bi.difficulty, 1));
_o["number"] = "0x" + toHex(toCompactBigEndian(_bi.number, 1));
_o["gasLimit"] = "0x" + toHex(toCompactBigEndian(_bi.gasLimit, 1));
_o["gasUsed"] = "0x" + toHex(toCompactBigEndian(_bi.gasUsed, 1));
_o["timestamp"] = "0x" + toHex(toCompactBigEndian(_bi.timestamp, 1));
_o["extraData"] ="0x" + toHex(_bi.extraData);
_o["mixHash"] = toString(_bi.mixHash);
_o["nonce"] = toString(_bi.nonce);
@ -663,9 +666,9 @@ BOOST_AUTO_TEST_CASE(bcInvalidRLPTest)
dev::test::executeTests("bcInvalidRLPTest", "/BlockTests", dev::test::doBlockchainTests);
}
BOOST_AUTO_TEST_CASE(bcJS_API_Test)
BOOST_AUTO_TEST_CASE(bcRPC_API_Test)
{
dev::test::executeTests("bcJS_API_Test", "/BlockTests", dev::test::doBlockchainTests);
dev::test::executeTests("bcRPC_API_Test", "/BlockTests", dev::test::doBlockchainTests);
}
BOOST_AUTO_TEST_CASE(bcValidBlockTest)
@ -694,4 +697,3 @@ BOOST_AUTO_TEST_CASE(userDefinedFile)
}
BOOST_AUTO_TEST_SUITE_END()

Loading…
Cancel
Save