aboutsummaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-01-13 23:37:30 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-01-13 23:37:30 +0800
commit499bc404e818848e53c8c7f4f6d1bfe2349e97ae (patch)
tree3f6540b3982e9a61854589d5d1e1aa0753bca67d /rpc
parenta81d835e4d27f600fac31f74d938d0b6502c3072 (diff)
downloadgo-tangerine-499bc404e818848e53c8c7f4f6d1bfe2349e97ae.tar
go-tangerine-499bc404e818848e53c8c7f4f6d1bfe2349e97ae.tar.gz
go-tangerine-499bc404e818848e53c8c7f4f6d1bfe2349e97ae.tar.bz2
go-tangerine-499bc404e818848e53c8c7f4f6d1bfe2349e97ae.tar.lz
go-tangerine-499bc404e818848e53c8c7f4f6d1bfe2349e97ae.tar.xz
go-tangerine-499bc404e818848e53c8c7f4f6d1bfe2349e97ae.tar.zst
go-tangerine-499bc404e818848e53c8c7f4f6d1bfe2349e97ae.zip
Stub missing UnmarshalJSON methods
Diffstat (limited to 'rpc')
-rw-r--r--rpc/packages.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/rpc/packages.go b/rpc/packages.go
index e5ed995e7..d371c4ca1 100644
--- a/rpc/packages.go
+++ b/rpc/packages.go
@@ -197,6 +197,13 @@ type NewTxArgs struct {
// Hash string
// }
+func (obj *NewTxArgs) UnmarshalJSON(b []byte) (err error) {
+ if err = json.Unmarshal(b, obj); err == nil {
+ return
+ }
+ return NewErrorResponse(ErrorDecodeArgs)
+}
+
func (a *NewTxArgs) requirements() error {
if a.Recipient == "" {
return NewErrorResponse("Transact requires a 'recipient' address as argument")
@@ -233,6 +240,15 @@ type PushTxArgs struct {
Tx string `json:"tx"`
}
+func (obj *PushTxArgs) UnmarshalJSON(b []byte) (err error) {
+ arg0 := ""
+ if err = json.Unmarshal(b, arg0); err == nil {
+ obj.Tx = arg0
+ return
+ }
+ return NewErrorResponse(ErrorDecodeArgs)
+}
+
func (a *PushTxArgs) requirementsPushTx() error {
if a.Tx == "" {
return NewErrorResponse("PushTx requires a 'tx' as argument")