Exemple #1
0
def get_notifications_is_notification() -> bool:
    notify("unit_test")

    n = get_notifications()

    if len(n) > 0:
        return is_notification(n[0])
    else:
        return False
def notification(args: List[Any]) -> Notification:
    for x in args:
        notify(x)

    n = get_notifications()

    if len(n) > 0:
        return n[0]
    return Notification()
def notification(args: List[Any]) -> Notification:
    for x in args:
        notify(x)

    n = get_notifications(executing_script_hash)

    if len(n) > 0:
        return n[0]
    return Notification()
def test_end_while_jump() -> bool:
    iterator = find(b'feesMap')
    fee_receiver = get(FEE_RECEIVER_KEY)
    while iterator.next():
        token_bytes = cast(bytes, iterator.value[0])
        token_bytes = token_bytes[
            7:]  # cut 'feesMap' at the beginning of the bytes
        token = cast(UInt160, token_bytes)
        fee_amount = cast(int, iterator.value[1])
        if fee_amount > 0:
            notify([token, executing_script_hash, fee_receiver, fee_amount])
    return True
def main() -> bytes:

    m = b'\x01\x02\x03\x04\x05\x06\x07\x08'

    s2 = m[:4]

    j = 2
    k = 4

    s3 = m[j:k]

    notify(s3)

    s4 = m[get_slice_start():get_slice_end()]

    notify(s4)

    ind = [1, 3, 4, 5]

    s6 = m[get_slice_start():ind[2]]

    notify(s6)

    res = s6 + s4 + s2 + s3

    notify(res)

    return res
Exemple #6
0
def main(operation: str, arg: Any) -> Any:

    if operation == 'get_trigger':
        return get_trigger()

    elif operation == 'check_witness' and isinstance(arg, bytes):
        return check_witness(arg)

    elif operation == 'get_time':
        return get_time

    elif operation == 'log' and isinstance(arg, str):
        log(arg)
        return True

    elif operation == 'notify':
        notify(arg)
        return True

    return 'unknown'
Exemple #7
0
def Main():
    notify(True)
def notify_args(args: List[Any]):
    for x in args:
        notify(x)
Exemple #9
0
def _deploy(data: Any, update: bool):
    notify(update)
    notify(data)
    if isinstance(data, str):
        put('storage', data)
def Main(notify_name: str):
    notify(10, notify_name)
Exemple #11
0
def Main():
    notify('str')
Exemple #12
0
def Main():
    notify(None)
Exemple #13
0
def Main():
    notify([2, 3, 5, 7])
Exemple #14
0
def Main():
    notify(15)
def notify_user():
    notify('Notify was called')
Exemple #16
0
def _deploy(data: Any, update: bool):
    notify(update)
    notify(data)