Code Monkey home page Code Monkey logo

aave-v3-wmatic-interest-rate-upgrade's People

Watchers

 avatar  avatar

aave-v3-wmatic-interest-rate-upgrade's Issues

Easier way of testing the bridge

vm.selectFork(mainnetFork);
vm.startPrank(GovHelpers.AAVE_WHALE);
uint256 proposalId = DeployL1PolygonProposal._deployL1Proposal(
address(payload),
0xec9d2289ab7db9bfbf2b0f2dd41ccdc0a4003e9e0d09e40dee09095145c63fb5 // TODO: replace with actual ipfs-hash
);
vm.stopPrank();
// 3. execute proposal and record logs so we can extract the emitted StateSynced event
vm.recordLogs();
GovHelpers.passVoteAndExecute(vm, proposalId);
Vm.Log[] memory entries = vm.getRecordedLogs();
assertEq(
keccak256('StateSynced(uint256,address,bytes)'),
entries[2].topics[0]
);
assertEq(address(uint160(uint256(entries[2].topics[2]))), FX_CHILD_ADDRESS);
// 4. mock the receive on l2 with the data emitted on StateSynced
vm.selectFork(polygonFork);
vm.startPrank(BRIDGE_ADMIN);
IStateReceiver(FX_CHILD_ADDRESS).onStateReceive(
uint256(entries[2].topics[1]),
this._cutBytes(entries[2].data)
);
vm.stopPrank();
// 5. Forward time & execute proposal
BridgeExecutorHelpers.waitAndExecuteLatest(vm, POLYGON_BRIDGE_EXECUTOR);

I learned this today but here's an easier way to test the flow of executing the bridge and simplifying the tests to just the part of the interest rate update:

https://github.com/bgd-labs/aave-v3-crosschain-listing-template/blob/4251a70a33bb50f2660690cf917c577df9a49e7b/src/test/polygon/AaveV3PolJEURAGEURFreeze.t.sol

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.