Skip to content

Commit

Permalink
Merge pull request #33 from arnac-io/daniels/fix-version-types
Browse files Browse the repository at this point in the history
fix Version fields type to uint64.
JaydenLink authored Oct 6, 2024
2 parents 036582e + e06b42e commit b3fb1c9
Showing 3 changed files with 15 additions and 13 deletions.
9 changes: 5 additions & 4 deletions models/read_object.go
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ package models

import (
"encoding/json"

"github.com/tidwall/gjson"
)

@@ -85,7 +86,7 @@ type SuiObjectResponseError struct {
Code string `json:"code"`
Error string `json:"error"`
ObjectId string `json:"object_id"`
Version int `json:"version"`
Version uint64 `json:"version"`
Digest string `json:"digest"`
}

@@ -97,13 +98,13 @@ type ObjectOwner struct {
}

type ObjectShare struct {
InitialSharedVersion int `json:"initial_shared_version"`
InitialSharedVersion uint64 `json:"initial_shared_version"`
}

type SuiRawMoveObject struct {
Type string `json:"type"`
HasPublicTransfer bool `json:"hasPublicTransfer"`
Version int `json:"version"`
Version uint64 `json:"version"`
BcsBytes string `json:"bcsBytes"`
}

@@ -195,7 +196,7 @@ type DynamicFieldInfo struct {
Type string `json:"type"`
ObjectType string `json:"objectType"`
ObjectId string `json:"objectId"`
Version int `json:"version"`
Version uint64 `json:"version"`
Digest string `json:"digest"`
}

17 changes: 9 additions & 8 deletions models/read_transaction.go
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ package models

import (
"encoding/json"

"github.com/tidwall/gjson"
)

@@ -82,7 +83,7 @@ type SuiTransactionBlock struct {

type SuiObjectRef struct {
ObjectId string `json:"objectId"`
Version int `json:"version"`
Version uint64 `json:"version"`
Digest string `json:"digest"`
}

@@ -97,7 +98,7 @@ type SuiGasData struct {
type SuiObjectChangePublished struct {
Type string `json:"type"`
PackageId string `json:"packageId"`
Version int `json:"version"`
Version uint64 `json:"version"`
Digest string `json:"digest"`
Modules []string `json:"modules"`
}
@@ -108,7 +109,7 @@ type SuiObjectChangeTransferred struct {
Recipient ObjectOwner `json:"recipient"`
ObjectType string `json:"objectType"`
ObjectId string `json:"objectId"`
Version int `json:"version"`
Version uint64 `json:"version"`
Digest string `json:"digest"`
}

@@ -118,8 +119,8 @@ type SuiObjectChangeMutated struct {
Owner ObjectOwner `json:"owner"`
ObjectType string `json:"objectType"`
ObjectId string `json:"objectId"`
Version int `json:"version"`
PreviousVersion int `json:"previousVersion"`
Version uint64 `json:"version"`
PreviousVersion uint64 `json:"previousVersion"`
Digest string `json:"digest"`
}

@@ -128,15 +129,15 @@ type SuiObjectChangeDeleted struct {
Sender string `json:"sender"`
ObjectType string `json:"objectType"`
ObjectId string `json:"objectId"`
Version int `json:"version"`
Version uint64 `json:"version"`
}

type SuiObjectChangeWrapped struct {
Type string `json:"type"`
Sender string `json:"sender"`
ObjectType string `json:"objectType"`
ObjectId string `json:"objectId"`
Version int `json:"version"`
Version uint64 `json:"version"`
}

type SuiObjectChangeCreated struct {
@@ -145,7 +146,7 @@ type SuiObjectChangeCreated struct {
Owner ObjectOwner `json:"owner"`
ObjectType string `json:"objectType"`
ObjectId string `json:"objectId"`
Version int `json:"version"`
Version uint64 `json:"version"`
Digest string `json:"digest"`
}

2 changes: 1 addition & 1 deletion models/signature.go
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ type Digest = Base64Data
type ObjectRef struct {
Digest string `json:"digest"`
ObjectId ObjectId `json:"objectId"`
Version int64 `json:"version"`
Version uint64 `json:"version"`
}

type SigScheme string

0 comments on commit b3fb1c9

Please sign in to comment.