Skip to content

Commit

Permalink
change some commit
Browse files Browse the repository at this point in the history
  • Loading branch information
GalaxySciTech committed Jun 4, 2024
1 parent 495df24 commit a791542
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions scripts/utils/xdcnet.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const fetch = require("node-fetch").default;


function base64ToHex(base64String) {
// Step 1: Decode base64 string to binary data
var binaryString = atob(base64String);
Expand All @@ -25,7 +24,7 @@ async function data(url, number) {

let data0;
try {
console.error("connecting to parentnet at url:", url,);
console.error("connecting to network at url:", url);
const block0res = await fetch(url, {
method: "POST",
body: JSON.stringify(block0),
Expand All @@ -35,15 +34,11 @@ async function data(url, number) {
data0 = await block0res.json();
} catch (e) {
console.error(e, "\n");
throw Error(
"Fetch remote subnet node data error , pls check the subnet node status"
);
throw Error("Fetch remote node data error , pls check the node status");
}

if (!data0["result"]["Committed"]) {
console.error(
"remote subnet node block data 0 or block 1 is not committed"
);
console.error("remote node block " + number + " is not committed");
return;
}
const data0Encoded = "0x" + base64ToHex(data0["result"]["EncodedRLP"]);
Expand Down

0 comments on commit a791542

Please sign in to comment.