Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
GalaxySciTech committed Nov 22, 2023
1 parent d166a44 commit 0a63dbf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
20 changes: 10 additions & 10 deletions patches/web3-utils+1.8.2.patch
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ index f33a432..2f1f190 100644
*/
-var _flattenTypes = function (includeTuple, puts) {
+var _flattenTypes = function(includeTuple, puts) {
// console.log("entered _flattenTypes. inputs/outputs: " + puts)
// console.info("entered _flattenTypes. inputs/outputs: " + puts)
var types = [];
- puts.forEach(function (param) {
+ puts.forEach(function(param) {
Expand All @@ -55,23 +55,23 @@ index f33a432..2f1f190 100644
throw new Error('components found but type is not tuple; report on GitHub');
@@ -112,17 +112,14 @@ var _flattenTypes = function (includeTuple, puts) {
if (Array.isArray(result) && includeTuple) {
// console.log("include tuple word, and its an array. joining...: " + result.types)
// console.info("include tuple word, and its an array. joining...: " + result.types)
types.push('tuple(' + result.join(',') + ')' + suffix);
- }
- else if (!includeTuple) {
+ } else if (!includeTuple) {
// console.log("don't include tuple, but its an array. joining...: " + result)
// console.info("don't include tuple, but its an array. joining...: " + result)
types.push('(' + result.join(',') + ')' + suffix);
- }
- else {
+ } else {
// console.log("its a single type within a tuple: " + result.types)
// console.info("its a single type within a tuple: " + result.types)
types.push('(' + result + ')');
}
- }
- else {
+ } else {
// console.log("its a type and not directly in a tuple: " + param.type)
// console.info("its a type and not directly in a tuple: " + param.type)
types.push(param.type);
}
@@ -135,7 +132,7 @@ var _flattenTypes = function (includeTuple, puts) {
Expand Down Expand Up @@ -315,26 +315,26 @@ index c3b2ded..93a5857 100644
-var _flattenTypes = function(includeTuple, puts)
-{
+var _flattenTypes = function(includeTuple, puts) {
// console.log("entered _flattenTypes. inputs/outputs: " + puts)
// console.info("entered _flattenTypes. inputs/outputs: " + puts)
var types = [];

@@ -124,15 +123,13 @@ var _flattenTypes = function(includeTuple, puts)
if (arrayBracket >= 0) { suffix = param.type.substring(arrayBracket); }
var result = _flattenTypes(includeTuple, param.components);
// console.log("result should have things: " + result)
// console.info("result should have things: " + result)
- if(Array.isArray(result) && includeTuple) {
+ if (Array.isArray(result) && includeTuple) {
// console.log("include tuple word, and its an array. joining...: " + result.types)
// console.info("include tuple word, and its an array. joining...: " + result.types)
types.push('tuple(' + result.join(',') + ')' + suffix);
- }
- else if(!includeTuple) {
+ } else if (!includeTuple) {
// console.log("don't include tuple, but its an array. joining...: " + result)
// console.info("don't include tuple, but its an array. joining...: " + result)
types.push('(' + result.join(',') + ')' + suffix);
- }
- else {
+ } else {
// console.log("its a single type within a tuple: " + result.types)
// console.info("its a single type within a tuple: " + result.types)
types.push('(' + result + ')');
}
@@ -143,8 +140,7 @@ var _flattenTypes = function(includeTuple, puts)
Expand Down
14 changes: 7 additions & 7 deletions src/service/zero/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const parentnetPublicClient = createPublicClient({

export const getBlock = async () => {
const blockNumber = await subnetPublicClient.getBlockNumber();
console.log("viem:" + blockNumber);
console.info("viem:" + blockNumber);
};

export const validateTransactionProof = async (
Expand All @@ -91,7 +91,7 @@ export const validateTransactionProof = async (
args: [cid, key, receiptProof, transactionProof, blockhash],
});
const tx = await parentnetWalletClient.writeContract(request as any);
console.log(tx);
console.info(tx);
};

export const getLatestBlockNumberFromCsc = async () => {
Expand All @@ -115,7 +115,7 @@ export const getIndexFromParentnet = async (): Promise<any> => {
};

export const getProof = async (txhash: string): Promise<any> => {
const res = await fetch("https://devnetstats.apothem.network/subnet", {
const res = await fetch(process.env.SUBNET_URL, {
method: "POST",
body: JSON.stringify({
jsonrpc: "2.0",
Expand Down Expand Up @@ -163,7 +163,7 @@ export const getPayloads = async () => {

export const sync = async () => {
while (true) {
console.log("start sync zero");
console.info("start sync zero");
const payloads = await getPayloads();
if (payloads.length == 0) return;

Expand All @@ -177,7 +177,7 @@ export const sync = async () => {
const cscBlockNumber = await getLatestBlockNumberFromCsc();

if (cscBlockNumber < lastBlockNumber) {
console.log(
console.info(
"wait for csc block lastBlockNumber:" +
lastBlockNumber +
" cscBlockNumber:" +
Expand All @@ -199,10 +199,10 @@ export const sync = async () => {
proof.txProofValues,
proof.blockHash
);
console.log("sync zero index " + i + " success");
console.info("sync zero index " + i + " success");
}
}
console.log("end sync zero ,sleep 10 seconds");
console.info("end sync zero ,sleep 1 seconds");
await sleep(1000);
}
};

0 comments on commit 0a63dbf

Please sign in to comment.