{"id":19369218,"url":"https://github.com/joystream/mock_demo_node","last_synced_at":"2025-07-22T23:03:39.112Z","repository":{"id":66359803,"uuid":"233840880","full_name":"Joystream/mock_demo_node","owner":"Joystream","description":" Demo project: mocking Parity substrate modules","archived":false,"fork":false,"pushed_at":"2020-02-10T17:37:42.000Z","size":47598,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-24T13:48:54.359Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Joystream.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-14T12:52:44.000Z","updated_at":"2020-02-11T08:05:52.000Z","dependencies_parsed_at":"2023-02-21T18:15:14.277Z","dependency_job_id":null,"html_url":"https://github.com/Joystream/mock_demo_node","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Joystream/mock_demo_node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joystream%2Fmock_demo_node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joystream%2Fmock_demo_node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joystream%2Fmock_demo_node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joystream%2Fmock_demo_node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Joystream","download_url":"https://codeload.github.com/Joystream/mock_demo_node/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joystream%2Fmock_demo_node/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266586905,"owners_count":23952205,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T08:10:05.516Z","updated_at":"2025-07-22T23:03:39.100Z","avatar_url":"https://github.com/Joystream.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Substrate modules mocks\n\nThis project demostrates how to use mocks with Parity Substrate modules. It contains 'toy' examples and aims to demontrate mocking techniques.\n\nMocking framework:\n- [Mockall](https://docs.rs/mockall/0.6.0/mockall/)\n\n### Motivation\n\nYou can use mocks when you want to test modules independently. If module A is dependent on module B and next version of module B is not ready or it contains a bug - mocking can be very useful.\n\n### Description\n\nProject contains two substrate modules and their tests:\n\n- discounts\n- complex_prices\n\n**complex_prices** modules depend on **discounts** module in order to calculate price.\n\n### Complex_prices\n\nIf you need feature-rich mocks or stateful mocks you can create *mockall* solution, with some additional abstraction layers when use dependent **discounts** module.\n\n\nSimpler example - how to test the substrate module - you can find [here.](https://substrate.dev/recipes/testing/externalities.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoystream%2Fmock_demo_node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoystream%2Fmock_demo_node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoystream%2Fmock_demo_node/lists"}