Remove now unused legacy governance state and variables
This commit is contained in:
parent
25af2a90a8
commit
d3a173a3c6
|
@ -19,7 +19,5 @@ BRIDGE_INIT_WETH= # 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
|
|||
|
||||
# Pyth Migrations # Example Format
|
||||
PYTH_INIT_CHAIN_ID= # 0x2
|
||||
PYTH_INIT_GOV_CHAIN_ID= # 0x3
|
||||
PYTH_INIT_GOV_CONTRACT= # 0x0000000000000000000000000000000000000000000000000000000000000004
|
||||
PYTH_TO_WORMHOLE_CHAIN_ID= # 0x1
|
||||
PYTH_TO_WORMHOLE_EMITTER= # 8fuAZUxHecYLMC76ZNjYzwRybUiDv9LhkRQsAccEykLr
|
||||
|
|
|
@ -12,7 +12,5 @@ BRIDGE_INIT_WETH=0xDDb64fE46a91D46ee29420539FC25FD07c5FEa3E
|
|||
|
||||
#Pyth Migrations
|
||||
PYTH_INIT_CHAIN_ID=0x2
|
||||
PYTH_INIT_GOV_CHAIN_ID=0x3
|
||||
PYTH_INIT_GOV_CONTRACT=0x0000000000000000000000000000000000000000000000000000000000000004
|
||||
PYTH_TO_WORMHOLE_CHAIN_ID=0x1
|
||||
PYTH_TO_WORMHOLE_EMITTER=8fuAZUxHecYLMC76ZNjYzwRybUiDv9LhkRQsAccEykLr
|
||||
PYTH_TO_WORMHOLE_EMITTER=8fuAZUxHecYLMC76ZNjYzwRybUiDv9LhkRQsAccEykLr
|
||||
|
|
|
@ -8,10 +8,6 @@ import "../interfaces/IWormhole.sol";
|
|||
import "./PythState.sol";
|
||||
|
||||
contract PythGetters is PythState {
|
||||
function governanceActionIsConsumed(bytes32 hash) public view returns (bool) {
|
||||
return _state.consumedGovernanceActions[hash];
|
||||
}
|
||||
|
||||
function isInitialized(address impl) public view returns (bool) {
|
||||
return _state.initializedImplementations[impl];
|
||||
}
|
||||
|
@ -24,14 +20,6 @@ contract PythGetters is PythState {
|
|||
return _state.provider.chainId;
|
||||
}
|
||||
|
||||
function governanceChainId() public view returns (uint16){
|
||||
return _state.provider.governanceChainId;
|
||||
}
|
||||
|
||||
function governanceContract() public view returns (bytes32){
|
||||
return _state.provider.governanceContract;
|
||||
}
|
||||
|
||||
function pyth2WormholeChainId() public view returns (uint16){
|
||||
return _state.provider.pyth2WormholeChainId;
|
||||
}
|
||||
|
|
|
@ -10,22 +10,10 @@ contract PythSetters is PythState {
|
|||
_state.initializedImplementations[implementatiom] = true;
|
||||
}
|
||||
|
||||
function setGovernanceActionConsumed(bytes32 hash) internal {
|
||||
_state.consumedGovernanceActions[hash] = true;
|
||||
}
|
||||
|
||||
function setChainId(uint16 chainId) internal {
|
||||
_state.provider.chainId = chainId;
|
||||
}
|
||||
|
||||
function setGovernanceChainId(uint16 chainId) internal {
|
||||
_state.provider.governanceChainId = chainId;
|
||||
}
|
||||
|
||||
function setGovernanceContract(bytes32 governanceContract) internal {
|
||||
_state.provider.governanceContract = governanceContract;
|
||||
}
|
||||
|
||||
function setPyth2WormholeChainId(uint16 chainId) internal {
|
||||
_state.provider.pyth2WormholeChainId = chainId;
|
||||
}
|
||||
|
|
|
@ -15,9 +15,6 @@ contract PythSetup is PythSetters, ERC1967Upgrade {
|
|||
uint16 chainId,
|
||||
address wormhole,
|
||||
|
||||
uint16 governanceChainId,
|
||||
bytes32 governanceContract,
|
||||
|
||||
uint16 pyth2WormholeChainId,
|
||||
bytes32 pyth2WormholeEmitter
|
||||
) public {
|
||||
|
@ -25,9 +22,6 @@ contract PythSetup is PythSetters, ERC1967Upgrade {
|
|||
|
||||
setWormhole(wormhole);
|
||||
|
||||
setGovernanceChainId(governanceChainId);
|
||||
setGovernanceContract(governanceContract);
|
||||
|
||||
setPyth2WormholeChainId(pyth2WormholeChainId);
|
||||
setPyth2WormholeEmitter(pyth2WormholeEmitter);
|
||||
|
||||
|
|
|
@ -9,9 +9,6 @@ contract PythStorage {
|
|||
struct Provider {
|
||||
uint16 chainId;
|
||||
|
||||
uint16 governanceChainId;
|
||||
bytes32 governanceContract;
|
||||
|
||||
uint16 pyth2WormholeChainId;
|
||||
bytes32 pyth2WormholeEmitter;
|
||||
}
|
||||
|
@ -21,9 +18,6 @@ contract PythStorage {
|
|||
|
||||
Provider provider;
|
||||
|
||||
// Mapping of consumed governance actions
|
||||
mapping(bytes32 => bool) consumedGovernanceActions;
|
||||
|
||||
// Mapping of initialized implementations
|
||||
mapping(address => bool) initializedImplementations;
|
||||
|
||||
|
|
|
@ -7,8 +7,6 @@ const PythSetup = artifacts.require("PythSetup");
|
|||
const Wormhole = artifacts.require("Wormhole");
|
||||
|
||||
const chainId = process.env.PYTH_INIT_CHAIN_ID;
|
||||
const governanceChainId = process.env.PYTH_INIT_GOV_CHAIN_ID;
|
||||
const governanceContract = process.env.PYTH_INIT_GOV_CONTRACT; // bytes32
|
||||
const pyth2WormholeChainId = process.env.PYTH_TO_WORMHOLE_CHAIN_ID;
|
||||
const pyth2WormholeEmitter = bs58.decode(process.env.PYTH_TO_WORMHOLE_EMITTER); // base58, must fit into bytes32
|
||||
|
||||
|
@ -28,9 +26,6 @@ module.exports = async function (deployer) {
|
|||
chainId,
|
||||
(await Wormhole.deployed()).address,
|
||||
|
||||
governanceChainId,
|
||||
governanceContract,
|
||||
|
||||
pyth2WormholeChainId,
|
||||
"0x" + pyth2WormholeEmitter.toString("hex"),
|
||||
).encodeABI();
|
||||
|
|
|
@ -31,12 +31,6 @@ contract("Pyth", function () {
|
|||
const chainId = await initialized.methods.chainId().call();
|
||||
assert.equal(chainId, testChainId);
|
||||
|
||||
// governance
|
||||
const governanceChainId = await initialized.methods.governanceChainId().call();
|
||||
assert.equal(governanceChainId, testGovernanceChainId);
|
||||
const governanceContract = await initialized.methods.governanceContract().call();
|
||||
assert.equal(governanceContract, testGovernanceContract);
|
||||
|
||||
// pyth2wormhole
|
||||
const pyth2wormChain = await initialized.methods.pyth2WormholeChainId().call();
|
||||
assert.equal(pyth2wormChain, testPyth2WormholeChainId);
|
||||
|
|
Loading…
Reference in New Issue