Understanding BeaconProxy.test.js

I have difficulty understanding the following unit test in BeaconProxy.test.js. Two problems:

  1. It creates DummyImplementation and DummyImplementation2 instances passing a reference to the proxy. That makes no sense because the implementation should not know about any proxies that call it. Also those implementations don’t have constructors, so hmm.

  2. The at the bottom of the test, after upgrading the beacon, the implementations are checked for new version values. Instead it should be testing the BeaconProxy returns the changed values.

Can anyone explain this test?

Hi @cliffhall,

Welcome to the community :wave:

The test creates an UpgradeableBeacon passing in the address of implementationV0.

It then creates a BeaconProxy passing in the address of the beacon which was just created.

It is checking that after upgrading the implementation the proxies are pointing to version 2.