From 6c6520ce60148664dc3740f0f07a12e2a1c8d989 Mon Sep 17 00:00:00 2001 From: mmsqe Date: Thu, 4 Jan 2024 21:17:43 +0800 Subject: [PATCH] flake-compat --- integration_tests/poetry.lock | 8 ++++---- integration_tests/pyproject.toml | 2 +- integration_tests/test_upgrade.py | 6 +++--- integration_tests/upgrade-test.nix | 9 ++++++++- nix/default.nix | 1 + nix/sources.json | 12 ++++++++++++ 6 files changed, 29 insertions(+), 9 deletions(-) diff --git a/integration_tests/poetry.lock b/integration_tests/poetry.lock index 22a221f3b..3eb140396 100644 --- a/integration_tests/poetry.lock +++ b/integration_tests/poetry.lock @@ -842,9 +842,9 @@ tomlkit = "^0.7.0" [package.source] type = "git" -url = "https://github.com/crypto-com/pystarport.git" -reference = "1c3515549650497ff12fec4d2060a7e9cbaedf33" -resolved_reference = "1c3515549650497ff12fec4d2060a7e9cbaedf33" +url = "https://github.com/mmsqe/pystarport.git" +reference = "e4b75196ccd7aba037118a9407caaede2e72aac4" +resolved_reference = "e4b75196ccd7aba037118a9407caaede2e72aac4" [[package]] name = "pytest" @@ -1217,4 +1217,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.8" -content-hash = "3c7139251d8478b416b8efa506b5c6118ad0346d9fead29f96697007b6f74222" +content-hash = "6e2379538513563784c136b340bdabf946420d6ceaa8fbf8d74216c8cdfa30bb" diff --git a/integration_tests/pyproject.toml b/integration_tests/pyproject.toml index 79d910e92..fa8c79758 100644 --- a/integration_tests/pyproject.toml +++ b/integration_tests/pyproject.toml @@ -19,7 +19,7 @@ pytest-github-actions-annotate-failures = "^0.1.7" protobuf = "^3.20.2" pyyaml = "^6.0.1" python-dateutil = "^2.8.1" -pystarport = { git = "https://github.com/crypto-com/pystarport.git", branch = "main", rev = "1c3515549650497ff12fec4d2060a7e9cbaedf33" } +pystarport = { git = "https://github.com/mmsqe/pystarport.git", branch = "main", rev = "e4b75196ccd7aba037118a9407caaede2e72aac4" } chainlibpy = "^2.2.0" # manually upgrade to make hatchling build success in poetry2nix diff --git a/integration_tests/test_upgrade.py b/integration_tests/test_upgrade.py index 53d31da90..ffd36670c 100644 --- a/integration_tests/test_upgrade.py +++ b/integration_tests/test_upgrade.py @@ -371,7 +371,7 @@ def assert_commission(adr, expected): "creator": creator, }, ev - target_height = cluster.block_height() + 30 + target_height = cluster.block_height() + 15 upgrade(cluster, "v4.2.0", target_height, cosmos_sdk_47=False) cli = cluster.cosmos_cli() @@ -414,8 +414,8 @@ def assert_commission(adr, expected): assert_commission(validator1_operator_address, min_commission_rate) assert_commission(validator2_operator_address, default_rate) - target_height = cluster.block_height() + 30 - # upgrade(cluster, "sdk47-upgrade", target_height, cosmos_sdk_47=False) + target_height = cluster.block_height() + 15 + upgrade(cluster, "sdk47-upgrade", target_height, cosmos_sdk_47=False) def test_cancel_upgrade(cluster): diff --git a/integration_tests/upgrade-test.nix b/integration_tests/upgrade-test.nix index 1dbe2fd74..cd4497d9d 100644 --- a/integration_tests/upgrade-test.nix +++ b/integration_tests/upgrade-test.nix @@ -3,7 +3,14 @@ let released = (import (builtins.fetchTarball "https://github.com/crypto-org-chain/chain-main/archive/v1.1.0.tar.gz") { }).chain-maind; released2 = (import (builtins.fetchTarball "https://github.com/crypto-org-chain/chain-main/archive/v2.0.1.tar.gz") { }).chain-maind; released3 = (import (builtins.fetchTarball "https://github.com/crypto-org-chain/chain-main/archive/v3.3.4.tar.gz") { }).chain-maind; - released4 = (import (builtins.fetchTarball "https://github.com/crypto-org-chain/chain-main/archive/v4.0.0-alpha3-croeseid.tar.gz") { }).chain-maind; + fetchFlake = repo: rev: (pkgs.flake-compat { + src = { + outPath = builtins.fetchTarball "https://github.com/${repo}/archive/${rev}.tar.gz"; + inherit rev; + shortRev = builtins.substring 0 7 rev; + }; + }).defaultNix; + released4 = (fetchFlake "crypto-org-chain/chain-main" "b3226f06fd2a236f9957304c4d83b0ea06ed2604").default; current = pkgs.callPackage ../. { }; in pkgs.linkFarm "upgrade-test-package" [ diff --git a/nix/default.nix b/nix/default.nix index 393ce79c9..e6a4949a5 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -2,6 +2,7 @@ import sources.nixpkgs { overlays = [ (_: pkgs: { + flake-compat = import sources.flake-compat; cosmovisor = pkgs.buildGoModule rec { name = "cosmovisor"; src = sources.cosmos-sdk + "/cosmovisor"; diff --git a/nix/sources.json b/nix/sources.json index 20aba3331..f5551f6c9 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -46,5 +46,17 @@ "type": "tarball", "url": "https://github.com/NixOS/nixpkgs/archive/90aa73fc8e1550b16d1ebdc436e48d9951f7989b.tar.gz", "url_template": "https://github.com///archive/.tar.gz" + }, + "flake-compat": { + "branch": "master", + "description": null, + "homepage": null, + "owner": "edolstra", + "repo": "flake-compat", + "rev": "b4a34015c698c7793d592d66adbab377907a2be8", + "sha256": "1qc703yg0babixi6wshn5wm2kgl5y1drcswgszh4xxzbrwkk9sv7", + "type": "tarball", + "url": "https://github.com/edolstra/flake-compat/archive/b4a34015c698c7793d592d66adbab377907a2be8.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" } }