Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/bump-chia-rs-0.12.0' into rust_g…
Browse files Browse the repository at this point in the history
…et_flags
  • Loading branch information
matt-o-how committed Aug 15, 2024
2 parents cd9387c + ae9765b commit 0e69bc4
Show file tree
Hide file tree
Showing 46 changed files with 1,210 additions and 810 deletions.
2 changes: 1 addition & 1 deletion chia-blockchain-gui
Submodule chia-blockchain-gui updated 87 files
+5 −0 .github/dependabot.yml
+1 −0 .github/workflows/dependency-review.yml
+0 −15 .prettierrc.json
+14 −0 .prettierrc.yml
+15 −20 package-lock.json
+9 −9 packages/api-react/README.md
+6 −0 packages/api/src/constants/PlotFilter.ts
+1 −1 packages/api/src/services/Farmer.ts
+1 −1 packages/core/src/locales/fa-IR/messages.po
+1 −1 packages/core/src/locales/sv-SE/messages.po
+1 −1 packages/core/src/locales/zh-CN/messages.po
+1 −1 packages/gui/package.json
+50 −40 packages/gui/src/components/offers2/OfferBuilderValue.tsx
+1 −1 packages/gui/src/components/plotNFT/PlotExternalNFTCard.tsx
+1 −1 packages/gui/src/components/plotNFT/PlotNFTCard.tsx
+2 −1 packages/gui/src/components/plotNFT/PlotNFTPayoutInstructionsDialog.tsx
+8 −2 packages/gui/src/components/signVerify/SignMessage.tsx
+1 −0 packages/gui/src/components/signVerify/SigningEntityNFT.tsx
+1 −1 packages/gui/src/hooks/useViewNFTOnExplorer.ts
+24 −14 packages/gui/src/locales/ak-GH/messages.po
+25 −20 packages/gui/src/locales/ar-SA/messages.po
+25 −20 packages/gui/src/locales/be-BY/messages.po
+25 −20 packages/gui/src/locales/bg-BG/messages.po
+24 −14 packages/gui/src/locales/bn-BD/messages.po
+24 −14 packages/gui/src/locales/bn-IN/messages.po
+24 −14 packages/gui/src/locales/bs-BA/messages.po
+25 −20 packages/gui/src/locales/ca-ES/messages.po
+26 −21 packages/gui/src/locales/cs-CZ/messages.po
+24 −14 packages/gui/src/locales/cy-GB/messages.po
+26 −21 packages/gui/src/locales/da-DK/messages.po
+26 −21 packages/gui/src/locales/de-DE/messages.po
+25 −20 packages/gui/src/locales/el-GR/messages.po
+25 −20 packages/gui/src/locales/en-AU/messages.po
+25 −20 packages/gui/src/locales/en-NZ/messages.po
+25 −20 packages/gui/src/locales/en-PT/messages.po
+26 −21 packages/gui/src/locales/en-US/messages.po
+24 −14 packages/gui/src/locales/eo-UY/messages.po
+25 −20 packages/gui/src/locales/es-AR/messages.po
+26 −21 packages/gui/src/locales/es-ES/messages.po
+26 −21 packages/gui/src/locales/es-MX/messages.po
+31 −26 packages/gui/src/locales/fa-IR/messages.po
+26 −21 packages/gui/src/locales/fi-FI/messages.po
+26 −21 packages/gui/src/locales/fr-FR/messages.po
+25 −15 packages/gui/src/locales/he-IL/messages.po
+24 −14 packages/gui/src/locales/hi-IN/messages.po
+25 −20 packages/gui/src/locales/hr-HR/messages.po
+25 −20 packages/gui/src/locales/hu-HU/messages.po
+26 −21 packages/gui/src/locales/id-ID/messages.po
+25 −15 packages/gui/src/locales/is-IS/messages.po
+26 −21 packages/gui/src/locales/it-IT/messages.po
+25 −20 packages/gui/src/locales/ja-JP/messages.po
+24 −14 packages/gui/src/locales/km-KH/messages.po
+25 −20 packages/gui/src/locales/ko-KR/messages.po
+24 −14 packages/gui/src/locales/lol-US/messages.po
+24 −14 packages/gui/src/locales/lt-LT/messages.po
+24 −14 packages/gui/src/locales/lv-LV/messages.po
+24 −14 packages/gui/src/locales/mk-MK/messages.po
+24 −14 packages/gui/src/locales/mn-MN/messages.po
+25 −20 packages/gui/src/locales/nl-NL/messages.po
+25 −20 packages/gui/src/locales/no-NO/messages.po
+24 −14 packages/gui/src/locales/pa-IN/messages.po
+25 −20 packages/gui/src/locales/pl-PL/messages.po
+26 −21 packages/gui/src/locales/pt-BR/messages.po
+26 −21 packages/gui/src/locales/pt-PT/messages.po
+25 −20 packages/gui/src/locales/ro-RO/messages.po
+26 −21 packages/gui/src/locales/ru-RU/messages.po
+24 −14 packages/gui/src/locales/si-LK/messages.po
+26 −21 packages/gui/src/locales/sk-SK/messages.po
+24 −14 packages/gui/src/locales/sl-SI/messages.po
+26 −21 packages/gui/src/locales/sq-AL/messages.po
+23 −18 packages/gui/src/locales/sr-SP/messages.po
+24 −14 packages/gui/src/locales/srp/messages.po
+36 −31 packages/gui/src/locales/sv-SE/messages.po
+25 −15 packages/gui/src/locales/th-TH/messages.po
+24 −14 packages/gui/src/locales/tlh-AA/messages.po
+25 −20 packages/gui/src/locales/tr-TR/messages.po
+26 −21 packages/gui/src/locales/uk-UA/messages.po
+24 −14 packages/gui/src/locales/vi-VN/messages.po
+31 −26 packages/gui/src/locales/zh-CN/messages.po
+26 −21 packages/gui/src/locales/zh-TW/messages.po
+71 −84 packages/gui/src/util/chiaEnvironment.js
+1 −1 packages/gui/src/util/plot.ts
+4 −0 packages/gui/webpack.react.babel.ts
+1 −1 packages/wallets/src/locales/fa-IR/messages.po
+1 −1 packages/wallets/src/locales/sv-SE/messages.js
+2 −2 packages/wallets/src/locales/sv-SE/messages.po
+1 −1 packages/wallets/src/locales/zh-CN/messages.po
2 changes: 1 addition & 1 deletion chia/_tests/clvm/test_puzzle_drivers.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def test_puzzle_info() -> None:
assert puzzle_info == PuzzleInfo(capitalize_bytes)

