refactor: verify state cache before checking interactions cache #30

This commit is contained in:
ppedziwiatr
2021-10-05 22:38:00 +02:00
committed by Piotr Pędziwiatr
parent dc0191edd0
commit ee564aaa13
16 changed files with 166 additions and 23123 deletions

View File

@@ -21,13 +21,12 @@ async function main() {
const smartweave = SmartWeaveWebFactory.memCached(arweave);
const contract = smartweave.contract(contractTxId)
.setEvaluationOptions({
ignoreExceptions: false,
stackTrace: {
saveState: false
}
});
const contract = smartweave.contract(contractTxId).setEvaluationOptions({
ignoreExceptions: false,
stackTrace: {
saveState: false
}
});
const { state, validity } = await contract.readState();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -35,6 +35,10 @@ async function main() {
//fs.writeFileSync(path.join(__dirname, 'data', 'validity_old.json'), JSON.stringify(result.validity));
fs.writeFileSync(path.join(__dirname, 'data', 'state.json'), JSON.stringify(state));
console.log('second read');
await lootContract.readState();
}
main().catch((e) => console.error(e));

View File

@@ -12,7 +12,7 @@ async function main() {
LoggerFactory.INST.logLevel('debug');
const arweave = Arweave.init({
host: 'arweave.net', // Hostname or IP address for a Arweave host
host: 'arweave.live', // Hostname or IP address for a Arweave host
port: 443, // Port
protocol: 'https', // Network protocol http or https
timeout: 60000, // Network request timeouts in milliseconds
@@ -21,11 +21,11 @@ async function main() {
const transactionsLoader = new ContractInteractionsLoader(arweave);
const result = await transactionsLoader.load('LkfzZvdl_vfjRXZOPjnov18cGnnK3aDKj0qSQCgkCX8', 0, 779820);
const result = await transactionsLoader.load('Daj-MNSnH55TDfxqC7v4eq0lKzVIwh98srUaWqyuZtY', 0, 779820);
console.log(result.length);
//fs.writeFileSync(path.join(__dirname, 'data', 'transactions-2.json'), JSON.stringify(result));
fs.writeFileSync(path.join(__dirname, 'data', 'transactions-live.json'), JSON.stringify(result));
}
main().catch((e) => console.error(e));