near-daos / sputnik-dao-contract

Smart contracts for https://app.astrodao.com
https://astrodao.com/
MIT License
108 stars 77 forks source link

Fix compilation error that occurs with the latest version of near-sdk #51

Closed ctindogaru closed 2 years ago

ctindogaru commented 2 years ago

This error occurs when running cargo test with the master branch from near-sdk.

Error displayed is:

error[E0277]: can't compare `AccountId` with `std::string::String`
   --> sputnikdao-factory2/src/lib.rs:149:9
    |
149 | /         assert_eq!(
150 | |             factory.get_daos(0, 100),
151 | |             vec![format!("test.{}", accounts(0))]
152 | |         );
    | |__________^ no implementation for `AccountId == std::string::String`
mikedotexe commented 2 years ago

EDIT: I pulled the latest from my fork, one moment…

I'm not sure I follow. I pulled the main branch from this repo, went into sputnikdao2 and sputnikdao-factory2 and was able to run ./build.sh and cargo test -- --nocapture successfully without seeing an error. I'm also not sure what you mean relating to near-sdk here? Did you modify a manifest file (Cargo.toml) to see this change? I don't see changes to that file in this PR.

ctindogaru commented 2 years ago

You need the latest near-sdk to see the error. Just change all occurrences of "4.0.0-pre.4" to { git = "https://github.com/near/near-sdk-rs" } in all the Cargo.toml files, then run cargo test and you'll see the error.