Skip to content

Fix/sha 256#153

Merged
Nanle-code merged 7 commits into
Nanle-code:masterfrom
Power70:fix/SHA-256
May 28, 2026
Merged

Fix/sha 256#153
Nanle-code merged 7 commits into
Nanle-code:masterfrom
Power70:fix/SHA-256

Conversation

@Power70
Copy link
Copy Markdown
Contributor

@Power70 Power70 commented May 27, 2026

Closes #97


PR: Replace placeholder WASM hash with SHA-256 in deploy flow

Issue: #97

Summary

This change replaces the placeholder rolling hash in the deploy flow with a real SHA-256 digest of the raw .wasm bytes. The deploy output now uses Soroban-aligned terminology so developers can compare the local hash with the value reported by Stellar tooling.

It also removes the last hardcoded secret-like test value from the repository. Secret validation tests now read STARFORGE_TEST_SECRET_KEY from the environment at runtime.

What Changed

  • Updated src/commands/deploy.rs to compute the local WASM hash with SHA-256.
  • Aligned deploy output labels and comments with Soroban/WASM hash conventions.
  • Added fixture-backed validation using tests/fixtures/minimal.wasm.
  • Fixed the unrelated compile breakages in src/commands/new.rs and src/utils/templates.rs so the workspace builds cleanly again.
  • Moved the secret-key test vector out of the codebase and into the runtime environment.
  • Updated the root README.md to document the SHA-256 deploy hash and the env-based test secret.

Security Notes

The secret used by src/utils/config.rs tests is not generated or stored in the repository. It should be created externally and injected through STARFORGE_TEST_SECRET_KEY when running tests locally or in CI.

Example:

$env:STARFORGE_TEST_SECRET_KEY = "S..."  # valid 56-character Stellar secret key
cargo test

Validation

  • cargo test test_valid_plain_secret_key -- --nocapture
  • cargo test

Both commands pass when STARFORGE_TEST_SECRET_KEY is set in the environment.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 27, 2026

@Power70 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Nanle-code Nanle-code merged commit 0d76e01 into Nanle-code:master May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue 6: Replace placeholder WASM hash with SHA-256 in deploy flow

2 participants