Update TBTCSystem Stub
Implemebt System functions to call token contract
Remove clearBalance function to move towards using the real System contract in testing
pragma solidity ^0.5.10;
import {TBTCSystem} from '../../../contracts/system/TBTCSystem.sol';
+import {TBTCToken} from "../../../contracts/system/TBTCToken.sol";
contract TBTCSystemStub is TBTCSystem {
+ address _TBTCToken;
+
+ function setExternalAddresses(address _tokenAddress) public {
+ _TBTCToken = _tokenAddress;
+ }
+
function setOraclePrice(uint256 _oraclePrice) external {
oraclePrice = _oraclePrice;
}
@@ -20,4 +27,17 @@ contract TBTCSystemStub is TBTCSystem {
function approvedToLog(address _caller) public view returns (bool) {
_caller; return true;
}
+
+ //Token functions
+ function systemMint(address _account, uint256 _amount) public returns (bool){
+ return TBTCToken(_TBTCToken).mint(_account, _amount);
+ }
+
+ function systemBurnFrom(address _account, uint256 _amount) public {
+ TBTCToken(_TBTCToken).burnFrom(_account, _amount);
+ }
+
+ function systemTransferFrom(address _from, address _to, uint256 _value) public returns (bool) {
+ return TBTCToken(_TBTCToken).transferFrom(_from, _to, _value);
+ }
}
