Skip to content

fix: Fixed offline mode#593

Merged
r-near merged 9 commits into
mainfrom
offline-mode
May 28, 2026
Merged

fix: Fixed offline mode#593
r-near merged 9 commits into
mainfrom
offline-mode

Conversation

@FroVolod

Copy link
Copy Markdown
Collaborator

No description provided.

@FroVolod FroVolod marked this pull request as ready for review May 23, 2026 08:31
@FroVolod FroVolod requested a review from a team as a code owner May 23, 2026 08:31
@FroVolod

Copy link
Copy Markdown
Collaborator Author

@race-of-sloths

@race-of-sloths

race-of-sloths commented May 23, 2026

Copy link
Copy Markdown

@FroVolod Thank you for your contribution! Your pull request is now a part of the Race of Sloths!
Are you going to win race-of-sloths this month? If so, you should speed up! Run, Sloth, run!

Shows inviting banner with latest news.

Shows profile picture for the author of the PR

Current status: executed
Reviewer Score
@r-near 5

Your contribution is much appreciated with a final score of 5!
You have received 74 (50 base + 20 weekly bonus + 5% lifetime bonus) Sloth points for this contribution

@r-near received 25 Sloth Points for reviewing and scoring this pull request.

Another weekly streak completed, well done @FroVolod! To keep your weekly streak and get another bonus make pull request next week! Looking forward to see you in race-of-sloths

What is the Race of Sloths

Race of Sloths is a friendly competition where you can participate in challenges and compete with other open-source contributors within your normal workflow

For contributors:

  • Tag @race-of-sloths inside your pull requests
  • Wait for the maintainer to review and score your pull request
  • Check out your position in the Leaderboard
  • Keep weekly and monthly streaks to reach higher positions
  • Boast your contributions with a dynamic picture of your Profile

For maintainers:

  • Score pull requests that participate in the Race of Sloths and receive a reward
  • Engage contributors with fair scoring and fast responses so they keep their streaks
  • Promote the Race to the point where the Race starts promoting you
  • Grow the community of your contributors

Feel free to check our website for additional details!

Bot commands
  • For contributors
    • Include a PR: @race-of-sloths include to enter the Race with your PR
  • For maintainers:
    • Invite contributor @race-of-sloths invite to invite the contributor to participate in a race or include it, if it's already a runner.
    • Assign points: @race-of-sloths score [1/2/3/5/8/13] to award points based on your assessment.
    • Reject this PR: @race-of-sloths exclude to send this PR back to the drawing board.
    • Exclude repo: @race-of-sloths pause to stop bot activity in this repo until @race-of-sloths unpause command is called

Copilot AI 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.

Pull request overview

This PR aims to make offline mode usable for transaction preparation paths by avoiding network calls where possible and preventing direct submission while offline.

Changes:

  • Blocks sending transactions when --offline is enabled.
  • Adds cached/offline handling for FT transfer and FT transfer call flows.
  • Updates staking validator input and contract function prompts to avoid online lookups in offline mode.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/transaction_signature_options/send/mod.rs Prevents broadcasting transactions in offline mode.
src/common.rs Adjusts staking validator input for offline mode and updates FT contract list helpers.
src/commands/transaction/print_transaction/mod.rs Corrects documentation for printing signed transactions.
src/commands/tokens/send_ft/mod.rs Adds offline FT contract lookup and skips online storage checks.
src/commands/tokens/send_ft/amount_ft.rs Handles FT amount constraints when offline.
src/commands/tokens/send_ft_call/mod.rs Adds offline FT contract lookup and skips online storage checks for FT calls.
src/commands/tokens/send_ft_call/amount_ft.rs Handles FT call amount constraints when offline.
src/commands/staking/delegate/withdraw.rs Passes global context to validator input.
src/commands/staking/delegate/withdraw_all.rs Passes global context to validator input.
src/commands/staking/delegate/view_balance.rs Passes global context to validator input.
src/commands/staking/delegate/unstake.rs Passes global context to validator input.
src/commands/staking/delegate/unstake_all.rs Passes global context to validator input.
src/commands/staking/delegate/stake.rs Passes global context to validator input.
src/commands/staking/delegate/stake_all.rs Passes global context to validator input.
src/commands/staking/delegate/deposit_and_stake.rs Passes global context to validator input.
src/commands/contract/call_function/mod.rs Avoids ABI lookup for function-name prompts in offline mode.
Comments suppressed due to low confidence (2)

src/commands/tokens/send_ft/mod.rs:237

  • Correct the typo in the warning text: ft-contrat should be ft-contract.
    src/commands/tokens/send_ft_call/mod.rs:190
  • Correct the typo in the warning text: ft-contrat should be ft-contract.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/common.rs Outdated
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
@r-near r-near merged commit 0663bf4 into main May 28, 2026
13 checks passed
@github-project-automation github-project-automation Bot moved this from NEW❗ to Shipped 🚀 in DevTools May 28, 2026
@r-near r-near deleted the offline-mode branch May 28, 2026 19:21
@race-of-sloths

Copy link
Copy Markdown

🥁 Score it!

@r-near, please score the PR with @race-of-sloths score [1/2/3/5/8/13]. The contributor deserves it.
If no scoring is provided within 24 hours, this PR will be scored as 2 🦥

@r-near

r-near commented May 28, 2026

Copy link
Copy Markdown
Contributor

@race-of-sloths score 5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Shipped 🚀

Development

Successfully merging this pull request may close these issues.

5 participants