Skip to content

Commit

Permalink
Merge pull request #104 from make-software/CSDK/added_missing_updates
Browse files Browse the repository at this point in the history
Added missing updates
  • Loading branch information
ZhmakAS authored Jul 18, 2024
2 parents 722d5c6 + 2996fd1 commit 0e69769
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 25 deletions.
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
module github.com/make-software/casper-go-sdk

go 1.19
go 1.21

require (
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1
github.com/shopspring/decimal v1.3.1
github.com/stretchr/testify v1.8.2
golang.org/x/crypto v0.18.0
golang.org/x/crypto v0.23.0
golang.org/x/sync v0.6.0
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/kr/pretty v0.1.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/sys v0.20.0 // indirect
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
14 changes: 4 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,12 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g=
golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0=
golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc=
golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg=
golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI=
golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
5 changes: 3 additions & 2 deletions sse/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,9 @@ type (

type (
StepPayload struct {
EraID uint64 `json:"era_id"`
ExecutionEffect types.Effect `json:"execution_effect"`
EraID uint64 `json:"era_id"`
ExecutionEffect types.Effect `json:"execution_effect"`
ExecutionEffects types.Effects `json:"execution_effects"`
}
StepEvent struct {
Step StepPayload `json:"step"`
Expand Down
14 changes: 14 additions & 0 deletions types/entry_point.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ type EntryPointType string
const (
EntryPointTypeSession EntryPointType = "Session"
EntryPointTypeContract EntryPointType = "Contract"
EntryPointTypeCaller EntryPointType = "Caller"
EntryPointTypeCalled EntryPointType = "Called"
EntryPointTypeFactory EntryPointType = "Factory"
)

// EntryPointPayment An enum specifying who pays for the invocation and execution of the entrypoint.
type EntryPointPayment string

const (
EntryPointPaymentCaller EntryPointPayment = "Caller"
EntryPointPaymentSelfOnly EntryPointPayment = "SelfOnly"
EntryPointPaymentSelfOnward EntryPointPayment = "SelfOnward"
)

// EntryPointValue The encapsulated representation of entrypoints.
Expand All @@ -36,6 +48,8 @@ type EntryPointV1 struct {
Args []EntryPointArg `json:"args"`
// Context of method execution
EntryPointType EntryPointType `json:"entry_point_type"`
// Context of method execution
EntryPointPayment EntryPointPayment `json:"entry_point_payment"`
// Name of the entry point
Name string `json:"name"`
// Returned type
Expand Down
3 changes: 3 additions & 0 deletions types/execution_result.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,9 @@ type ExecutionResultStatusData struct {
ErrorMessage string `json:"error_message"`
}

// Effects A log of all transforms produced during execution, used only in 2.0+ Network
type Effects []TransformV2

type Effect struct {
Operations []Operation `json:"operations"`
Transforms []TransformKey `json:"transforms"`
Expand Down
1 change: 0 additions & 1 deletion types/key/balance_hold_addr.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ func NewBalanceHoldAddrFromBuffer(buf *bytes.Buffer) (BalanceHoldAddr, error) {
default:
panic("Unexpected BalanceHoldAddr type")
}
return BalanceHoldAddr{}, nil
}

func (h *BalanceHoldAddr) UnmarshalJSON(data []byte) error {
Expand Down
2 changes: 1 addition & 1 deletion types/stored_value.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type StoredValue struct {
Contract *Contract `json:"Contract,omitempty"`
ContractWASM *json.RawMessage `json:"ContractWASM,omitempty"`
ContractPackage *ContractPackage `json:"ContractPackage,omitempty"`
Transfer *TransferV1 `json:"LegacyTransfer,omitempty"`
LegacyTransfer *TransferV1 `json:"LegacyTransfer,omitempty"`
DeployInfo *DeployInfo `json:"DeployInfo,omitempty"`
EraInfo *EraInfo `json:"EraInfo,omitempty"`
Bid *Bid `json:"Bid,omitempty"`
Expand Down
23 changes: 15 additions & 8 deletions types/transfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,18 @@ type Transfer struct {

// source originTransferV1, nil if constructed from TransferV2
originTransferV1 *TransferV1
// source originTransferV2, nil if constructed from TransferV1
originTransferV2 *TransferV2
}

func (h *Transfer) GetTransferV1() *TransferV1 {
return h.originTransferV1
}

func (h *Transfer) GetTransferV2() *TransferV2 {
return h.originTransferV2
}

func (h *Transfer) UnmarshalJSON(bytes []byte) error {
versioned := struct {
Version1 *TransferV1 `json:"Version1,omitempty"`
Expand All @@ -46,14 +52,15 @@ func (h *Transfer) UnmarshalJSON(bytes []byte) error {

if versioned.Version2 != nil {
*h = Transfer{
Amount: versioned.Version2.Amount,
TransactionHash: versioned.Version2.TransactionHash,
From: versioned.Version2.From,
Gas: versioned.Version2.Gas,
ID: versioned.Version2.ID,
Source: versioned.Version2.Source,
Target: versioned.Version2.Target,
To: versioned.Version2.To,
Amount: versioned.Version2.Amount,
TransactionHash: versioned.Version2.TransactionHash,
From: versioned.Version2.From,
Gas: versioned.Version2.Gas,
ID: versioned.Version2.ID,
Source: versioned.Version2.Source,
Target: versioned.Version2.Target,
To: versioned.Version2.To,
originTransferV2: versioned.Version2,
}
return nil
}
Expand Down

0 comments on commit 0e69769

Please sign in to comment.