0

In the test, I am trying to replace the admin with a fixed account. But I cannot find what t should be.

admin = sp.contract( t,"tz1dQXqXZ3Y5sgYwU9Aq9xRJPxEZNUwyE6ht", entry_point = "")
alice = sp.test_account("Alice")
bob = sp.test_account("Robert")

1 Answer 1

0

You want to do something like:

import smartpy as sp

class Sample(sp.Contract):
    def __init__(self, **kargs):
        self.init(**kargs)

    @sp.entry_point
    def ep(self):
        c = sp.contract(sp.TUnit, sp.address("tz1dQXqXZ3Y5sgYwU9Aq9xRJPxEZNUwyE6ht"))
        sp.transfer(sp.unit, sp.tez(10), c.open_some())

@sp.add_test(name = "Sample")
def test():
    scenario = sp.test_scenario()
    c1 = Sample()
    c1.set_initial_balance(sp.tez(1000000))
    scenario += c1
    c1.ep()
1
  • thank you so much again! Much appreciated!
    – Lauzaki
    Sep 18, 2021 at 14:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.