TransparentUpgradeableProxy.test.js 774 B

1234567891011121314151617
  1. const { accounts, contract } = require('@openzeppelin/test-environment');
  2. const shouldBehaveLikeUpgradeableProxy = require('./UpgradeableProxy.behaviour');
  3. const shouldBehaveLikeTransparentUpgradeableProxy = require('./TransparentUpgradeableProxy.behaviour');
  4. const TransparentUpgradeableProxy = contract.fromArtifact('TransparentUpgradeableProxy');
  5. describe('TransparentUpgradeableProxy', function () {
  6. const [proxyAdminAddress, proxyAdminOwner] = accounts;
  7. const createProxy = async function (logic, admin, initData, opts) {
  8. return TransparentUpgradeableProxy.new(logic, admin, initData, opts);
  9. };
  10. shouldBehaveLikeUpgradeableProxy(createProxy, proxyAdminAddress, proxyAdminOwner);
  11. shouldBehaveLikeTransparentUpgradeableProxy(createProxy, accounts);
  12. });