Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(governance/remote_executor): add atlas testnet #2071

Merged
merged 1 commit into from
Oct 28, 2024
Merged

Conversation

cctdaniel
Copy link
Contributor

No description provided.

Copy link

vercel bot commented Oct 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
api-reference ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 28, 2024 5:26am
proposals ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 28, 2024 5:26am
staking ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 28, 2024 5:26am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
component-library ⬜️ Ignored (Inspect) Oct 28, 2024 5:26am

Comment on lines +279 to +312
let recent_blockhash = rpc_client.get_latest_blockhash()?;
transaction.sign(signers, recent_blockhash);

// Simulate the transaction
let simulation_result = rpc_client.simulate_transaction(&transaction)?;

// Check if simulation was successful
if let Some(err) = simulation_result.value.err {
println!("Transaction simulation failed: {:?}", err);
if let Some(logs) = simulation_result.value.logs {
println!("Simulation logs:");
for (i, log) in logs.iter().enumerate() {
println!(" {}: {}", i, log);
}
}
return Err(anyhow::anyhow!("Transaction simulation failed"));
}

// If simulation was successful, send the actual transaction
let config = RpcSendTransactionConfig {
skip_preflight: true,
..RpcSendTransactionConfig::default()
};
let transaction_signature = rpc_client.send_transaction_with_config(&transaction, config)?;
println!("Transaction sent: {transaction_signature:?}");

// Wait for confirmation
rpc_client.confirm_transaction_with_spinner(
&transaction_signature,
&recent_blockhash,
rpc_client.commitment(),
)?;

println!("Transaction confirmed: {transaction_signature:?}");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

add more logs to troubleshoot when tx fails

@cctdaniel cctdaniel merged commit 6999fb9 into main Oct 28, 2024
7 checks passed
@cctdaniel cctdaniel deleted the atlas-testnet branch October 28, 2024 08:09
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.

2 participants