Skip to content

Commit

Permalink
Merge pull request #522 from qdm12/qdm12/host-runtime/u32-to-i32
Browse files Browse the repository at this point in the history
Change `offset` parameter from `u32` to `i32`
  • Loading branch information
lamafab authored Sep 7, 2022
2 parents 0eb8cf5 + 3acdb98 commit 86e6dcb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ab_host-api/child_storage.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ the number of bytes that the entry in storage has beyond the offset.
----
(func $ext_default_child_storage_read_version_1
(param $child_storage_key i64) (param $key i64) (param $value_out i64)
(param $offset u32) (result i64))
(param $offset i32) (result i64))
----

Arguments::
Expand All @@ -62,7 +62,7 @@ child storage key (<<defn-child-storage-type>>).
* `value_out`: a pointer-size (<<defn-runtime-pointer-size>>) to the buffer
to which the value will be written to. This function will never write more then
the length of the buffer, even if the value’s length is bigger.
* `offset`: an u32 integer containing the offset beyond the value should be read
* `offset`: an u32 integer (typed as i32 due to wasm types) containing the offset beyond the value should be read
from.
* `result`: a pointer-size (<<defn-runtime-pointer-size>>) to the SCALE
encoded _Option_ value (<<defn-option-type>>) containing the number of bytes
Expand Down
4 changes: 2 additions & 2 deletions ab_host-api/storage.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ offset.
===== Version 1 - Prototype
----
(func $ext_storage_read_version_1
(param $key i64) (param $value_out i64) (param $offset u32) (result i64))
(param $key i64) (param $value_out i64) (param $offset i32) (result i64))
----

Arguments::
* `key`: a pointer-size (<<defn-runtime-pointer-size>>) containing the key.
* `value_out`: a pointer-size (<<defn-runtime-pointer-size>>) containing the
buffer to which the value will be written to. This function will never write
more then the length of the buffer, even if the value’s length is bigger.
* `offset`: an u32 integer containing the offset beyond the value should be read
* `offset`: an u32 integer (typed as i32 due to wasm types) containing the offset beyond the value should be read
from.
* `result`: a pointer-size (<<defn-runtime-pointer-size>>) pointing to a SCALE
encoded _Option_ value (<<defn-option-type>>) containing an unsigned 32-bit
Expand Down

0 comments on commit 86e6dcb

Please sign in to comment.