Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
91278c8
Implement support for running against datil-dev
hwrdtm Jun 20, 2024
7ce9b5e
Hack to make work against datil-dev
hwrdtm Jun 20, 2024
b5df915
feat(tinny): remove `LIT_OFFICIAL_RPC` and add `LIT_RPC` enum to supp…
Ansonhkg Jun 27, 2024
26d181c
chore: fix `testLIT` typo
Ansonhkg Jun 27, 2024
0f4065c
fix: import
Ansonhkg Jun 27, 2024
0f5d175
Merge branch 'dev/test-common-updates' into feature/3404-datil-dev-su…
Ansonhkg Jun 27, 2024
9bf76b5
fix(testing): correct test result reporting in runTestsParallel
Ansonhkg Jun 27, 2024
1d66ed0
feat(test): introduce chunked parallel execution
Ansonhkg Jun 27, 2024
1928396
fix(temp): disabled `switchWallet`
Ansonhkg Jun 27, 2024
fcc0fe2
feat(test): LIT_RPC enum
Ansonhkg Jun 27, 2024
e6139c1
feat: add relayer tests
Ansonhkg Jun 28, 2024
155cacb
feat(tinny): temp disabled wallet switching
Ansonhkg Jun 28, 2024
0fb62e3
feat: add datil relayer support
Ansonhkg Jun 28, 2024
bfe0cac
fix(tinny): Simplify and centralize RPC URL handling
Ansonhkg Jun 28, 2024
83c7382
fix(contracts-sdk): correct rpc for browser
Ansonhkg Jun 28, 2024
3e25698
Update local-tests/README.md
Ansonhkg Jun 28, 2024
462d886
Update local-tests/README.md
Ansonhkg Jun 28, 2024
d7fdea8
Update local-tests/setup/shiva-client.ts
Ansonhkg Jun 28, 2024
efd7404
fix: https://github.com/LIT-Protocol/js-sdk/pull/515/files/83c73821c5…
Ansonhkg Jun 28, 2024
a82fe0b
fix: https://github.com/LIT-Protocol/js-sdk/pull/515/files/83c73821c5…
Ansonhkg Jun 28, 2024
8323088
fix: https://github.com/LIT-Protocol/js-sdk/pull/515/files/83c73821c5…
Ansonhkg Jun 28, 2024
0cdddfd
fix: https://github.com/LIT-Protocol/js-sdk/pull/515/files/83c73821c5…
Ansonhkg Jun 28, 2024
e254cfb
fix: https://github.com/LIT-Protocol/js-sdk/pull/515/files/83c73821c5…
Ansonhkg Jun 28, 2024
9be5559
fix: https://github.com/LIT-Protocol/js-sdk/pull/515/files/83c73821c5…
Ansonhkg Jun 28, 2024
b1db2e9
fix: https://github.com/LIT-Protocol/js-sdk/pull/515/files/83c73821c5…
Ansonhkg Jun 28, 2024
936e3ec
fix: https://github.com/LIT-Protocol/js-sdk/pull/515/files/83c73821c5…
Ansonhkg Jun 28, 2024
4e92c94
fix: https://github.com/LIT-Protocol/js-sdk/pull/515/files/83c73821c5…
Ansonhkg Jun 28, 2024
a96640f
fix: https://github.com/LIT-Protocol/js-sdk/pull/515/files/83c73821c5…
Ansonhkg Jun 28, 2024
985db03
fix: https://github.com/LIT-Protocol/js-sdk/pull/515/files/83c73821c5…
Ansonhkg Jun 28, 2024
a84d509
fix: remove random character in the file
Ansonhkg Jun 28, 2024
8c2ec2d
Merge branch 'feature/3404-datil-dev-support' of https://github.com/L…
Ansonhkg Jun 28, 2024
2697093
Update local-tests/setup/shiva-client.ts
Ansonhkg Jun 28, 2024
2c998f6
Update local-tests/setup/shiva-client.ts
Ansonhkg Jun 28, 2024
220fa4f
fix: https://github.com/LIT-Protocol/js-sdk/pull/515/files#r1659243267
Ansonhkg Jun 28, 2024
d73255f
fix: #r1659249390
Ansonhkg Jun 28, 2024
db52690
fix: #r1659266348
Ansonhkg Jun 28, 2024
3573e0a
Update local-tests/setup/tinny-environment.ts
Ansonhkg Jun 28, 2024
1398224
feat: swap staging url to prod
Ansonhkg Jun 28, 2024
fd3da9e
doc: update version
Ansonhkg Jun 28, 2024
f5fd9da
fix: contiune even if failed to generate internalDev
Ansonhkg Jun 28, 2024
8e48ed9
fix: remove process.exit
Ansonhkg Jun 28, 2024
7fa75b2
refac: Prettier
DashKash54 Jul 1, 2024
4868b11
Published version: 6.1.0@datil-dev
DashKash54 Jul 1, 2024
42a9518
fix(test): LIT-3404 - Allow tinny to be run against Cayenne again
MaximusHaximus Jul 2, 2024
4d98940
fix: LIT-3404 - Normalize `Chronicle` spelling in new changes with ex…
MaximusHaximus Jul 2, 2024
2efb2a2
fix(contracts-sdk): LIT-3404 - Adjust PKP mint methods to set `gasLim…
MaximusHaximus Jul 2, 2024
08e56a2
feat: add custom gas limit
Ansonhkg Jul 2, 2024
bc03da9
Merge branch 'feature/3404-datil-dev-support' into feature/3404-add-m…
Ansonhkg Jul 2, 2024
d8bd3e9
chore: add comment
Ansonhkg Jul 2, 2024
c212647
Merge branch 'feature/3404-add-manual-gas-limit' of https://github.co…
Ansonhkg Jul 2, 2024
7450f8b
fix: gasLimit missing on param
Ansonhkg Jul 2, 2024
a6e145d
fix: param optionality
Ansonhkg Jul 2, 2024
2881f6e
fix: upping default gas limit
Ansonhkg Jul 2, 2024
ddb9982
Merge pull request #519 from LIT-Protocol/feature/3404-add-manual-gas…
Ansonhkg Jul 2, 2024
2b2f120
chore: prettier
Ansonhkg Jul 2, 2024
35add79
Merge branch 'master' of https://github.com/LIT-Protocol/js-sdk into …
Ansonhkg Jul 2, 2024
2a0cdb6
fix: linty lint
Ansonhkg Jul 2, 2024
0f0ce25
feat(wrapped-keys): LIT-3404 - Add support for `datil-dev` to wrapped…
MaximusHaximus Jul 2, 2024
87ce2fd
Merge pull request #520 from LIT-Protocol/feature/3404-datil-dev-supp…
MaximusHaximus Jul 2, 2024
3524f56
feat(lit-core): LIT-3404 - Ensure Datil processes Epoch changes, and …
MaximusHaximus Jul 3, 2024
301b761
fix(wrapped-keys): LIT-3404 - Ensure errors thrown from LIT action ex…
MaximusHaximus Jul 3, 2024
9a4408d
fix(local-tests): LIT-3404 - Fix TS error in testUseValidLitActionCod…
MaximusHaximus Jul 3, 2024
aec70d5
test(wrapped-keys): LIT-3404 - Update wrapped-keys tests for datil co…
MaximusHaximus Jul 3, 2024
34d95b6
test(wrapped-keys): LIT-3404 - Update error string checks on failing …
MaximusHaximus Jul 3, 2024
f88591d
test(wrapped-keys): LIT-3404 - Enable generate key tests
MaximusHaximus Jul 3, 2024
2fbd861
fix(wrapped-keys): LIT-3404 - Enforce salt is always included in `cip…
MaximusHaximus Jul 5, 2024
11051ad
Published version: 6.1.0@wrapped-keys
DashKash54 Jul 6, 2024
221c264
Published version: 6.1.0@datil-dev
DashKash54 Jul 6, 2024
53b0532
refac: Prettier
DashKash54 Jul 6, 2024
51ca628
chore(wrapped-keys): LIT-3404 - Throw error if `generatePrivateKey()`…
MaximusHaximus Jul 8, 2024
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
Prev Previous commit
Next Next commit
feat(tinny): temp disabled wallet switching
  • Loading branch information
