Merge PR #6777: update NewABCIMessageLog to take uint32, update UnsafePackAny comment

This commit is contained in:
Cory 2020-07-18 10:56:41 -07:00 committed by GitHub
parent 5a5a402518
commit 8dcae706db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -648,7 +648,7 @@ func (app *BaseApp) runMsgs(ctx sdk.Context, msgs []sdk.Msg, mode runTxMode) (*s
events = events.AppendEvents(msgEvents) events = events.AppendEvents(msgEvents)
txData.Data = append(txData.Data, &sdk.MsgData{MsgType: msg.Type(), Data: msgResult.Data}) txData.Data = append(txData.Data, &sdk.MsgData{MsgType: msg.Type(), Data: msgResult.Data})
msgLogs = append(msgLogs, sdk.NewABCIMessageLog(uint16(i), msgResult.Log, msgEvents)) msgLogs = append(msgLogs, sdk.NewABCIMessageLog(uint32(i), msgResult.Log, msgEvents))
} }
data, err := proto.Marshal(txData) data, err := proto.Marshal(txData)

View File

@ -87,7 +87,7 @@ func (any *Any) Pack(x proto.Message) error {
// in the case of a packing failure, keeps the cached value. This should only // in the case of a packing failure, keeps the cached value. This should only
// be used in situations where compatibility is needed with amino. Amino-only // be used in situations where compatibility is needed with amino. Amino-only
// values can safely be packed using this method when they will only be // values can safely be packed using this method when they will only be
// marshaled with amino and not protobuf // marshaled with amino and not protobuf.
func UnsafePackAny(x interface{}) *Any { func UnsafePackAny(x interface{}) *Any {
if msg, ok := x.(proto.Message); ok { if msg, ok := x.(proto.Message); ok {
any, err := NewAnyWithValue(msg) any, err := NewAnyWithValue(msg)

View File

@ -39,9 +39,9 @@ func (r Result) GetEvents() Events {
// ABCIMessageLogs represents a slice of ABCIMessageLog. // ABCIMessageLogs represents a slice of ABCIMessageLog.
type ABCIMessageLogs []ABCIMessageLog type ABCIMessageLogs []ABCIMessageLog
func NewABCIMessageLog(i uint16, log string, events Events) ABCIMessageLog { func NewABCIMessageLog(i uint32, log string, events Events) ABCIMessageLog {
return ABCIMessageLog{ return ABCIMessageLog{
MsgIndex: uint32(i), MsgIndex: i,
Log: log, Log: log,
Events: StringifyEvents(events.ToABCIEvents()), Events: StringifyEvents(events.ToABCIEvents()),
} }