xeth, rpc: added nonce setting through RPC and xeth transact

This commit is contained in:
obscuren
2015-05-05 23:08:52 +02:00
parent aa884c052d
commit 03bb88dec0
4 changed files with 27 additions and 5 deletions

View File

@ -157,6 +157,7 @@ func (args *GetBlockByNumberArgs) UnmarshalJSON(b []byte) (err error) {
type NewTxArgs struct {
From string
To string
Nonce *big.Int
Value *big.Int
Gas *big.Int
GasPrice *big.Int
@ -170,6 +171,7 @@ func (args *NewTxArgs) UnmarshalJSON(b []byte) (err error) {
var ext struct {
From string
To string
Nonce interface{}
Value interface{}
Gas interface{}
GasPrice interface{}
@ -200,6 +202,14 @@ func (args *NewTxArgs) UnmarshalJSON(b []byte) (err error) {
args.Data = ext.Data
var num *big.Int
if ext.Nonce != nil {
num, err = numString(ext.Nonce)
if err != nil {
return err
}
}
args.Nonce = num
if ext.Value == nil {
num = big.NewInt(0)
} else {