def test_AddressTypeSpec_eq(): assert abi.AddressTypeSpec() == abi.AddressTypeSpec() for otherType in ( abi.ByteTypeSpec(), abi.StaticArrayTypeSpec(abi.ByteTypeSpec(), 32), abi.DynamicArrayTypeSpec(abi.ByteTypeSpec()), ): assert abi.AddressTypeSpec() != otherType
def test_AccountTypeSpec_eq(): assert abi.AccountTypeSpec() == abi.AccountTypeSpec() for otherType in ( abi.ByteTypeSpec(), abi.Uint8TypeSpec(), abi.AddressTypeSpec(), ): assert abi.AccountTypeSpec() != otherType
def test_ApplicationTypeSpec_eq(): assert abi.ApplicationTypeSpec() == abi.ApplicationTypeSpec() for otherType in ( abi.ByteTypeSpec(), abi.Uint8TypeSpec(), abi.AddressTypeSpec(), ): assert abi.ApplicationTypeSpec() != otherType
def test_TransactionTypeSpec_eq(): for tv in TransactionValues: assert tv.ts == tv.ts for otherType in ( abi.ByteTypeSpec(), abi.Uint8TypeSpec(), abi.AddressTypeSpec(), ): assert tv.ts != otherType
def test_Address_set_computed(): av = pt.Addr("MDDKJUCTY57KA2PBFI44CLTJ5YHY5YVS4SVQUPZAWSRV2ZAVFKI33O6YPE") computed_value = ContainerType(abi.AddressTypeSpec(), av) value = abi.Address() expr = value.set(computed_value) assert expr.type_of() == pt.TealType.none assert not expr.has_return() _, byte_ops = av.__teal__(options) expected = pt.TealSimpleBlock([ byte_ops.ops[0], pt.TealOp(None, pt.Op.store, value.stored_value.slot), ]) actual, _ = expr.__teal__(options) actual.addIncoming() actual = pt.TealBlock.NormalizeBlocks(actual) with pt.TealComponent.Context.ignoreExprEquality(): assert actual == expected with pytest.raises(pt.TealInputError): value.set(ContainerType(abi.ByteTypeSpec(), pt.Int(0x01)))
def test_AddressTypeSpec_new_instance(): assert isinstance(abi.AddressTypeSpec().new_instance(), abi.Address)
def test_AddressTypeSpec_length_static(): assert (abi.AddressTypeSpec()).length_static() == abi.AddressLength.Bytes
def test_AddressTypeSpec_is_dynamic(): assert (abi.AddressTypeSpec()).is_dynamic() is False
def test_AddressTypeSpec_str(): assert str(abi.AddressTypeSpec()) == "address"