Skip to content

Commit

Permalink
use global salt. all accounts use fresh addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
drortirosh committed Apr 8, 2024
1 parent eb8bf79 commit bb17878
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions gascalc/7-zerodev-kernel-lite.gas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,16 @@ context.only('simple account', function () {
'function executeBatch((address,uint256,bytes)[])',
'function initialize(address,bytes)'
])

let globalSalt = 10000
const factoryInfo = async (owner: string, salt: string): Promise<any> => {
const initData = kernelFunctions.encodeFunctionData(
'initialize', [ECDSAValidator, owner])

console.log('create factoryinfo for ', owner, 'salt=', salt)
console.log('create factoryinfo for ', owner, 'salt=', ++globalSalt)
const ret = {
factory: kernelLiteFactory,
// salt "0" was already created..
factoryData: kernelFunctions.encodeFunctionData('createAccount', [kernelLiteECDSA, initData, salt])
factoryData: kernelFunctions.encodeFunctionData('createAccount', [kernelLiteECDSA, initData, globalSalt.toString()])
}
console.log('factoryInfo= ', ret)
return ret
Expand Down Expand Up @@ -71,12 +72,14 @@ context.only('simple account', function () {
appendZerodevMode: true,
diffLastGas: false
})
// await g.addTestRow({
// title: 'zd-kernel-lite - diff from previous',
// count: 2,
// skipAccountCreation: true,
// appendZerodevMode: true,
// diffLastGas: true
// })
await g.addTestRow({
title: 'zd-kernel-lite - diff from previous',
count: 2,
factoryInfo,
execInfo,
skipAccountCreation: true,
appendZerodevMode: true,
diffLastGas: true
})
})
})

0 comments on commit bb17878

Please sign in to comment.