increase max value
This commit is contained in:
parent
af0c4e9008
commit
0ce3d411a2
|
@ -34,8 +34,8 @@ constants: Dict[str, Any] = {
|
|||
"MEMPOOL_BLOCK_BUFFER": 10,
|
||||
# Coinbase rewards are not spendable for 200 blocks
|
||||
"COINBASE_FREEZE_PERIOD": 200,
|
||||
# Max coin amount int(1 << 48)
|
||||
"MAX_COIN_AMOUNT": 281474976710656,
|
||||
# Max coin amount uint(1 << 64)
|
||||
"MAX_COIN_AMOUNT": b'\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF',
|
||||
# Raw size per block target = 1,000,000 bytes
|
||||
# Rax TX (single in, single out) = 219 bytes (not compressed)
|
||||
# TX = 457 vBytes
|
||||
|
|
|
@ -1022,7 +1022,7 @@ class Blockchain:
|
|||
# Check additions for max coin amount
|
||||
for coin in additions:
|
||||
additions_dic[coin.name()] = coin
|
||||
if coin.amount >= self.constants["MAX_COIN_AMOUNT"]:
|
||||
if coin.amount >= uint64.from_bytes(self.constants["MAX_COIN_AMOUNT"]):
|
||||
return Err.COIN_AMOUNT_EXCEEDS_MAXIMUM
|
||||
|
||||
# Validate addition and removal roots
|
||||
|
|
|
@ -141,7 +141,7 @@ class MempoolManager:
|
|||
|
||||
# Check additions for max coin amount
|
||||
for coin in additions:
|
||||
if coin.amount >= self.constants["MAX_COIN_AMOUNT"]:
|
||||
if coin.amount >= uint64.from_bytes(self.constants["MAX_COIN_AMOUNT"]):
|
||||
return (
|
||||
None,
|
||||
MempoolInclusionStatus.FAILED,
|
||||
|
|
|
@ -6,6 +6,7 @@ import time
|
|||
from typing import Dict
|
||||
from secrets import token_bytes
|
||||
|
||||
from src.consensus.constants import constants
|
||||
from src.protocols import full_node_protocol as fnp, timelord_protocol, wallet_protocol
|
||||
from src.server.outbound_message import NodeType
|
||||
from src.types.peer_info import PeerInfo
|
||||
|
@ -798,7 +799,7 @@ class TestWalletProtocol:
|
|||
100, wallet_a.get_new_puzzlehash(), blocks_new[-1].header.data.coinbase,
|
||||
)
|
||||
spend_bundle_bad = wallet_a.generate_signed_transaction(
|
||||
1000000000000000,
|
||||
uint64.from_bytes(constants["MAX_COIN_AMOUNT"]),
|
||||
wallet_a.get_new_puzzlehash(),
|
||||
blocks_new[-1].header.data.coinbase,
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue