Commit graph

193 commits

Author SHA1 Message Date
Olaoluwa Osuntokun
033b00dd1c Properly set reply.Result to output of unmarshalled GetTxOutResult JSON.
Fix panic caused by nil pointer dereference.

Create new error type for invalid tx vout (gettxout).
2014-07-15 09:46:25 -04:00
Dave Collins
8005d2e455 Update TODO list in README.
This package has supported https for quite some time.
2014-07-07 22:40:32 -05:00
David Hill
2e0a243383 Support gettxout 2014-07-04 10:46:21 -04:00
Dave Collins
6aa6bec7fc goimports -w . 2014-07-02 19:41:28 -05:00
Dave Collins
2d32ed6ba7 Add MaxTime field support from BIP0023 mutations. 2014-06-30 10:38:15 -05:00
Dave Collins
e2e688e3d6 Make a compatibility pass.
This commit modifies some of the types of the values to better match the
reference client JSON-RPC API.
2014-06-29 16:35:53 -05:00
Dave Collins
ed76ff2172 Add BIP0023 block proposal fields.
This commit adds the optional block proposal fields defined by BIP0023 to
the GetBlockTemplateResult and TemplateRequest types.

ok @jcvernaleo
2014-06-27 13:03:00 -05:00
Dave Collins
b5db9fb485 Add BIP0023 basic pool extension fields.
This commit adds the optional basic pool extension fields defined by
BIP0023 to the GetBlockTemplateResult GetBlockTemplateCmd types.

ok @jcvernaleo
2014-06-27 13:02:46 -05:00
Dave Collins
b6c474de2a Add support for BIP0022 GetBlockTemplateResult.
This commit adds a new result type for the getblocktemplate RPC which
provides the fields as defined by BIP0022.  The extension fields defined
by BIP0023 are not included yet.

ok @jcvernaleo
2014-06-27 13:02:28 -05:00
Dave Collins
5290cb1186 Allow more BIP0022 fields in GetBlockTemplateCmd.
BIP0022 defines optional fields in a getblocktemplate request for long
polling and template tweaking.

In addition, for template tweaking, there are two fields, sigoplimit and
sizelimit, which are atypical in that they are allowed to be either
booleans or numeric.  This requires the fields to be represented as
interfaces which means any code making use of the struct will need to use
type assertions or a type switch.

This commit updates GetBlockTemplateCmd accordingly.

ok @jcvernaleo
2014-06-27 13:02:11 -05:00
Dave Collins
dc84f95fe9 Name field WorkID to make golint happy. 2014-06-27 00:30:37 -05:00
Josh Rickmar
00874b6ec2 Unmarshal correct lockunspent outpoints parameter. 2014-06-23 16:51:21 -05:00
Dave Collins
370899e1fc Change RawTxInput.Vout to uint32 as well.
This was missed by the previous commit.
2014-06-16 15:49:40 -05:00
Dave Collins
b585d4e3a0 Make params which reference txout indices uint32.
This reasons for this change follow:

- All instances of the same key should be consistent amongst the commands
  and returns
- Output indices can't be negative, so rather than adding more code to
  check for a negative after unmarshal, just allow the unmarshal to weed
  out negatives

ok @jcvernaleo
2014-06-16 14:44:04 -05:00
Dave Collins
1997d73c65 Alphabetize result type declarations. 2014-06-13 17:06:41 -05:00
John C. Vernaleo
3d7749fcea Change PingTime and PingWait to float64.
This is to match bitcoin-core.  Caught by Skelsey.

Closes #24
2014-06-12 15:36:57 -04:00
Dave Collins
ac5cc1d64e Use default genproclimit of -1 on setgenerate RPC.
The correct default for the genproclimit on the setgenerate RPC is -1.

ok @jcvernaleo.
2014-06-12 14:23:38 -05:00
Josh Rickmar
93f5aab0db Update test coverage report. 2014-06-11 12:02:35 -05:00
Josh Rickmar
65c0570234 Remove SetId from Cmd interface. 2014-06-11 12:01:05 -05:00
David Hill
39b09f7be1 Add support for estimatefee and estimatepriority. 2014-06-11 11:05:13 -04:00
John C. Vernaleo
92c7716dd4 Update coverage report. 2014-06-10 16:29:56 -04:00
Nicola 'tekNico' Larosa
1723db03c5 Add type and handling for listreceivedbyaddress. 2014-06-10 16:25:53 -04:00
David Hill
66afd1dbc9 Use NewReader instead of NewBuffer. 2014-06-05 13:52:37 -04:00
Josh Rickmar
82e79619a5 Add missing redeemScript to ListUnspentResult.
ok @jcvernaleo
2014-05-21 16:08:19 -05:00
David Hill
529036ec2b Implement getnetworkinfo 2014-05-14 11:45:13 -04:00
David Hill
4f0eb662c8 Support getblockchaininfo 2014-05-12 12:53:34 -04:00
Josh Rickmar
2e126ef597 Rename ListUnspentResult, use correct integer types. 2014-05-09 15:53:50 -05:00
Dave Collins
b993af04b9 Correct misspelled contributor name. 2014-05-05 22:15:37 -05:00
Dave Collins
67abae0dbf Add CONTRIBUTORS file.
Since the github contributors list only lasts for a period of time, it's
better to also maintain a contributors list in the repository rather than
solely relying on github.
2014-05-05 18:29:31 -05:00
GeertJohan
9965019da0 Return pointers to structs
Update doc.go to use proper btcjson result type

Return pointers to structs

Update doc.go to use proper btcjson result type
2014-05-05 17:18:22 -04:00
John C. Vernaleo
a5169bd880 Remove extraneous character that got added to comment. 2014-05-05 09:08:45 -04:00
Geert-Johan Riemer
94451d7a9c Changed strings.Contains(?, "{") to bytes.IndexOf(?, '{')>-1 2014-05-05 13:28:48 +02:00
GeertJohan
4fb5272063 Return pointer to TxRawResult and use bytes.IndexByte instead of Strings.Contains 2014-05-04 17:12:32 +02:00
Dave Collins
4202bf2e93 Make TestNet field name consistent.
The commit makes the TestNet field in GetMiningInfoResult consistent with
InfoResult.
2014-05-03 23:38:47 -05:00
Dave Collins
d443b48994 Improve InfoResult.
This commit modifies InfoResult to remove all of the omitempty tags since
the fields should be present in the marshalled JSON regardless of them
being zero values or not.
2014-05-03 14:05:37 -05:00
Dave Collins
d0a2506a96 Improve GetMiningInfoResult.
This commit modifies the types of the GetMiningInfoResult to better match
their underlying types.  While the information was all available and
accurate, it's nicer to treat numeric values as proper types instead of
all float64s.

Also, a new networkhashps field has been added for compatibility with the
reference implementation.
2014-05-03 12:28:04 -05:00
Josh Rickmar
3fd5904859 Always return unparsableCmds when possible.
This change overrides the cmd return value of custom registered
methods to always return an unparsableCmd if the marshaling as a
JSON-RPC request succeeded, but the request was an invalid structure
for the custom method.
2014-04-25 01:04:24 -05:00
Dave Collins
4595c9d90d Add listreceivedbyaccount concrete result.
ok @jcvernaleo.
2014-04-23 15:47:25 -05:00
Dave Collins
1349f96d8e Correct GetRawMempoolResult types.
The StartingPriority and CurrentPriority fields of the GetRawMempoolResult
are float64s instead of ints.
2014-04-18 12:37:23 -05:00
David Hill
997d98bddf add a few missing and fix misspelled commands. 2014-04-12 10:47:07 -04:00
David Hill
ea7947f74e Add support for decodescript concrete result. 2014-04-12 10:41:32 -04:00
Dave Collins
0ca3d386ed Add support for listaccounts concrete result. 2014-04-12 02:40:06 -05:00
David Hill
372e8c1926 Add support for ListSinceBlockResult
ok @davecgh
2014-04-11 20:17:21 -04:00
David Hill
e6dca4de6f Add UnlockedUntil to InfoResult. 2014-04-11 18:59:10 -04:00
Dave Collins
0a14b19276 Redo ListTransactionsResult fix.
This was also lost in the move to jsonresults.go.
2014-04-11 14:56:55 -05:00
Dave Collins
31a354e585 Add support for registering custom reply parsers.
This commit extends the RegisterCustomCmd function to also accept a reply
parser which will be invoked for replies to the custom command via
ReadResultCmd.  This allows replies to custom commands to be returned a
concrete structs instead of map[string]interface{}.

ok @jcvernaleo, @jrick
2014-04-11 14:27:59 -05:00
David Hill
c2dd398b1e Add support for GetTransactionResult.
ok @jcvernaleo
2014-04-11 14:06:44 -04:00
Josh Rickmar
c6149949a2 Redo the ListTransactionsResult amount->txid fix.
This likely got lost in a merge or the move to the jsonresults.go
file.
2014-04-11 12:39:18 -05:00
Dave Collins
fbe04b73ab Rename jsonresult_test.go -> jsonresults_test.go.
This matches the name of the file that contains the code it is testing.
2014-04-11 11:11:42 -05:00
Dave Collins
48bcbc5a22 Move result structs and funcs to jsonresults.go.
This commit moves all of the structs which deal with command results and
related functions to a new file named jsonresults.go.

This is in preparation of allowing custom results to be registered.

ok @jcvernaleo
2014-04-11 11:09:40 -05:00