This repository has been archived by the owner on Feb 21, 2024. It is now read-only.
forked from paritytech/substrate
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Move `Schedule` from Storage to Config * Updated CHANGELOG * Fix nits from review * Fix migration * Print the debug buffer as tracing message * Use `debug` instead of `trace` and update README * Add additional assert to test * Rename `schedule_version` to `instruction_weights_version` * Fixed typo * Added more comments to wat fixtures * Add clarification for the `debug_message` field
- Loading branch information
Showing
23 changed files
with
1,465 additions
and
1,056 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
;; Emit a "Hello World!" debug message | ||
(module | ||
(import "seal0" "seal_debug_message" (func $seal_debug_message (param i32 i32) (result i32))) | ||
(import "env" "memory" (memory 1 1)) | ||
|
||
(data (i32.const 0) "\fc") | ||
|
||
(func (export "call") | ||
(call $seal_debug_message | ||
(i32.const 0) ;; Pointer to the text buffer | ||
(i32.const 12) ;; The size of the buffer | ||
) | ||
;; the above call traps because we supplied invalid utf8 | ||
unreachable | ||
) | ||
|
||
(func (export "deploy")) | ||
) |
28 changes: 28 additions & 0 deletions
28
frame/contracts/fixtures/debug_message_logging_disabled.wat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
;; Emit a "Hello World!" debug message but assume that logging is disabled. | ||
(module | ||
(import "seal0" "seal_debug_message" (func $seal_debug_message (param i32 i32) (result i32))) | ||
(import "env" "memory" (memory 1 1)) | ||
|
||
(data (i32.const 0) "Hello World!") | ||
|
||
(func $assert_eq (param i32 i32) | ||
(block $ok | ||
(br_if $ok | ||
(i32.eq (get_local 0) (get_local 1)) | ||
) | ||
(unreachable) | ||
) | ||
) | ||
|
||
(func (export "call") | ||
(call $assert_eq | ||
(call $seal_debug_message | ||
(i32.const 0) ;; Pointer to the text buffer | ||
(i32.const 12) ;; The size of the buffer | ||
) | ||
(i32.const 9) ;; LoggingDisabled return code | ||
) | ||
) | ||
|
||
(func (export "deploy")) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
;; Emit a "Hello World!" debug message | ||
(module | ||
(import "seal0" "seal_debug_message" (func $seal_debug_message (param i32 i32) (result i32))) | ||
(import "env" "memory" (memory 1 1)) | ||
|
||
(data (i32.const 0) "Hello World!") | ||
|
||
(func $assert_eq (param i32 i32) | ||
(block $ok | ||
(br_if $ok | ||
(i32.eq (get_local 0) (get_local 1)) | ||
) | ||
(unreachable) | ||
) | ||
) | ||
|
||
(func (export "call") | ||
(call $assert_eq | ||
(call $seal_debug_message | ||
(i32.const 0) ;; Pointer to the text buffer | ||
(i32.const 12) ;; The size of the buffer | ||
) | ||
(i32.const 0) ;; success return code | ||
) | ||
) | ||
|
||
(func (export "deploy")) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.