Skip to content

Commit

Permalink
chore[docs]: fix some typos (vyperlang#3855)
Browse files Browse the repository at this point in the history
Signed-off-by: wellweek <xiezitai@outlook.com>
  • Loading branch information
wellweek authored Apr 20, 2024
1 parent e1adb7b commit 80708e6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/control-structures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Nonreentrancy locks work by setting a specially allocated storage slot to a ``<l

You cannot put the ``@nonreentrant`` decorator on a ``pure`` function. You can put it on a ``view`` function, but it only checks that the function is not in a callback (the storage slot is not in the ``<locked>`` state), as ``view`` functions can only read the state, not change it.

You can view where the nonreentrant key is physically laid out in storage by using ``vyper`` with the ``-f layout`` option (e.g., ``vyper -f layout foo.vy``). Unless it is overriden, the compiler will allocate it at slot ``0``.
You can view where the nonreentrant key is physically laid out in storage by using ``vyper`` with the ``-f layout`` option (e.g., ``vyper -f layout foo.vy``). Unless it is overridden, the compiler will allocate it at slot ``0``.

.. note::
A mutable function can protect a ``view`` function from being called back into (which is useful for instance, if a ``view`` function would return inconsistent state during a mutable function), but a ``view`` function cannot protect itself from being called back into. Note that mutable functions can never be called from a ``view`` function because all external calls out from a ``view`` function are protected by the use of the ``STATICCALL`` opcode.
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/syntax/test_nested_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,5 @@ def foo():


@pytest.mark.parametrize("good_code", valid_list)
def test_nested_list_sucess(good_code):
def test_nested_list_success(good_code):
assert compiler.compile_code(good_code) is not None
4 changes: 2 additions & 2 deletions vyper/codegen/expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ def build_in_comparator(self):
return IRnode.from_list(b1.resolve(b2.resolve(ret)), typ=BoolT())

@staticmethod
def _signed_to_unsigned_comparision_op(op):
def _signed_to_unsigned_comparison_op(op):
translation_map = {"sgt": "gt", "sge": "ge", "sle": "le", "slt": "lt"}
if op in translation_map:
return translation_map[op]
Expand Down Expand Up @@ -554,7 +554,7 @@ def parse_Compare(self):
if left.typ == right.typ and right.typ == UINT256_T:
# signed comparison ops work for any integer
# type BESIDES uint256
op = self._signed_to_unsigned_comparision_op(op)
op = self._signed_to_unsigned_comparison_op(op)

elif left.typ._is_prim_word and right.typ._is_prim_word:
if op not in ("eq", "ne"):
Expand Down

0 comments on commit 80708e6

Please sign in to comment.