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

Try using explorer first when sending transaction #461

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions scripts/network/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@
}

async submitProposal({
name,

Check warning on line 120 in scripts/network/network.js

View workflow job for this annotation

GitHub Actions / Run linters

'name' is defined but never used. Allowed unused args must match /^_/u
url,

Check warning on line 121 in scripts/network/network.js

View workflow job for this annotation

GitHub Actions / Run linters

'url' is defined but never used. Allowed unused args must match /^_/u
nPayments,

Check warning on line 122 in scripts/network/network.js

View workflow job for this annotation

GitHub Actions / Run linters

'nPayments' is defined but never used. Allowed unused args must match /^_/u
start,
address,
monthlyPayment,
Expand Down Expand Up @@ -153,6 +153,7 @@

async #callRPC(api, isText = false) {
const cRes = await this.#fetchNode(api);
if (!cRes.ok) throw new Error('Failed to call rpc');
const cResTxt = await cRes.text();
if (isText) return cResTxt;
// RPC calls with filters might return empty string instead of empty JSON,
Expand Down
6 changes: 5 additions & 1 deletion scripts/network/network_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,11 @@ class NetworkManager {

async sendTransaction(hex) {
try {
const data = await this.#retryWrapper('sendTransaction', true, hex);
const data = await this.#retryWrapper(
'sendTransaction',
false,
hex
);

// Throw and catch if the data is not a TXID
if (!data.result || data.result.length !== 64) throw data;
Expand Down
Loading