Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MoveCall arguments fail to unmarshal GasCoin #16

Open
eli-d opened this issue Feb 29, 2024 · 0 comments
Open

MoveCall arguments fail to unmarshal GasCoin #16

eli-d opened this issue Feb 29, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@eli-d
Copy link

eli-d commented Feb 29, 2024

Provide Your Environment

SDK v1.0.5

Describe the bug

Client is unable to unmarshal MoveCallSuiTransaction for Move calls that contain the argument GasCoin, for example this transaction on mainnet. The current type assumes that arguments will always either contain Input or Result, so the string GasCoin fails to unmarshal.

json: cannot unmarshal string into Go struct field MoveCallSuiTransaction.transaction.data.transaction.transactions.MoveCall.arguments of type struct { Input int "json:\"Input,omitempty\""; Result int "json:\"Result,omitempty\"" }

Steps or screenshots to reproduce the behavior

client := sui.NewSuiClient("https://fullnode.mainnet.sui.io:443")
_, err := client.SuiGetTransactionBlock(context.Background(), models.SuiGetTransactionBlockRequest{
    Digest: "62PMou5oXnS7eHEveHEJzBGZTAiEa7YMNDdKA58sb5wS",
    Options: models.SuiTransactionBlockOptions{
        ShowInput: true,
    },
})

if err != nil {
    panic(err)
}

Expected behavior

The type MoveSuiCallTransaction.Arguments is able to accept GasCoin as an argument, for example

type MoveCallSuiTransaction struct {
	Package       string   `json:"package"`
	Module        string   `json:"module"`
	Function      string   `json:"function"`
	TypeArguments []string `json:"type_arguments"`
+	Arguments     []interface{}
-	Arguments     []struct {
-	 	Input  int `json:"Input,omitempty"`
-	        Result int `json:"Result,omitempty"`
-	} `json:"arguments"`

}
@eli-d eli-d added the bug Something isn't working label Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant