Adapter calculate and retrieve total spendable amount#385
Adapter calculate and retrieve total spendable amount#385elpiel merged 69 commits intoaip-61-adex-v5from
Conversation
elpiel
left a comment
There was a problem hiding this comment.
Looks like you have great progress on the task already 🎉
Can you also make sure to include a list of the Changelog in PR so we can later add it to the CHANGELOG.md file.
|
After some discussion with Ivo, we came to the following changes: This could change in the future, as we will introduce the |
elpiel
left a comment
There was a problem hiding this comment.
Can you also make sure to fix the gitmodule
- adapter - ABI & bytecode files clean up
6c3f3ae to
f2b2fa2
Compare
TODO:
|
| ethereum_core_address = '0x333420fc6a897356e69b62417cd17ff012177d2b' | ||
| # TODO: Replace with real contract address | ||
| outpace_address = '0x333420fc6a897356e69b62417cd17ff012177d2b' | ||
| # TODO: Replace with real contract address |
There was a problem hiding this comment.
to make tests reproducible we can create a ganache snapshot of the required deployments and use it on startup
There was a problem hiding this comment.
This is a cool idea for enhancement!
How can we do that?
TODO: uncomment sweeper test case once we figure out what's wrong with the contract call
sweeper test case
Implemented
adapter.get_deposit(...)for the Ethereum and Dummy adapters, including an integration test.Change Log:
adapter::EthereumAdapter- Added aget_deposit()function which calculates and returns total spendable amount, using theOUTPACEandERC20ABI's.adapter::ethereum::Error- Added two new possible errors. The first beingTokenNotWhitelistedwhich is returned when the function is called with a channel with a deposit asset not being in the config's whitelist. The second isInvalidDepositAssetwhich is used when a channel's deposit asset cannot be converted toAddress. This error is here temporarily and I assume it will be gone soon when thechannel_v5replaces the oldchannelin the adapter.dev.toml and prod.toml configs- Changed the structure oftoken_addr_whitelistfrom an array of strings, to an array with objects that containaddress,min_token_units_for_depositandprecision.primitives::adapter::Deposit- new struct representing theget_deposit()output. Added signature forget_depositin theimplprimitives::channel_validator::asset_listed()- Changedasset_listed()function to work with the new token whitelist structure from String Vec to HashMap.primitives::config- Changed token whitelist from String Vec to HashMap. Added a new struct calledTokenInfowhich represents the value for the token whitelist HashMap.