Add sui request err info
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/block-vision/sui-go-sdk/common/httpconn"
|
||||
"github.com/block-vision/sui-go-sdk/models"
|
||||
"github.com/block-vision/sui-go-sdk/utils"
|
||||
@@ -161,7 +162,7 @@ func (s *suiReadSystemFromSuiImpl) SuiXGetStakes(ctx context.Context, req models
|
||||
}
|
||||
err = json.Unmarshal([]byte(gjson.ParseBytes(respBytes).Get("result").String()), &rsp)
|
||||
if err != nil {
|
||||
return rsp, err
|
||||
return rsp, fmt.Errorf("unmarshal suix_getStakes err: %v response: %s", err, string(respBytes))
|
||||
}
|
||||
return rsp, nil
|
||||
}
|
||||
@@ -183,7 +184,7 @@ func (s *suiReadSystemFromSuiImpl) SuiXGetStakesByIds(ctx context.Context, req m
|
||||
}
|
||||
err = json.Unmarshal([]byte(gjson.ParseBytes(respBytes).Get("result").String()), &rsp)
|
||||
if err != nil {
|
||||
return rsp, err
|
||||
return rsp, fmt.Errorf("unmarshal suix_getStakesByIds err: %v response: %s", err, string(respBytes))
|
||||
}
|
||||
return rsp, nil
|
||||
}
|
||||
@@ -207,7 +208,7 @@ func (s *suiReadSystemFromSuiImpl) SuiXGetEpochs(ctx context.Context, req models
|
||||
}
|
||||
err = json.Unmarshal([]byte(gjson.ParseBytes(respBytes).Get("result").String()), &rsp)
|
||||
if err != nil {
|
||||
return rsp, err
|
||||
return rsp, fmt.Errorf("unmarshal suix_getEpochs err: %v response: %s", err, string(respBytes))
|
||||
}
|
||||
return rsp, nil
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/block-vision/sui-go-sdk/common/httpconn"
|
||||
"github.com/block-vision/sui-go-sdk/models"
|
||||
"github.com/tidwall/gjson"
|
||||
@@ -57,7 +58,7 @@ func (s *suiReadTransactionFromSuiImpl) SuiGetTransactionBlock(ctx context.Conte
|
||||
}
|
||||
err = json.Unmarshal([]byte(gjson.ParseBytes(respBytes).Get("result").Raw), &rsp)
|
||||
if err != nil {
|
||||
return rsp, err
|
||||
return rsp, fmt.Errorf("unmarshal sui_getTransactionBlock err: %v response: %s", err, string(respBytes))
|
||||
}
|
||||
return rsp, nil
|
||||
}
|
||||
@@ -80,7 +81,7 @@ func (s *suiReadTransactionFromSuiImpl) SuiMultiGetTransactionBlocks(ctx context
|
||||
}
|
||||
err = json.Unmarshal([]byte(gjson.ParseBytes(respBytes).Get("result").Raw), &rsp)
|
||||
if err != nil {
|
||||
return rsp, err
|
||||
return rsp, fmt.Errorf("unmarshal sui_multiGetTransactionBlocks err: %v response: %s", err, string(respBytes))
|
||||
}
|
||||
return rsp, nil
|
||||
}
|
||||
@@ -108,7 +109,7 @@ func (s *suiReadTransactionFromSuiImpl) SuiXQueryTransactionBlocks(ctx context.C
|
||||
}
|
||||
err = json.Unmarshal([]byte(gjson.ParseBytes(respBytes).Get("result").Raw), &rsp)
|
||||
if err != nil {
|
||||
return rsp, err
|
||||
return rsp, fmt.Errorf("unmarshal suix_queryTransactionBlocks err: %v response: %s", err, string(respBytes))
|
||||
}
|
||||
return rsp, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user