Changed to new get keys method on database interface

poc8
obscuren 11 years ago
parent 5e7f8cca4f
commit 075acec9e7
  1. 16
      dev_console.go

@ -179,13 +179,13 @@ func (i *Console) ParseInput(input string) bool {
fmt.Println("recipient err:", err) fmt.Println("recipient err:", err)
} else { } else {
tx := ethchain.NewTransaction(recipient, ethutil.Big(tokens[2]), []string{""}) tx := ethchain.NewTransaction(recipient, ethutil.Big(tokens[2]), []string{""})
data, _ := ethutil.Config.Db.Get([]byte("KeyRing"))
keyRing := ethutil.NewValueFromBytes(data) key := ethutil.Config.Db.GetKeys()[0]
tx.Sign(keyRing.Get(0).Bytes()) tx.Sign(key.PrivateKey)
fmt.Printf("%x\n", tx.Hash())
i.ethereum.TxPool.QueueTransaction(tx) i.ethereum.TxPool.QueueTransaction(tx)
}
fmt.Printf("%x\n", tx.Hash())
}
case "gettx": case "gettx":
addr, _ := hex.DecodeString(tokens[1]) addr, _ := hex.DecodeString(tokens[1])
data, _ := ethutil.Config.Db.Get(addr) data, _ := ethutil.Config.Db.Get(addr)
@ -200,9 +200,9 @@ func (i *Console) ParseInput(input string) bool {
code := ethchain.Compile(i.Editor()) code := ethchain.Compile(i.Editor())
contract := ethchain.NewTransaction(ethchain.ContractAddr, ethutil.Big(tokens[1]), code) contract := ethchain.NewTransaction(ethchain.ContractAddr, ethutil.Big(tokens[1]), code)
data, _ := ethutil.Config.Db.Get([]byte("KeyRing"))
keyRing := ethutil.NewValueFromBytes(data) key := ethutil.Config.Db.GetKeys()[0]
contract.Sign(keyRing.Get(0).Bytes()) contract.Sign(key.PrivateKey)
i.ethereum.TxPool.QueueTransaction(contract) i.ethereum.TxPool.QueueTransaction(contract)

Loading…
Cancel
Save