Skip to content

fix: define PRECISION in gathera_common, import across workspace#585

Open
Alqku wants to merge 1 commit into
Gatheraa:mainfrom
Alqku:fix/issue-513-precision-in-common
Open

fix: define PRECISION in gathera_common, import across workspace#585
Alqku wants to merge 1 commit into
Gatheraa:mainfrom
Alqku:fix/issue-513-precision-in-common

Conversation

@Alqku

@Alqku Alqku commented Jun 27, 2026

Copy link
Copy Markdown

Summary

storage.rs referenced crate::cross_chain::PRECISION which is pub(crate) in cross_chain.rs. This caused a compile error and accidental coupling between modules. The fix moves PRECISION to gathera_common as the single source of truth.

Changes

  • contract/common/src/lib.rs: add pub const PRECISION: i128 = 1_000_000_000 with a doc-comment explaining its role.
  • contract/contracts/src/storage.rs: import gathera_common::PRECISION and replace both crate::cross_chain::PRECISION references in update_reward.
  • contract/contracts/src/cross_chain.rs: remove the local pub(crate) const PRECISION and re-import from gathera_common for any remaining internal use.

Testing

  • cargo check --workspace exits 0 with no undefined-constant errors.
  • update_reward arithmetic is unchanged; only the import source differs.

Closes #513

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.

[contract][security] PRECISION constant undefined in storage.rs

1 participant