Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove floats from wasm V2 (without removing flatten) #188

Closed
wants to merge 2 commits into from

Conversation

Buckram123
Copy link
Collaborator

@Buckram123 Buckram123 commented Dec 13, 2023

Implements deserialize without float logic
Keeps flatten opposed to #187

Both tested by this test:

mod old_mock {
use super::*;
use crate::common::mock_modules;
use abstract_adapter::gen_adapter_old_mock;
use mock_modules::adapter_1::MOCK_ADAPTER_ID;
gen_adapter_old_mock!(OldMockAdapter1V1, MOCK_ADAPTER_ID, "1.0.0", &[]);
#[test]
fn old_adapters_migratable() -> AResult {
let sender = Addr::unchecked(OWNER);
let chain = Mock::new(&sender);
let deployment = Abstract::deploy_on(chain.clone(), sender.to_string())?;
let account = create_default_account(&deployment.account_factory)?;
deployment
.version_control
.claim_namespace(TEST_ACCOUNT_ID, "tester".to_owned())?;
let old = OldMockAdapter1V1::new_test(chain.clone());
old.deploy(V1.parse().unwrap(), MockInitMsg {}, DeployStrategy::Try)?;
account.install_adapter(&old, None)?;
let new = BootMockAdapter1V2::new_test(chain.clone());
new.deploy(V2.parse().unwrap(), MockInitMsg {}, DeployStrategy::Try)?;
account.manager.upgrade_module(MOCK_ADAPTER_ID, &Empty {})?;
Ok(())
}
}

Checklist

  • CI is green.
  • Changelog updated.

Copy link

cloudflare-workers-and-pages bot commented Dec 13, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 29ebcfe
Status: ✅  Deploy successful!
Preview URL: https://1efa2858.abstract-docs.pages.dev
Branch Preview URL: https://buckram-remove-floats-v2.abstract-docs.pages.dev

View logs

@codecov-commenter
Copy link

Codecov Report

Merging #188 (6af83e5) into main (4920eea) will decrease coverage by 0.2%.
Report is 22 commits behind head on main.
The diff coverage is 81.3%.

Additional details and impacted files
Files Coverage Δ
...ramework/contracts/account/manager/src/commands.rs 94.5% <100.0%> (-0.1%) ⬇️
...k/contracts/native/version-control/src/commands.rs 96.6% <100.0%> (+<0.1%) ⬆️
...work/contracts/native/version-control/src/error.rs 25.0% <ø> (ø)
...amework/packages/abstract-adapter/src/endpoints.rs 100.0% <100.0%> (ø)
...packages/abstract-adapter/src/endpoints/execute.rs 97.1% <100.0%> (+3.9%) ⬆️
...ages/abstract-adapter/src/endpoints/instantiate.rs 100.0% <100.0%> (ø)
...packages/abstract-adapter/src/endpoints/receive.rs 100.0% <100.0%> (ø)
...rk/packages/abstract-adapter/src/endpoints/sudo.rs 100.0% <100.0%> (ø)
...ramework/packages/abstract-adapter/src/features.rs 100.0% <100.0%> (ø)
framework/packages/abstract-adapter/src/lib.rs 95.8% <100.0%> (-0.1%) ⬇️
... and 14 more

... and 1 file with indirect coverage changes

@CyberHoward
Copy link
Contributor

CyberHoward commented Dec 14, 2023

So with this custom deser implementation we can remove the flatten attribute? Because that's what was inserting the floating point operation right?

#[serde(flatten)]

@Buckram123
Copy link
Collaborator Author

So with this custom deser implementation we can remove the flatten attribute? Because that's what was inserting the floating point operation right?

#[serde(flatten)]

We still need to Serialize flatten, so manager passes correct message to the Adapter

@Buckram123
Copy link
Collaborator Author

For some reason it fails to optimize out f64 visitors from FlatMapSerializer, which obviously should get optimized, so closed in favor of #187

@Buckram123 Buckram123 closed this Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants