diff options
author | Jeffrey Wilcke <geffobscura@gmail.com> | 2015-08-06 00:08:52 +0800 |
---|---|---|
committer | Jeffrey Wilcke <geffobscura@gmail.com> | 2015-08-06 00:08:52 +0800 |
commit | 80e5f507130a926ea62dde07c2b98d6f8a0ba3e2 (patch) | |
tree | 750fe404c14b6f5e8ef03a07cf3357787c6c9683 /cmd/geth/js_test.go | |
parent | 98f4c936f25de27dbc90f36f2c1ffd1f23b114e9 (diff) | |
parent | 26f838796b8793f38268f3a8911ec2b71913153c (diff) | |
download | go-tangerine-80e5f507130a926ea62dde07c2b98d6f8a0ba3e2.tar go-tangerine-80e5f507130a926ea62dde07c2b98d6f8a0ba3e2.tar.gz go-tangerine-80e5f507130a926ea62dde07c2b98d6f8a0ba3e2.tar.bz2 go-tangerine-80e5f507130a926ea62dde07c2b98d6f8a0ba3e2.tar.lz go-tangerine-80e5f507130a926ea62dde07c2b98d6f8a0ba3e2.tar.xz go-tangerine-80e5f507130a926ea62dde07c2b98d6f8a0ba3e2.tar.zst go-tangerine-80e5f507130a926ea62dde07c2b98d6f8a0ba3e2.zip |
Merge branch 'develop'
Diffstat (limited to 'cmd/geth/js_test.go')
-rw-r--r-- | cmd/geth/js_test.go | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/cmd/geth/js_test.go b/cmd/geth/js_test.go index db2c5ca03..67c36dfe7 100644 --- a/cmd/geth/js_test.go +++ b/cmd/geth/js_test.go @@ -8,11 +8,11 @@ // // go-ethereum 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 +// 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 go-ethereum. If not, see <http://www.gnu.org/licenses/>. +// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>. package main @@ -37,6 +37,7 @@ import ( "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/eth" + "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/rpc/codec" "github.com/ethereum/go-ethereum/rpc/comms" ) @@ -89,9 +90,9 @@ func testREPL(t *testing.T, config func(*eth.Config)) (string, *testjethre, *eth t.Fatal(err) } - // set up mock genesis with balance on the testAddress - core.GenesisAccounts = []byte(testGenesis) + db, _ := ethdb.NewMemDatabase() + core.WriteGenesisBlockForTesting(db, common.HexToAddress(testAddress), common.String2Big(testBalance)) ks := crypto.NewKeyStorePlain(filepath.Join(tmp, "keystore")) am := accounts.NewManager(ks) conf := ð.Config{ @@ -102,6 +103,7 @@ func testREPL(t *testing.T, config func(*eth.Config)) (string, *testjethre, *eth Name: "test", SolcPath: testSolcPath, PowTest: true, + NewDB: func(path string) (common.Database, error) { return db, nil }, } if config != nil { config(conf) @@ -157,7 +159,7 @@ func TestAccounts(t *testing.T) { defer os.RemoveAll(tmp) checkEvalJSON(t, repl, `eth.accounts`, `["`+testAddress+`"]`) - checkEvalJSON(t, repl, `eth.coinbase`, `null`) + checkEvalJSON(t, repl, `eth.coinbase`, `"`+testAddress+`"`) val, err := repl.re.Run(`personal.newAccount("password")`) if err != nil { t.Errorf("expected no error, got %v", err) @@ -168,6 +170,7 @@ func TestAccounts(t *testing.T) { } checkEvalJSON(t, repl, `eth.accounts`, `["`+testAddress+`","`+addr+`"]`) + } func TestBlockChain(t *testing.T) { |