Commit 66a1932e authored by Kelvin Fichter's avatar Kelvin Fichter

Started porting tests for trie libraries

parent 69264d3a
......@@ -58,44 +58,6 @@ library TestLib_EthMerkleTrie {
function proveAccountState(
address _address,
Lib_OVMCodec.EVMAccount memory _accountState,
Lib_OVMCodec.ProofMatrix memory _proofMatrix,
bytes memory _stateTrieWitness,
bytes32 _stateTrieRoot
)
public
view
returns (bool)
{
return Lib_EthMerkleTrie.proveAccountState(
_address,
_accountState,
_proofMatrix,
_stateTrieWitness,
_stateTrieRoot
);
}
function proveAccountState(
address _address,
Lib_OVMCodec.EVMAccount memory _accountState,
bytes memory _stateTrieWitness,
bytes32 _stateTrieRoot
)
public
view
returns (bool)
{
return Lib_EthMerkleTrie.proveAccountState(
_address,
_accountState,
_stateTrieWitness,
_stateTrieRoot
);
}
function proveAccountState(
address _address,
Lib_OVMCodec.Account memory _accountState,
bytes memory _stateTrieWitness,
bytes32 _stateTrieRoot
)
......@@ -186,44 +148,6 @@ library TestLib_EthMerkleTrie {
function updateAccountState(
address _address,
Lib_OVMCodec.EVMAccount memory _accountState,
Lib_OVMCodec.ProofMatrix memory _proofMatrix,
bytes memory _stateTrieWitness,
bytes32 _stateTrieRoot
)
public
view
returns (bytes32)
{
return Lib_EthMerkleTrie.updateAccountState(
_address,
_accountState,
_proofMatrix,
_stateTrieWitness,
_stateTrieRoot
);
}
function updateAccountState(
address _address,
Lib_OVMCodec.EVMAccount memory _accountState,
bytes memory _stateTrieWitness,
bytes32 _stateTrieRoot
)
public
view
returns (bytes32)
{
return Lib_EthMerkleTrie.updateAccountState(
_address,
_accountState,
_stateTrieWitness,
_stateTrieRoot
);
}
function updateAccountState(
address _address,
Lib_OVMCodec.Account memory _accountState,
bytes memory _stateTrieWitness,
bytes32 _stateTrieRoot
)
......
......@@ -9,7 +9,7 @@
"build:contracts": "buidler compile",
"build:copy": "copyfiles -u 2 \"contracts/optimistic-ethereum/**/*.sol\" \"build/contracts\"",
"test": "yarn run test:contracts",
"test:contracts": "buidler test \"test/contracts/libraries/utils/Lib_EthUtils.spec.ts\" --show-stack-traces",
"test:contracts": "buidler test \"test/contracts/libraries/trie/Lib_MerkleTrie.spec.ts\" --show-stack-traces",
"lint": "tslint --format stylish --project .",
"fix": "prettier --config prettier-config.json --write \"buidler.config.ts\" \"{src,test}/**/*.ts\"",
"clean": "rm -rf ./artifacts ./build ./cache"
......
/* Internal Imports */
import { Lib_EthMerkleTrie_TEST_JSON } from '../../../data'
import { runJsonTest } from '../../../helpers'
describe('Lib_EthMerkleTrie', () => {
describe('JSON tests', () => {
runJsonTest('TestLib_EthMerkleTrie', Lib_EthMerkleTrie_TEST_JSON)
})
})
/* Internal Imports */
import { Lib_MerkleTrie_TEST_JSON } from '../../../data'
import { runJsonTest } from '../../../helpers'
describe('Lib_MerkleTrie', () => {
describe('JSON tests', () => {
runJsonTest('TestLib_MerkleTrie', Lib_MerkleTrie_TEST_JSON)
})
})
/* Internal Imports */
import { Lib_SecureMerkleTrie_TEST_JSON } from '../../../data'
import { runJsonTest } from '../../../helpers'
describe('Lib_SecureMerkleTrie', () => {
describe('JSON tests', () => {
runJsonTest('TestLib_SecureMerkleTrie', Lib_SecureMerkleTrie_TEST_JSON)
})
})
export { tests as Lib_RLPWriter_TEST_JSON } from './json/libraries/Lib_RLPWriter.test.json'
export { tests as Lib_Bytes32Utils_TEST_JSON } from './json/libraries/Lib_Bytes32Utils.test.json'
export { tests as Lib_BytesUtils_TEST_JSON } from './json/libraries/Lib_BytesUtils.test.json'
export { tests as Lib_ECDSAUtils_TEST_JSON } from './json/libraries/Lib_ECDSAUtils.test.json'
export { tests as Lib_MerkleUtils_TEST_JSON } from './json/libraries/Lib_MerkleUtils.test.json'
export { tests as Lib_RLPWriter_TEST_JSON } from './json/libraries/rlp/Lib_RLPWriter.test.json'
export { tests as Lib_Bytes32Utils_TEST_JSON } from './json/libraries/utils/Lib_Bytes32Utils.test.json'
export { tests as Lib_BytesUtils_TEST_JSON } from './json/libraries/utils/Lib_BytesUtils.test.json'
export { tests as Lib_ECDSAUtils_TEST_JSON } from './json/libraries/utils/Lib_ECDSAUtils.test.json'
export { tests as Lib_MerkleTrie_TEST_JSON } from './json/libraries/trie/Lib_MerkleTrie.test.json'
export { tests as Lib_SecureMerkleTrie_TEST_JSON } from './json/libraries/trie/Lib_SecureMerkleTrie.test.json'
export { tests as Lib_EthMerkleTrie_TEST_JSON } from './json/libraries/trie/Lib_EthMerkleTrie.test.json'
export { tests as CREATE2_TEST_JSON } from './json/create2.test.json'
export { tests as SAFETY_CHECKER_TEST_JSON } from './json/safety-checker.test.json'
{
"tests": {
"proveAccountStorageSlotValue": {
"single account, single storage slot": {
},
"single account, multiple storage slots": {
},
"multiple accounts, multiple storage slots": {
}
},
"updateAccountStorageSlotValue": {
"single account, single storage slot": {
},
"single account, multiple storage slots": {
},
"multiple accounts, multiple storage slots": {
}
},
"proveAccountState": {
"account within trie with a single account": {
},
"account within trie with multiple accounts": {
}
},
"updateAccountState": {
"account within trie with a single account": {
},
"account within trie with multiple accounts": {
}
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment