From 4704b949f3db3e6e5cb56126f0c9863a6f467623 Mon Sep 17 00:00:00 2001 From: EclesioMeloJunior Date: Wed, 7 Feb 2024 15:15:09 -0400 Subject: [PATCH] chore: remove deltas from imports.go --- lib/runtime/wazero/imports.go | 37 +++++++++++++++-------------------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/lib/runtime/wazero/imports.go b/lib/runtime/wazero/imports.go index e1bf5c1a136..60023c72d25 100644 --- a/lib/runtime/wazero/imports.go +++ b/lib/runtime/wazero/imports.go @@ -92,23 +92,22 @@ func ext_logging_log_version_1(ctx context.Context, m api.Module, level int32, t target := string(read(m, targetData)) msg := string(read(m, msgData)) - line := fmt.Sprintf("target=%s message=%s\n", target, msg) - fmt.Print(line) - - // switch int(level) { - // case 0: - // logger.Critical(line) - // case 1: - // logger.Warn(line) - // case 2: - // logger.Info(line) - // case 3: - // logger.Debug(line) - // case 4: - // logger.Trace(line) - // default: - // logger.Errorf("level=%d target=%s message=%s", int(level), target, msg) - // } + line := fmt.Sprintf("target=%s message=%s", target, msg) + + switch int(level) { + case 0: + logger.Critical(line) + case 1: + logger.Warn(line) + case 2: + logger.Info(line) + case 3: + logger.Debug(line) + case 4: + logger.Trace(line) + default: + logger.Errorf("level=%d target=%s message=%s", int(level), target, msg) + } } func ext_crypto_ed25519_generate_version_1( @@ -838,16 +837,12 @@ func ext_trie_blake2_256_ordered_root_version_2( data := read(m, dataSpan) - fmt.Printf("ext_trie_blake2_256_ordered_root_version_2 with pre parse: %v\n", version) - stateVersion, err := trie.ParseVersion(version) if err != nil { logger.Errorf("failed parsing state version: %s", err) return 0 } - fmt.Printf("ext_trie_blake2_256_ordered_root_version_2 with pos parse: %s\n", stateVersion.String()) - var values [][]byte err = scale.Unmarshal(data, &values) if err != nil {