smartpy_io | Unsorted

Telegram-канал smartpy_io - SmartPy

429

https://smartpy.io/ https://twitter.com/smartpy_io

Subscribe to a channel

SmartPy

hi is the migration still ongoing? DNS lookup for the domain is failing

Читать полностью…

SmartPy

ive just checked and its 1000 req per minute for both

Читать полностью…

SmartPy

I think it is something like 500 req per minute but I'll have to check with the infrastructure people who now run it

Читать полностью…

SmartPy

Hello, the URLs are https://mainnet.smartpy.io and https://ghostnet.smartpy.io

No API keys needed.

Читать полностью…

SmartPy

Hi, first congratulations !
I'll ask to the infra specialists on our side and answer you back.

Читать полностью…

SmartPy

Hello all, we will be working on the mainnet RPC this afternoon to switch it over to google cloud hosting. Hopefully there will be minimal downtime but expect a few minutes out at around 3pm UK time.

Читать полностью…

SmartPy

It's running the last in https://smartpy.io/releases meaning 0.19.1

Читать полностью…

SmartPy

aren't those examples wrong* if to_index is exclusive

Читать полностью…

SmartPy

Sorry to return to this topic, does sub_list only work with list[int]?

Читать полностью…

SmartPy

if anyone is interested:
https://github.com/AxelRoffi/Tezos-Smart-Contracts-Development-Course

Читать полностью…

SmartPy

Hello, anyone knows where i can find the repo for the freecodecamp course "Tezos Blockchain Developer Course – Python Web3 Development" ? I contacted the author on Slack, but not sure he's still active at Nomadic Labs

Читать полностью…

SmartPy

Thank you very much, yes now through my docker container and 0.19.2a4 it works.

Читать полностью…

SmartPy

here's how I set it up to test:

$ python3 -m venv test-env
$ test-env/bin/python3 -m pip install tezos_smartpy-0.19.2a4-py3-none-any.whl
$ cd example-with-spy-files
$ ../test-env/bin/python3 ./test_a_b.py

Читать полностью…

SmartPy

Thank so much for all the support.
Unfortunately I'm facing another error.
The version of python I'm running is 3.12.5 and the smartpy version is 0.19.2a4


isacco@macbookpro-1 examples-with-spy-files % python3 test_a_b.py
Traceback (most recent call last):
File "examples-with-spy-files/test_a_b.py", line 4, in <module>
@sp.add_test()
File "examples-with-spy-files/test_a_b.py", line 25, in test
A = scenario.add_module("./module_A.spy")
AttributeError: 'str' object has no attribute 'sexpr

Читать полностью…

SmartPy

apologies for the bad error messages, some things to note with this new importing system,
* you should only need to include the top level module in the test code scenario = sp.test_scenario(name="Test", modules=A) and so you also dont need to do the python import from contracts.contract_B import module_B as B # (contract_B.py) in the test scenario either
* as with other examples we have to distinguish between smartpy code and actual python code, so smartpy imports are different to python imports. with inlined modules this means having to do a python import to bring them into scope, then a smartpy import to actually use them. Another difference is that smartpy imports only support import X or import W.X.Y as Z forms.
* I agree this is awkward but things are clearer if you just use .spy files - but inline modules are still necessary for other use cases (e.g. current web ide) - and understand you may not want to convert everything to spy files either

* some examples in the templates for .spy files would be test_rng.py which imports rng.spy and threefry.spy via add_module
* the fa2_1 libs and tests now make extensive use of importing inline modules, first bringing them into scope with a python import and then using them in smartpy with a smartpy import

Читать полностью…

SmartPy

Hello all, just to say that later on today at around 3pm we will be switching over the rest of the SmartPy infrastructure (website etc) to google cloud. Hopefully there won't be any significant downtime but there may be some small interruptions whilst new SSL certificates are provisioned.

Читать полностью…

SmartPy

Okay Can you please confirm for both ghostnet and mainnet

Читать полностью…

SmartPy

Is there any rate limit for this ?

Читать полностью…

SmartPy

Sure, I'm waiting for the answer

Читать полностью…

SmartPy

Hi Jordan, I'm going live on mainnet so which RPC url I should use ? also does it contain any API_KEY ?

Читать полностью…

SmartPy

It seems that there are some errors in this utils.
Sorry for that.
You can change it with "return reversed(res)".
I'm reporting to the team.

Читать полностью…

SmartPy

Jordan sorry for noob questions, but what version of smartpy is https://smartpy.io/ide running?

Читать полностью…

SmartPy

Here is the code of sub_list:

def sub_list(abc):
"""Compute the portion of a list that contains elements starting at from_index and extends up to element at to_index-1.

Parameters:
abc (sp.tuple[sp.list[sp.int], sp.int, sp.int]: A tuple with the values '(elements, from_index, to_index)'.

Returns:
sp.list[int]: A portion of the original list from 'from_index' (inclusive) up to 'to_index' (exclusive).

Examples:
import smartpy.list_utils as list_utils
sp.pack(list_utils.sub_list(([1, 2, 3, 4, 5], 1, 2))) == sp.pack([2, 3])
sp.pack(list_utils.sub_list(([1, 2, 3, 4, 5], 1, 3))) == sp.pack([2, 3, 4])
"""
(elements, from_index, to_index) = sp.cast(
abc, sp.tuple[sp.list[sp.int], sp.int, sp.int]
)
assert from_index <= to_index
res = []
idx = 0
for v in elements:
if idx >= from_index and idx < to_index:
res.push(v)
idx = idx + 1
return res


You may want to write your own version for your use case.
Currently we don't have an equivalent of the old syntax head and tail match. I'm considering your need.

Читать полностью…

SmartPy

Buena tarde, podrían proporcionar un teléfono para contacto

Читать полностью…

SmartPy

got it, author replied ♥

Читать полностью…

SmartPy

Hey, I have another question. When working with lists, is it possible to pop or delete a specific element? I checked the docs page, but I couldn’t find a way to do it.
https://releases.smartpy.io/0.19.2a4/manual/data-types/lists-sets-and-maps
EDIT: I found what I need: https://releases.smartpy.io/0.19.2a4/manual/stdlib/library#sub_list

Читать полностью…

SmartPy

note only the first python call uses the global python3, the others use the venv one

Читать полностью…

SmartPy

hmm, are you sure you are picking up the correct version of smartpy? I get that same error when I run test_a_b.py with a normal python env that has smartpy 0.19.1 installed.

Читать полностью…

SmartPy

Here's the same example but with .spy files instead - I think it is simpler, and clearer as to what is smartpy code and what is python code

Читать полностью…

SmartPy

Isacco - I made a little example for you that works

Читать полностью…
Subscribe to a channel