Skip to content

Commit d54e5f0

Browse files
authored
Merge pull request #982 from CosmWasm/empty-data
Document the use of data: Some(b"") for clearing data
2 parents ff66d1b + 84e9ad2 commit d54e5f0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

SEMANTICS.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,9 @@ to the caller of `execute` (either the client or another transaction), just as
292292
if the original `execute` and returned `data: Some(b"better idea")`. If `reply`
293293
returns `data: None`, it will not modify any previously set data state. If there
294294
are multiple submessages all setting this, only the last one is used (they all
295-
overwrite any previous `data` value).
295+
overwrite any previous `data` value). As a consequence, you can use
296+
`data: Some(b"")` to clear previously set data. This will be represented as a
297+
JSON string instead of `null` and handled as any other `Some` value.
296298

297299
#### Order and Rollback
298300

0 commit comments

Comments
 (0)