3 Commits

Author SHA1 Message Date
zhaoweijie
93d969ce86 feat: change ClientResponse.result struct 2024-12-05 18:06:56 +08:00
zhaoweijie
f46b1a08ee feat: change ClientResponse.result struct 2024-12-05 17:50:39 +08:00
Nex Zhu
a4c99c70f4 refactor: remove sdk-go dir 2024-11-29 17:57:52 +08:00
6 changed files with 7 additions and 11 deletions

View File

@@ -19,7 +19,7 @@ func TestStruct(t *testing.T) {
}
func genClient() (*Client, error) {
url := "https://cpnode.demo.internetapi.cn/api/ctrlproxy/SCIDE"
url := "http://021.node.internetapi.cn:43030/SCIDE"
pub, err := sm2util.ParsePublicKey("04153ad2d70e67741e0fc33e0c92c702e2afba2480dbea73d23fd02a3ce3a1b69979a7006a8e045f8836ae4797a8fe426823d7ad3450817e794948c8e47b60b711")
if err != nil {
@@ -86,7 +86,7 @@ func TestClient_ExecuteContract(t *testing.T) {
t.Error(err)
}
resp, err := client.ExecuteContract("ShanxiControlProxy", "listRepository", "", false, true)
resp, err := client.ExecuteContract("GlobalRouter", "resolveDoIdTest", "{\"doId\":\"bdtest021/ControlProxy\"}", false, true)
if err != nil {
t.Log(resp)

View File

@@ -8,14 +8,10 @@ type HttpResponse[D any] struct {
// ClientResponse represents a generic response structure
type ClientResponse[T any] struct {
NeedSeq bool `json:"needSeq,omitempty"`
Seq int `json:"seq,omitempty"`
Status string `json:"status,omitempty"`
Result struct {
Data T `json:"data,omitempty"`
Count int `json:"count,omitempty"`
Code int `json:"code,omitempty"`
} `json:"result,omitempty"`
NeedSeq bool `json:"needSeq,omitempty"`
Seq int `json:"seq,omitempty"`
Status string `json:"status,omitempty"`
Result T `json:"result,omitempty"`
IsInsnLimit bool `json:"isInsnLimit,omitempty"`
TotalGas int `json:"totalGas,omitempty"`
ExecutionGas int `json:"executionGas,omitempty"`

View File

@@ -4,4 +4,4 @@ go 1.23
require github.com/tjfoc/gmsm v1.4.1
require golang.org/x/sync v0.9.0 // indirect
require golang.org/x/sync v0.9.0