-
Notifications
You must be signed in to change notification settings - Fork 5
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
Improve local test utils #109
Conversation
33d840b
to
98610d2
Compare
}; | ||
|
||
newActiveDapisHtml += JSON.stringify(dapiInfo, null, 2) + '\n\n'; | ||
} | ||
document.getElementById('activeDapis').innerHTML = newActiveDapisHtml; | ||
}, 1000); | ||
}, 3000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Increased to avoid spamming public RPC providers too much.
@@ -50,6 +50,36 @@ export const deriveRole = (adminRole: string, roleDescription: string) => { | |||
); | |||
}; | |||
|
|||
export const refundFunder = async (funderWallet: ethers.Wallet) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not called, but you can call it manually by editing the script (call this instead of deploying the contracts and funding the sponsor wallets).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I needed to add tx.wait()
for each transaction (otherwise I got errors).
@@ -174,8 +220,8 @@ export const deploy = async (funderWallet: ethers.Wallet, provider: ethers.provi | |||
// Register merkle tree hashes | |||
const timestamp = Math.floor(Date.now() / 1000); | |||
const apiTreeValues = [ | |||
[pusher1Wallet.address, `${pusher1.signedApis[0].url}/default`], // NOTE: Pusher pushes to the "/" of the signed API, but we need to query it additional path. | |||
[pusher2Wallet.address, `${pusher2.signedApis[0].url}/default`], // NOTE: Pusher pushes to the "/" of the signed API, but we need to query it additional path. | |||
[pusher1Wallet.address, joinUrl(pusher1.signedApis[0].url, 'default')], // NOTE: Pusher pushes to the "/" of the signed API, but we need to query it additional path. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of my deployments didn't work because of a double slash in the URL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm gonna merge since I am probably the only one running this example now. Feel free to leave comments.
Rationale
Minor improvements to the local test configuration to make it runnable on other chains. I used that to deploy the contracts on Polygon testnet and run the Pushers and Signed APIs locally.
These are the contracts:
I've used the same dAPIs that were used in the local test, but I've set them up with 1% deviation.