Skip to content

Commit

Permalink
rpcv05 update function invocation type
Browse files Browse the repository at this point in the history
  • Loading branch information
rianhughes committed Oct 12, 2023
1 parent 77df1fc commit 58746db
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
6 changes: 6 additions & 0 deletions rpc/types_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ package rpc

import "github.com/NethermindEth/juno/core/felt"

type OrderedEvent struct {
// The order of the event within the transaction
Order int `json:"order"`
Event Event
}

type Event struct {
FromAddress *felt.Felt `json:"from_address"`
Keys []*felt.Felt `json:"keys"`
Expand Down
16 changes: 8 additions & 8 deletions rpc/types_trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,26 +80,26 @@ type FnInvocation struct {
FunctionCall

//The address of the invoking contract. 0 for the root invocation
CallerAddress *felt.Felt `json:"caller_address,omitempty"`
CallerAddress *felt.Felt `json:"caller_address"`

// The hash of the class being called
ClassHash *felt.Felt `json:"class_hash,omitempty"`
ClassHash *felt.Felt `json:"class_hash"`

EntryPointType EntryPointType `json:"entry_point_type,omitempty"`
EntryPointType EntryPointType `json:"entry_point_type"`

CallType CallType `json:"call_type,omitempty"`
CallType CallType `json:"call_type"`

//The value returned from the function invocation
Result []*felt.Felt `json:"result,omitempty"`
Result []*felt.Felt `json:"result"`

// The calls made by this invocation
NestedCalls []FnInvocation `json:"calls,omitempty"`
NestedCalls []FnInvocation `json:"calls"`

// The events emitted in this invocation
InvocationEvents []Event `json:"events,omitempty"`
InvocationEvents []OrderedEvent `json:"events"`

// The messages sent by this invocation to L1
L1Messages []MsgToL1 `json:"messages,omitempty"`
L1Messages []MsgToL1 `json:"messages"`
}

// A single pair of transaction hash and corresponding trace
Expand Down
6 changes: 6 additions & 0 deletions rpc/types_transaction_receipt.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,12 @@ type TransactionReceipt interface {
GetExecutionStatus() TxnExecutionStatus
}

type OrderedMsg struct {
// The order of the message within the transaction
Order int `json:"order"`
MsgToL1 MsgToL1
}

type MsgToL1 struct {
// FromAddress The address of the L2 contract sending the message
FromAddress *felt.Felt `json:"from_address"`
Expand Down

0 comments on commit 58746db

Please sign in to comment.