makerdao / spells-mainnet

Staging repo for MakerDAO weekly executive spells
GNU Affero General Public License v3.0
107 stars 43 forks source link

Fix `cast-on-tenderly` script #408

Closed SidestreamColdMelon closed 2 months ago

SidestreamColdMelon commented 2 months ago

Closes https://github.com/makerdao/spells-mainnet/issues/407

This PR fixes the problem with the cast-on-tenderly script reported in https://github.com/makerdao/spells-mainnet/issues/407.

Problem description

After creating Tenderly testnets, the endpoint returns an array of RPC endpoints within container.connectivityConfig.endpoints with two currently items: one which accepts cheat codes and one that doesn't. In order to get desired one, we initially used their internal endpoints[].displayName properly (as far as I remember, there were no dedicated properly to specify which one is which), but now they introduced endpoints[].private boolean which is also mentioned in the API docs

Solution

Use documented container.connectivityConfig.endpoints[].private property to determine correct RPC network.