Skip to content

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

Merged
Xhristin3 merged 1 commit into
Gatheraa:mainfrom
Alqku:fix/issue-513-precision-in-common
Jun 28, 2026
Merged

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

Conversation

@Alqku

@Alqku Alqku commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

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

@Xhristin3 Xhristin3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Xhristin3 Xhristin3 merged commit 2f94a0d into Gatheraa:main Jun 28, 2026
11 checks passed
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

2 participants