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

Mock Final State/Improve tests execution #4512

Merged
merged 14 commits into from
Nov 10, 2023
Merged

Conversation

AurelienFT
Copy link
Contributor

No description provided.

@Leo-Besancon Leo-Besancon changed the base branch from main to securnet_wip November 6, 2023 14:43
@AurelienFT AurelienFT changed the base branch from securnet_wip to main November 8, 2023 14:31
@AurelienFT AurelienFT marked this pull request as ready for review November 8, 2023 14:31
@Leo-Besancon Leo-Besancon changed the base branch from main to buildnet_wip November 8, 2023 15:07
fn final_state_boilerplate(
mock_final_state: &mut Arc<RwLock<MockFinalStateController>>,
db: ShareableMassaDBController,
selector_controller: &mut MockSelectorControllerWrapper,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need this mutable reference

.unwrap();
assert_eq!(
amount,
Amount::from_mantissa_scale(100, 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe specify that this is coming from the boilerplate, or set the default boilerplate value to 0

massa-final-state/src/final_state.rs Outdated Show resolved Hide resolved
massa-final-state/src/controller_trait.rs Show resolved Hide resolved
@AurelienFT AurelienFT merged commit 5f56515 into buildnet_wip Nov 10, 2023
4 checks passed
damip added a commit that referenced this pull request Nov 20, 2023
* Buildnet WIP

* Test dir + base case test

* Mock Final State/Improve tests execution (#4512)

* Use a controller for final state to be able to mock it

* Fix all formatting issues.

* Use more mocks in execution tests

* Fix test nested call usage

* improve some tests execution

* Fix tests async message and compact the test of executed

* Fix more execution tests

* Fix more tests.

* Update more tests

* Finish fixing all executions tests.

* Improve naming

* add more comment

* Fix comment

* Minor addition to test_standalone_selection

* Add test_invalid_roll_distribution

* Minor test_invalid_roll_distribution change

* fix clippy

* Fix double cursor advance (#4531)

Co-authored-by: sydhds <[email protected]>

* Fix massa db change history handling (#4533)

* Initial fix and test

To check: if < or <= to allow changes

* fmt + clippy

* fix comments

* Remove debug prints

* Cache miss error rename + u8::MAX

* Added comments about Included and CacheMiss

* Comment + Add StreamingStep::Ongoing to test

* Fix previous tests

* Bump self_cell from 1.0.1 to 1.0.2 (#4538)

Bumps [self_cell](https://github.com/Voultapher/self_cell) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/Voultapher/self_cell/releases)
- [Commits](Voultapher/self_cell@v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: self_cell
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add test code coverage + checksums (#4470)

* ci: add test code coverage

* ci: add checksums to artifacts

* fix: cargo clean

* fix: trigger ci

* ci: last chance

* ci: skip macOS ...

* ci: silver bullet cache

* ci: add codecov

* ci: clean coverage utility

* ci: reset to main version

* Keep only event count in ExecutionContextSnapshot

Signed-off-by: Jean-François <[email protected]>

* updates

* update packages

* make test_standalone_selection generic (#4539)

* Create universes for bootstrap (#4528)

* Use a controller for final state to be able to mock it

* Fix all formatting issues.

* Use more mocks in execution tests

* Fix test nested call usage

* improve some tests execution

* Fix tests async message and compact the test of executed

* Fix more execution tests

* Fix more tests.

* Update more tests

* Finish fixing all executions tests.

* Improve naming

* Create universes for bootstrap

* add more comment

* Add bootstrap whitelist test correctly

* Update to make a correct bootstrap flow

* Change big bootstrap test and cleanup some unused variables

* Version of bootstrap tests with mock well organized

* Update bootstrap check database

* fix all tests bootstrap

* Fix tests massa db

* Update better tests

* modify condition

* Fix readonly (#4543)

* fix readonly

* update proto dep

* Fix bootstrap deser (#4537)

* Add length_value check in deserializer

* Update the logic

TODO:
- Fix UT fails
- Remove debug logs
- Refactor the serde of KV in a separate parser

* fmt

* Fix ser

* Remove prints

* Add duplicate key test in deserializer

* Add faulty message tests

* Fix & prints

* Update to take serialized len into account for streamBatch fill

* Rename + add comments

* Use Enum for faulty case instead of int

* Fix clippy

* Adjust node APIs settings (#4536)

* refactor: adjust APIs settings

* refactor: revert bind public address

* Improve ReadOnly estimations (#4545)

* Fix read only call & execution estimations

* Update comment

* Set async pool size to 1000 and add async msg fixed costs (#4546)

Signed-off-by: Jean-François <[email protected]>

* Update genesis

---------

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Jean-François <[email protected]>
Co-authored-by: Thomas Plisson <[email protected]>
Co-authored-by: AurelienFT <[email protected]>
Co-authored-by: AurelienFT <[email protected]>
Co-authored-by: Sydhds <[email protected]>
Co-authored-by: sydhds <[email protected]>
Co-authored-by: Eitu33 <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Moncef AOUDIA <[email protected]>
Co-authored-by: Jean-François <[email protected]>
Co-authored-by: Damir Vodenicarevic <[email protected]>
Co-authored-by: Moncef AOUDIA <[email protected]>
damip pushed a commit that referenced this pull request Nov 28, 2023
* Buildnet WIP

* Mock Final State/Improve tests execution (#4512)

* Use a controller for final state to be able to mock it

* Fix all formatting issues.

* Use more mocks in execution tests

* Fix test nested call usage

* improve some tests execution

* Fix tests async message and compact the test of executed

* Fix more execution tests

* Fix more tests.

* Update more tests

* Finish fixing all executions tests.

* Improve naming

* add more comment

* Fix comment

* update test to check spend coins with readonly

* add coins

* check coins on rollbuy

* clippy

* update roll_buy

* delete helloworld wasm

* update test_readonly_execution

* fix tests merge

* fix test test_readonly_execution

* Update ci.yml

* Feature/feature/versioning ser der harden 2 (#4554)

* Add some unit tests for versioning deserialization to the limits

* Clippy pass

* Better error message

* Minor fixes

* Excluded -> Included

---------

Co-authored-by: sydhds <[email protected]>

* Add versioninig key & value checks (#4552)

* Add versioninig key & value checks

* Improve error message when no prefix

---------

Co-authored-by: sydhds <[email protected]>

* Update CI, Version and genesis timestamp

* add test for cancel_async_msg

* clippy

* cancel async msg check refound sender

---------

Co-authored-by: Leo-Besancon <[email protected]>
Co-authored-by: AurelienFT <[email protected]>
Co-authored-by: Sydhds <[email protected]>
Co-authored-by: sydhds <[email protected]>
damip added a commit that referenced this pull request Nov 30, 2023
* Update version & CI

* Test/array indexing checkup 1 (#4560)

* Update ci.yml

* Feature/feature/versioning ser der harden 2 (#4554)

* Add some unit tests for versioning deserialization to the limits

* Clippy pass

* Better error message

* Minor fixes

* Excluded -> Included

---------

Co-authored-by: sydhds <[email protected]>

* Add versioninig key & value checks (#4552)

* Add versioninig key & value checks

* Improve error message when no prefix

---------

Co-authored-by: sydhds <[email protected]>

* Update CI, Version and genesis timestamp

* Add array indexing listing tool

* Remove array indexing in denunciation code

* Remove more array indexing

* Add more exclude patterns

* Use nom take

---------

Co-authored-by: sydhds <[email protected]>

* Fails in send_operations if get_gas_usage() > max_gas_per_block

Returning a distinct error message for ExecuteSC and CallSC operations.

Signed-off-by: Jean-François <[email protected]>

* coins spending tests (#4532)

* Buildnet WIP

* Mock Final State/Improve tests execution (#4512)

* Use a controller for final state to be able to mock it

* Fix all formatting issues.

* Use more mocks in execution tests

* Fix test nested call usage

* improve some tests execution

* Fix tests async message and compact the test of executed

* Fix more execution tests

* Fix more tests.

* Update more tests

* Finish fixing all executions tests.

* Improve naming

* add more comment

* Fix comment

* update test to check spend coins with readonly

* add coins

* check coins on rollbuy

* clippy

* update roll_buy

* delete helloworld wasm

* update test_readonly_execution

* fix tests merge

* fix test test_readonly_execution

* Update ci.yml

* Feature/feature/versioning ser der harden 2 (#4554)

* Add some unit tests for versioning deserialization to the limits

* Clippy pass

* Better error message

* Minor fixes

* Excluded -> Included

---------

Co-authored-by: sydhds <[email protected]>

* Add versioninig key & value checks (#4552)

* Add versioninig key & value checks

* Improve error message when no prefix

---------

Co-authored-by: sydhds <[email protected]>

* Update CI, Version and genesis timestamp

* add test for cancel_async_msg

* clippy

* cancel async msg check refound sender

---------

Co-authored-by: Leo-Besancon <[email protected]>
Co-authored-by: AurelienFT <[email protected]>
Co-authored-by: Sydhds <[email protected]>
Co-authored-by: sydhds <[email protected]>

* improve errors (#4567)

* tech(async_msg) : check if the target address exist

* tech(call_sc) : add check target address to call_sc_op

* check target sc address on init_call

* check target address in read only call

* fix unit tests

* remove dbg macro

* Update massa-execution-worker/src/context.rs

Co-authored-by: Damir Vodenicarevic <[email protected]>

---------

Co-authored-by: Damir Vodenicarevic <[email protected]>

* Fix tests (#4568)

* Fix CI WIP (#4569)

* Fix ws_disabled() test on windows

* fix bootstrap server port

* Fix CI local Leo

* Update scenarios_mandatories.rs

* Add CI profile argument to nextest

---------

Co-authored-by: modship <[email protected]>

* Fix test + Update lcov.info

* Add codecov.yml

* fix internal error serde (#4570)

* Release prebuilt profile (#4572)

* codegen-units set to 1 for prebuilt binaries

* Update toolchain version in CI & CD

* Update CI & Genesis

---------

Signed-off-by: Jean-François <[email protected]>
Co-authored-by: Sydhds <[email protected]>
Co-authored-by: sydhds <[email protected]>
Co-authored-by: Jean-François <[email protected]>
Co-authored-by: Modship <[email protected]>
Co-authored-by: AurelienFT <[email protected]>
Co-authored-by: Damir Vodenicarevic <[email protected]>
Leo-Besancon added a commit that referenced this pull request Nov 30, 2023
* Update version & CI

* Test/array indexing checkup 1 (#4560)

* Update ci.yml

* Feature/feature/versioning ser der harden 2 (#4554)

* Add some unit tests for versioning deserialization to the limits

* Clippy pass

* Better error message

* Minor fixes

* Excluded -> Included

---------

Co-authored-by: sydhds <[email protected]>

* Add versioninig key & value checks (#4552)

* Add versioninig key & value checks

* Improve error message when no prefix

---------

Co-authored-by: sydhds <[email protected]>

* Update CI, Version and genesis timestamp

* Add array indexing listing tool

* Remove array indexing in denunciation code

* Remove more array indexing

* Add more exclude patterns

* Use nom take

---------

Co-authored-by: sydhds <[email protected]>

* Fails in send_operations if get_gas_usage() > max_gas_per_block

Returning a distinct error message for ExecuteSC and CallSC operations.

Signed-off-by: Jean-François <[email protected]>

* coins spending tests (#4532)

* Buildnet WIP

* Mock Final State/Improve tests execution (#4512)

* Use a controller for final state to be able to mock it

* Fix all formatting issues.

* Use more mocks in execution tests

* Fix test nested call usage

* improve some tests execution

* Fix tests async message and compact the test of executed

* Fix more execution tests

* Fix more tests.

* Update more tests

* Finish fixing all executions tests.

* Improve naming

* add more comment

* Fix comment

* update test to check spend coins with readonly

* add coins

* check coins on rollbuy

* clippy

* update roll_buy

* delete helloworld wasm

* update test_readonly_execution

* fix tests merge

* fix test test_readonly_execution

* Update ci.yml

* Feature/feature/versioning ser der harden 2 (#4554)

* Add some unit tests for versioning deserialization to the limits

* Clippy pass

* Better error message

* Minor fixes

* Excluded -> Included

---------

Co-authored-by: sydhds <[email protected]>

* Add versioninig key & value checks (#4552)

* Add versioninig key & value checks

* Improve error message when no prefix

---------

Co-authored-by: sydhds <[email protected]>

* Update CI, Version and genesis timestamp

* add test for cancel_async_msg

* clippy

* cancel async msg check refound sender

---------

Co-authored-by: Leo-Besancon <[email protected]>
Co-authored-by: AurelienFT <[email protected]>
Co-authored-by: Sydhds <[email protected]>
Co-authored-by: sydhds <[email protected]>

* improve errors (#4567)

* tech(async_msg) : check if the target address exist

* tech(call_sc) : add check target address to call_sc_op

* check target sc address on init_call

* check target address in read only call

* fix unit tests

* remove dbg macro

* Update massa-execution-worker/src/context.rs

Co-authored-by: Damir Vodenicarevic <[email protected]>

---------

Co-authored-by: Damir Vodenicarevic <[email protected]>

* Fix tests (#4568)

* Fix CI WIP (#4569)

* Fix ws_disabled() test on windows

* fix bootstrap server port

* Fix CI local Leo

* Update scenarios_mandatories.rs

* Add CI profile argument to nextest

---------

Co-authored-by: modship <[email protected]>

* Fix test + Update lcov.info

* Add codecov.yml

* fix internal error serde (#4570)

* Release prebuilt profile (#4572)

* codegen-units set to 1 for prebuilt binaries

* Update toolchain version in CI & CD

* Update CI & Genesis

---------

Signed-off-by: Jean-François <[email protected]>
Co-authored-by: Sydhds <[email protected]>
Co-authored-by: sydhds <[email protected]>
Co-authored-by: Jean-François <[email protected]>
Co-authored-by: Modship <[email protected]>
Co-authored-by: AurelienFT <[email protected]>
Co-authored-by: Damir Vodenicarevic <[email protected]>
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