Skip to content

Commit

Permalink
Add newWasmModuleEvent test cases for empty values (#1899)
Browse files Browse the repository at this point in the history
  • Loading branch information
chipshort authored Jun 19, 2024
1 parent c6ff9db commit ee8cc55
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions x/wasm/keeper/events_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,18 @@ func TestNewWasmModuleEvent(t *testing.T) {
sdk.NewAttribute("_contract_address", myContract.String()),
sdk.NewAttribute("my-real-key", "some-val"))},
},
"empty value": {
src: []wasmvmtypes.EventAttribute{{Key: "myKey", Value: ""}},
exp: sdk.Events{sdk.NewEvent("wasm",
sdk.NewAttribute("_contract_address", myContract.String()),
sdk.NewAttribute("myKey", ""))},
},
"whitespace-only value": {
src: []wasmvmtypes.EventAttribute{{Key: "myKey", Value: " "}},
exp: sdk.Events{sdk.NewEvent("wasm",
sdk.NewAttribute("_contract_address", myContract.String()),
sdk.NewAttribute("myKey", ""))},
},
"empty elements": {
src: make([]wasmvmtypes.EventAttribute, 10),
isError: true,
Expand Down

0 comments on commit ee8cc55

Please sign in to comment.