Merge pull request #1719 from CosmWasm/1617_regression

Pass empty attribute value through stack
This commit is contained in:
Alexander Peters
2023-11-15 14:47:23 +01:00
committed by GitHub
2 changed files with 6 additions and 3 deletions

View File

@@ -119,9 +119,9 @@ func TestNewCustomEvents(t *testing.T) {
src: wasmvmtypes.Events{{
Type: "foo",
Attributes: []wasmvmtypes.EventAttribute{{Key: "myKey", Value: "\n\n\n"}},
}}, exp: sdk.Events{sdk.NewEvent("wasm-foo",
sdk.NewAttribute("_contract_address", myContract.String()),
sdk.NewAttribute("myKey", ""))},
}}, exp: sdk.Events{sdk.NewEvent("wasm-foo",
sdk.NewAttribute("_contract_address", myContract.String()),
sdk.NewAttribute("myKey", ""))},
},
"error on short event type": {
src: wasmvmtypes.Events{{

View File

@@ -262,6 +262,9 @@ func (p player) IBCPacketReceive(_ wasmvm.Checksum, _ wasmvmtypes.Env, msg wasmv
return &wasmvmtypes.IBCReceiveResult{
Ok: &wasmvmtypes.IBCReceiveResponse{
Attributes: wasmvmtypes.EventAttributes{
{Key: "empty-value-test"},
},
Acknowledgement: receivedBall.BuildAck().GetBytes(),
Messages: []wasmvmtypes.SubMsg{{Msg: wasmvmtypes.CosmosMsg{IBC: respHit}, ReplyOn: wasmvmtypes.ReplyNever}},
},