obj: Union[PuzzleInfo, Solver]
for obj in (puzzle_info, solver): # type: ignore
for obj in (puzzle_info, solver):
assert obj["string"] == "hello"
assert obj["bytes"] == bytes.fromhex("cafef00d")
assert obj["int"] == 123
Expand Down
9 changes: 2 additions & 7 deletions chia/_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,12 @@ def get_keychain():
class ConsensusMode(ComparableEnum):
PLAIN = 0
HARD_FORK_2_0 = 1
SOFT_FORK_4 = 2
SOFT_FORK_5 = 3
SOFT_FORK_5 = 2


@pytest.fixture(
scope="session",
params=[ConsensusMode.PLAIN, ConsensusMode.HARD_FORK_2_0, ConsensusMode.SOFT_FORK_4, ConsensusMode.SOFT_FORK_5],
params=[ConsensusMode.PLAIN, ConsensusMode.HARD_FORK_2_0, ConsensusMode.SOFT_FORK_5],
)
def consensus_mode(request):
return request.param
Expand All @@ -212,10 +211,6 @@ def consensus_mode(request):
@pytest.fixture(scope="session")
def blockchain_constants(consensus_mode: ConsensusMode) -> ConsensusConstants:
ret: ConsensusConstants = test_constants
if consensus_mode >= ConsensusMode.SOFT_FORK_4:
ret = ret.replace(
SOFT_FORK4_HEIGHT=uint32(2),
)
if consensus_mode >= ConsensusMode.HARD_FORK_2_0:
ret = ret.replace(
HARD_FORK_HEIGHT=uint32(2),
Expand Down
28 changes: 14 additions & 14 deletions chia/_tests/core/data_layer/test_data_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ async def test_create_insert_get(
changelist: List[Dict[str, str]] = [{"action": "insert", "key": key.hex(), "value": value.hex()}]
res = await data_rpc_api.create_data_store({})
assert res is not None
store_id = bytes32(hexstr_to_bytes(res["id"]))
store_id = bytes32.from_hexstr(res["id"])
await farm_block_check_singleton(data_layer, full_node_api, ph, store_id, wallet=wallet_rpc_api.service)
res = await data_rpc_api.batch_update({"id": store_id.hex(), "changelist": changelist})
update_tx_rec0 = res["tx_id"]
Expand Down Expand Up @@ -369,7 +369,7 @@ async def test_create_double_insert(
data_rpc_api = DataLayerRpcApi(data_layer)
res = await data_rpc_api.create_data_store({})
assert res is not None
store_id = bytes32(hexstr_to_bytes(res["id"]))
store_id = bytes32.from_hexstr(res["id"])
await farm_block_check_singleton(data_layer, full_node_api, ph, store_id, wallet=wallet_rpc_api.service)
key1 = b"a"
value1 = b"\x01\x02"
Expand Down Expand Up @@ -407,7 +407,7 @@ async def test_keys_values_ancestors(
data_rpc_api = DataLayerRpcApi(data_layer)
res = await data_rpc_api.create_data_store({})
assert res is not None
store_id = bytes32(hexstr_to_bytes(res["id"]))
store_id = bytes32.from_hexstr(res["id"])
await farm_block_check_singleton(data_layer, full_node_api, ph, store_id, wallet=wallet_rpc_api.service)
key1 = b"a"
value1 = b"\x01\x02"
Expand Down Expand Up @@ -482,12 +482,12 @@ async def test_get_roots(
data_rpc_api = DataLayerRpcApi(data_layer)
res = await data_rpc_api.create_data_store({})
assert res is not None
store_id1 = bytes32(hexstr_to_bytes(res["id"]))
store_id1 = bytes32.from_hexstr(res["id"])
await farm_block_check_singleton(data_layer, full_node_api, ph, store_id1, wallet=wallet_rpc_api.service)

res = await data_rpc_api.create_data_store({})
assert res is not None
store_id2 = bytes32(hexstr_to_bytes(res["id"]))
store_id2 = bytes32.from_hexstr(res["id"])
await farm_block_check_singleton(data_layer, full_node_api, ph, store_id2, wallet=wallet_rpc_api.service)

key1 = b"a"
Expand Down Expand Up @@ -535,7 +535,7 @@ async def test_get_root_history(
data_rpc_api = DataLayerRpcApi(data_layer)
res = await data_rpc_api.create_data_store({})
assert res is not None
store_id1 = bytes32(hexstr_to_bytes(res["id"]))
store_id1 = bytes32.from_hexstr(res["id"])
await farm_block_check_singleton(data_layer, full_node_api, ph, store_id1, wallet=wallet_rpc_api.service)
key1 = b"a"
value1 = b"\x01\x02"
Expand Down Expand Up @@ -589,7 +589,7 @@ async def test_get_kv_diff(
data_rpc_api = DataLayerRpcApi(data_layer)
res = await data_rpc_api.create_data_store({})
assert res is not None
store_id1 = bytes32(hexstr_to_bytes(res["id"]))
store_id1 = bytes32.from_hexstr(res["id"])
await farm_block_check_singleton(data_layer, full_node_api, ph, store_id1, wallet=wallet_rpc_api.service)
key1 = b"a"
value1 = b"\x01\x02"
Expand Down Expand Up @@ -656,7 +656,7 @@ async def test_batch_update_matches_single_operations(
data_rpc_api = DataLayerRpcApi(data_layer)
res = await data_rpc_api.create_data_store({})
assert res is not None
store_id = bytes32(hexstr_to_bytes(res["id"]))
store_id = bytes32.from_hexstr(res["id"])
await farm_block_check_singleton(data_layer, full_node_api, ph, store_id, wallet=wallet_rpc_api.service)

key = b"a"
Expand Down Expand Up @@ -2435,7 +2435,7 @@ async def test_mirrors(
data_rpc_api = DataLayerRpcApi(data_layer)
res = await data_rpc_api.create_data_store({})
assert res is not None
store_id = bytes32(hexstr_to_bytes(res["id"]))
store_id = bytes32.from_hexstr(res["id"])
await farm_block_check_singleton(data_layer, full_node_api, ph, store_id, wallet=wallet_rpc_api.service)

urls = ["http://127.0.0.1/8000", "http://127.0.0.1/8001"]
Expand Down Expand Up @@ -2660,7 +2660,7 @@ async def test_dl_proof_errors(
fakeroot = bytes32([4] * 32)
res = await data_rpc_api.create_data_store({})
assert res is not None
store_id = bytes32(hexstr_to_bytes(res["id"]))
store_id = bytes32.from_hexstr(res["id"])
await farm_block_check_singleton(data_layer, full_node_api, ph, store_id, wallet=wallet_rpc_api.service)

with pytest.raises(ValueError, match="no root"):
Expand Down Expand Up @@ -2769,7 +2769,7 @@ async def test_pagination_rpcs(
data_rpc_api = DataLayerRpcApi(data_layer)
res = await data_rpc_api.create_data_store({})
assert res is not None
store_id = bytes32(hexstr_to_bytes(res["id"]))
store_id = bytes32.from_hexstr(res["id"])
await farm_block_check_singleton(data_layer, full_node_api, ph, store_id, wallet=wallet_rpc_api.service)
key1 = b"aa"
value1 = b"\x01\x02"
Expand Down Expand Up @@ -3035,7 +3035,7 @@ async def test_pagination_cmds(

res = await data_rpc_api.create_data_store({})
assert res is not None
store_id = bytes32(hexstr_to_bytes(res["id"]))
store_id = bytes32.from_hexstr(res["id"])
await farm_block_check_singleton(data_layer, full_node_api, ph, store_id, wallet=wallet_rpc_api.service)

key = b"aa"
Expand Down Expand Up @@ -3271,7 +3271,7 @@ async def test_unsubmitted_batch_update(
res = await data_rpc_api.create_data_store({})
assert res is not None

store_id = bytes32(hexstr_to_bytes(res["id"]))
store_id = bytes32.from_hexstr(res["id"])
await farm_block_check_singleton(data_layer, full_node_api, ph, store_id, wallet=wallet_rpc_api.service)

to_insert = [(b"a", b"\x00\x01"), (b"b", b"\x00\x02"), (b"c", b"\x00\x03")]
Expand Down Expand Up @@ -3725,7 +3725,7 @@ class ModifiedStatus(IntEnum):
res = await data_rpc_api.create_data_store({})
assert res is not None

store_id = bytes32(hexstr_to_bytes(res["id"]))
store_id = bytes32.from_hexstr(res["id"])
await farm_block_check_singleton(data_layer, full_node_api, ph, store_id, wallet=wallet_rpc_api.service)

m.setattr("chia.data_layer.data_layer_util.Status", OldStatus)
Expand Down
2 changes: 1 addition & 1 deletion chia/_tests/core/data_layer/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async def general_insert(
store_id: bytes32,
key: bytes,
value: bytes,
reference_node_hash: bytes32,
reference_node_hash: Optional[bytes32],
side: Optional[Side],
) -> bytes32:
insert_result = await data_store.insert(
Expand Down
8 changes: 0 additions & 8 deletions chia/_tests/core/full_node/test_conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,11 +374,6 @@ async def test_announce_conditions_limit(
pre-v2-softfork, and rejects more than the announcement limit afterward.
"""

if condition1.startswith("(66") and consensus_mode < ConsensusMode.SOFT_FORK_4:
# The message conditions aren't enabled until Soft-fork 3, so there
# won't be any errors unless it's activated
expect_err = None

blocks = await initial_blocks(bt)
coin = blocks[-2].get_included_reward_coins()[0]
coin_announcement = AssertCoinAnnouncement(asserted_id=coin.name(), asserted_msg=b"test")
Expand Down Expand Up @@ -456,9 +451,6 @@ async def test_message_conditions(
blocks = await initial_blocks(bt)
coin = blocks[-2].get_included_reward_coins()[0]
conditions = Program.to(assemble("(" + conds.format(coin="0x" + coin.name().hex()) + ")"))
# before the softfork has activated, it's all allowed
if consensus_mode < ConsensusMode.SOFT_FORK_4:
expected = None

await check_conditions(bt, conditions, expected_err=expected)

Expand Down
8 changes: 4 additions & 4 deletions chia/_tests/core/full_node/test_generator_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@

from chia.types.blockchain_format.coin import Coin
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.types.spend_bundle_conditions import Spend, SpendBundleConditions
from chia.types.spend_bundle_conditions import SpendBundleConditions, SpendConditions
from chia.util.generator_tools import tx_removals_and_additions
from chia.util.hash import std_hash
from chia.util.ints import uint32, uint64

coin_ids = [std_hash(i.to_bytes(4, "big")) for i in range(10)]
parent_ids = [std_hash(i.to_bytes(4, "big")) for i in range(10)]
phs = [std_hash(i.to_bytes(4, "big")) for i in range(10)]
spends: List[Spend] = [
Spend(
spends: List[SpendConditions] = [
SpendConditions(
coin_ids[0],
parent_ids[0],
phs[0],
Expand All @@ -38,7 +38,7 @@
[],
0,
),
Spend(
SpendConditions(
coin_ids[1],
parent_ids[1],
phs[0],
Expand Down
7 changes: 0 additions & 7 deletions chia/_tests/core/mempool/test_mempool.py
Original file line number Diff line number Diff line change
Expand Up @@ -2541,13 +2541,6 @@ def test_message_condition(
) -> None:
npc_result = generator_condition_tester(condition, mempool_mode=mempool, height=softfork_height)
print(npc_result)

# the message conditions are only activated with soft fork 4, so
# before then there are no errors.
# In mempool mode, the message conditions activated immediately.
if softfork_height < test_constants.SOFT_FORK4_HEIGHT and not mempool:
expect_error = None

assert npc_result.error == expect_error


Expand Down
4 changes: 2 additions & 2 deletions chia/_tests/core/mempool/test_mempool_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
from chia.types.mempool_item import BundleCoinSpend, MempoolItem
from chia.types.peer_info import PeerInfo
from chia.types.spend_bundle import SpendBundle
from chia.types.spend_bundle_conditions import Spend, SpendBundleConditions
from chia.types.spend_bundle_conditions import SpendBundleConditions, SpendConditions
from chia.util.errors import Err, ValidationError
from chia.util.ints import uint8, uint32, uint64
from chia.wallet.conditions import AssertCoinAnnouncement
Expand Down Expand Up @@ -191,7 +191,7 @@ def make_test_conds(
) -> SpendBundleConditions:
return SpendBundleConditions(
[
Spend(
SpendConditions(
spend_id,
IDENTITY_PUZZLE_HASH,
IDENTITY_PUZZLE_HASH,
Expand Down
4 changes: 2 additions & 2 deletions chia/_tests/fee_estimation/test_fee_estimation_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from chia.types.clvm_cost import CLVMCost
from chia.types.fee_rate import FeeRate, FeeRateV2
from chia.types.mempool_item import MempoolItem
from chia.types.spend_bundle_conditions import Spend, SpendBundleConditions
from chia.types.spend_bundle_conditions import SpendBundleConditions, SpendConditions
from chia.util.ints import uint32, uint64


Expand All @@ -41,7 +41,7 @@ def make_mempoolitem() -> MempoolItem:
block_height = 1

fee = uint64(10000000)
spends: List[Spend] = []
spends: List[SpendConditions] = []
conds = SpendBundleConditions(spends, 0, 0, 0, None, None, [], cost, 0, 0)
mempool_item = MempoolItem(
spend_bundle,
Expand Down
4 changes: 2 additions & 2 deletions chia/_tests/generator/test_rom.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from chia.types.blockchain_format.serialized_program import SerializedProgram
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.types.generator_types import BlockGenerator
from chia.types.spend_bundle_conditions import Spend
from chia.types.spend_bundle_conditions import SpendConditions
from chia.util.ints import uint32
from chia.wallet.puzzles.load_clvm import load_clvm, load_serialized_clvm_maybe_recompile

Expand Down Expand Up @@ -139,7 +139,7 @@ def test_get_name_puzzle_conditions(self, softfork_height: int) -> None:
)
assert npc_result.conds is not None

spend = Spend(
spend = SpendConditions(
coin_id=bytes32.fromhex("e8538c2d14f2a7defae65c5c97f5d4fae7ee64acef7fec9d28ad847a0880fd03"),
parent_id=bytes32.fromhex("0000000000000000000000000000000000000000000000000000000000000000"),
puzzle_hash=bytes32.fromhex("9dcf97a184f32623d11a73124ceb99a5709b083721e878a16d78f596718ba7b2"),
Expand Down
2 changes: 1 addition & 1 deletion chia/_tests/simulation/test_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ async def test_create_coins_with_amounts(
# Get some more coins. The creator helper doesn't get you all the coins you
# need yet.
await full_node_api.farm_blocks_to_wallet(count=2, wallet=wallet, timeout=30)
coins = await full_node_api.create_coins_with_amounts(amounts=amounts, wallet=wallet)
coins = await full_node_api.create_coins_with_amounts(amounts=amounts, wallet=wallet, timeout=60)
assert sorted(coin.amount for coin in coins) == sorted(amounts)


Expand Down
4 changes: 2 additions & 2 deletions chia/_tests/util/test_condition_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.types.condition_opcodes import ConditionOpcode
from chia.types.condition_with_args import ConditionWithArgs
from chia.types.spend_bundle_conditions import Spend, SpendBundleConditions
from chia.types.spend_bundle_conditions import SpendBundleConditions, SpendConditions
from chia.util.condition_tools import parse_sexp_to_conditions, pkm_pairs, pkm_pairs_for_conditions_dict
from chia.util.errors import ConsensusError
from chia.util.hash import std_hash
Expand All @@ -32,7 +32,7 @@ def mk_agg_sig_conditions(
agg_sig_data: List[Tuple[G1Element, bytes]],
agg_sig_unsafe_data: List[Tuple[G1Element, bytes]] = [],
) -> SpendBundleConditions:
spend = Spend(
spend = SpendConditions(
coin_id=TEST_COIN.name(),
parent_id=H1,
puzzle_hash=H2,
Expand Down
2 changes: 1 addition & 1 deletion chia/_tests/util/test_replace_str_to_bytes.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
MAX_GENERATOR_REF_LIST_SIZE=uint32(512),
POOL_SUB_SLOT_ITERS=uint64(37600000000),
SOFT_FORK2_HEIGHT=uint32(0), # unused
SOFT_FORK4_HEIGHT=uint32(5650000),
SOFT_FORK4_HEIGHT=uint32(0), # unused
SOFT_FORK5_HEIGHT=uint32(5940000),
HARD_FORK_HEIGHT=uint32(5496000),
HARD_FORK_FIX_HEIGHT=uint32(0), # unused
Expand Down
1 change: 0 additions & 1 deletion chia/_tests/util/test_testnet_overrides.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ def test_testnet11() -> None:
overrides: Dict[str, Any] = {}
update_testnet_overrides("testnet11", overrides)
assert overrides == {
"SOFT_FORK4_HEIGHT": 641500,
"SOFT_FORK5_HEIGHT": 1340000,
}

Expand Down
Loading

0 comments on commit 0e69bc4

Please sign in to comment.