Skip to content

Commit

Permalink
Unify the definition of MessageReceipt (#4667)
Browse files Browse the repository at this point in the history
Co-authored-by: 一页素书 <2931107265@qq.com>
  • Loading branch information
diwufeiwen and ta0li committed Jan 4, 2022
1 parent 513a533 commit 0b687b0
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions cmd/show_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ import (
// Receipt is what is returned by executing a message on the vm.
type Receipt struct {
// control field for encoding struct as an array
_ struct{} `cbor:",toarray"`
ExitCode int64 `json:"exitCode"`
ReturnValue []byte `json:"return"`
GasUsed int64 `json:"gasUsed"`
_ struct{} `cbor:",toarray"`
ExitCode int64 `json:"exitCode"`
Return []byte `json:"return"`
GasUsed int64 `json:"gasUsed"`
}

func TestBlockDaemon(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ var stateWaitMsgCmd = &cmds.Command{
writer.Printf("message was executed in tipset: %s\n", mw.TipSet.Cids())
writer.Printf("Exit Code: %d\n", mw.Receipt.ExitCode)
writer.Printf("Gas Used: %d\n", mw.Receipt.GasUsed)
writer.Printf("Return: %x\n", mw.Receipt.ReturnValue)
writer.Printf("Return: %x\n", mw.Receipt.Return)
} else {
writer.Printf("Unable to find message recepit of %s", cid)
}
Expand Down
18 changes: 9 additions & 9 deletions pkg/types/internal/cbor_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pkg/types/internal/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,9 @@ func (m *TxMeta) ToStorageBlock() (block.Block, error) {

// MessageReceipt is what is returned by executing a message on the vm.
type MessageReceipt struct {
ExitCode exitcode.ExitCode `json:"exitCode"`
ReturnValue []byte `json:"return"`
GasUsed int64 `json:"gasUsed"`
ExitCode exitcode.ExitCode `json:"exitCode"`
Return []byte `json:"return"`
GasUsed int64 `json:"gasUsed"`
}

func (r *MessageReceipt) String() string {
Expand Down
2 changes: 1 addition & 1 deletion pkg/types/internal/testing_messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,6 @@ func (rm *ReceiptMaker) NewReceipt() MessageReceipt {
seq := rm.seq
rm.seq++
return MessageReceipt{
ReturnValue: []byte(fmt.Sprintf("%d", seq)),
Return: []byte(fmt.Sprintf("%d", seq)),
}
}

0 comments on commit 0b687b0

Please sign in to comment.