Ansonhkg committed Jun 28, 2024
commit 155cacb67632a7d61d2f0498b6b5eef9107f53b3
94 changes: 58 additions & 36 deletions local-tests/setup/tinny-environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,25 +436,30 @@ export class TinnyEnvironment {
customContext: networkContext,
});
} else {
// TODO: This wallet should be cached somehwere and reused to create delegation signatures.
// There is a correlation between the number of Capacity Credit NFTs in a wallet and the speed at which nodes can verify a given rate limit authorization. Creating a single wallet to hold all Capacity Credit NFTs improves network performance during tests.
const capacityCreditWallet =
ethers.Wallet.createRandom().connect(provider);

// get wallet balance
// const balance = await wallet.getBalance();
// console.log("this.rpc:", this.rpc);
// console.log('this.wallet.address', wallet.address);
// console.log('Balance:', balance.toString());
// process.exit();

const transferTx = await wallet.sendTransaction({
to: capacityCreditWallet.address,
value: ethers.utils.parseEther('0.001'),
});
await transferTx.wait();
async function _switchWallet() {
// TODO: This wallet should be cached somehwere and reused to create delegation signatures.
// There is a correlation between the number of Capacity Credit NFTs in a wallet and the speed at which nodes can verify a given rate limit authorization. Creating a single wallet to hold all Capacity Credit NFTs improves network performance during tests.
const capacityCreditWallet =
ethers.Wallet.createRandom().connect(provider);

// get wallet balance
const balance = await wallet.getBalance();
console.log('this.rpc:', this.rpc);
console.log('this.wallet.address', wallet.address);
console.log('Balance:', balance.toString());

const transferTx = await wallet.sendTransaction({
to: capacityCreditWallet.address,
value: ethers.utils.parseEther('0.001'),
});
await transferTx.wait();
}

// await _switchWallet();

this.contractsClient = new LitContracts({
signer: capacityCreditWallet,
// signer: capacityCreditWallet, // disabled switch wallet for now
signer: wallet,
debug: this.processEnvs.DEBUG,
network: this.network,
});
Expand All @@ -467,23 +472,40 @@ export class TinnyEnvironment {
* Mint a Capacity Credits NFT and get a capacity delegation authSig with it
* ====================================
*/
console.log(
'[𐬺🧪 Tinny Environment𐬺] Mint a Capacity Credits NFT and get a capacity delegation authSig with it'
);
const capacityTokenId = (
await this.contractsClient.mintCapacityCreditsNFT({
requestsPerKilosecond: this.processEnvs.REQUEST_PER_KILOSECOND,
daysUntilUTCMidnightExpiration: 2,
})
).capacityTokenIdStr;

this.superCapacityDelegationAuthSig = (
await this.litNodeClient.createCapacityDelegationAuthSig({
dAppOwnerWallet: wallet,
capacityTokenId: capacityTokenId,
// Sets a maximum limit of 200 times that the delegation can be used and prevents usage beyond it
uses: '200',
})
).capacityDelegationAuthSig;

// Disabled for now
async function _mintSuperCapacityDelegationAuthSig() {
console.log(
'[𐬺🧪 Tinny Environment𐬺] Mint a Capacity Credits NFT and get a capacity delegation authSig with it'
);
try {
const capacityTokenId = (
await this.contractsClient.mintCapacityCreditsNFT({
requestsPerKilosecond: this.processEnvs.REQUEST_PER_KILOSECOND,
daysUntilUTCMidnightExpiration: 2,
})
).capacityTokenIdStr;

this.superCapacityDelegationAuthSig = (
await this.litNodeClient.createCapacityDelegationAuthSig({
dAppOwnerWallet: wallet,
capacityTokenId: capacityTokenId,
// Sets a maximum limit of 200 times that the delegation can be used and prevents usage beyond it
uses: '200',
})
).capacityDelegationAuthSig;
} catch (e: any) {
if (
e.message.includes(`Can't allocate capacity beyond the global max`)
) {
console.log('❗️Skipping capacity delegation auth sig setup.', e);
} else {
console.log(
'❗️Error while setting up capacity delegation auth sig',
e
);
}
}
}
};
}