Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
121bae7a
Commit
121bae7a
authored
Dec 14, 2020
by
ben-chain
Committed by
GitHub
Dec 14, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update mockOVM_BondManager to be sequencer-only (#146)
* update function, add test * linting * more lint
parent
ab4dad2b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
2 deletions
+59
-2
mockOVM_BondManager.sol
...tic-ethereum/mockOVM/verification/mockOVM_BondManager.sol
+12
-2
config.ts
packages/contracts/src/contract-deployment/config.ts
+1
-0
mockOVM_BondManager.spec.ts
...ontracts/mockOVM/verification/mockOVM_BondManager.spec.ts
+46
-0
No files found.
packages/contracts/contracts/optimistic-ethereum/mockOVM/verification/mockOVM_BondManager.sol
View file @
121bae7a
...
...
@@ -4,10 +4,19 @@ pragma solidity ^0.7.0;
/* Interface Imports */
import { iOVM_BondManager } from "../../iOVM/verification/iOVM_BondManager.sol";
/* Contract Imports */
import { Lib_AddressResolver } from "../../libraries/resolver/Lib_AddressResolver.sol";
/**
* @title mockOVM_BondManager
*/
contract mockOVM_BondManager is iOVM_BondManager {
contract mockOVM_BondManager is iOVM_BondManager, Lib_AddressResolver {
constructor(
address _libAddressManager
)
Lib_AddressResolver(_libAddressManager)
{}
function recordGasSpent(
bytes32 _preStateRoot,
bytes32 _txHash,
...
...
@@ -59,7 +68,8 @@ contract mockOVM_BondManager is iOVM_BondManager {
bool
)
{
return true;
// Only authenticate sequencer to submit state root batches.
return _who == resolve("OVM_Sequencer");
}
function getGasSpent(
...
...
packages/contracts/src/contract-deployment/config.ts
View file @
121bae7a
...
...
@@ -164,6 +164,7 @@ export const makeContractDeployConfig = async (
},
OVM_BondManager
:
{
factory
:
getContractFactory
(
'
mockOVM_BondManager
'
),
params
:
[
AddressManager
.
address
],
},
OVM_ETH
:
{
factory
:
getContractFactory
(
'
OVM_ETH
'
),
...
...
packages/contracts/test/contracts/mockOVM/verification/mockOVM_BondManager.spec.ts
0 → 100644
View file @
121bae7a
import
{
expect
}
from
'
../../../setup
'
/* External Imports */
import
{
ethers
}
from
'
@nomiclabs/buidler
'
import
{
Signer
,
Contract
}
from
'
ethers
'
/* Internal Imports */
import
{
makeAddressManager
}
from
'
../../../helpers
'
describe
(
'
mockOVM_BondManager
'
,
()
=>
{
let
sequencer
:
Signer
let
nonSequencer
:
Signer
before
(
async
()
=>
{
;[
sequencer
,
nonSequencer
]
=
await
ethers
.
getSigners
()
})
let
AddressManager
:
Contract
before
(
async
()
=>
{
AddressManager
=
await
makeAddressManager
()
})
let
mockOVM_BondManager
:
Contract
before
(
async
()
=>
{
mockOVM_BondManager
=
await
(
await
ethers
.
getContractFactory
(
'
mockOVM_BondManager
'
)
).
deploy
(
AddressManager
.
address
)
AddressManager
.
setAddress
(
'
OVM_Sequencer
'
,
await
sequencer
.
getAddress
())
})
describe
(
'
isCollateralized
'
,
()
=>
{
it
(
'
should return true for OVM_Sequencer
'
,
async
()
=>
{
expect
(
await
mockOVM_BondManager
.
isCollateralized
(
await
sequencer
.
getAddress
())
).
to
.
equal
(
true
)
})
it
(
'
should return false for non-sequencer
'
,
async
()
=>
{
expect
(
await
mockOVM_BondManager
.
isCollateralized
(
await
nonSequencer
.
getAddress
()
)
).
to
.
equal
(
false
)
})
})
})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment