|
1 | | -import { arc4, biguint, BigUint, Bytes, bytes, op, uint64 } from '@algorandfoundation/algorand-typescript' |
| 1 | +import { arc4, biguint, BigUint, Bytes, bytes, log, op, uint64 } from '@algorandfoundation/algorand-typescript' |
| 2 | +import { |
| 3 | + Bool, |
| 4 | + DynamicArray, |
| 5 | + interpretAsArc4, |
| 6 | + StaticArray, |
| 7 | + Str, |
| 8 | + Tuple, |
| 9 | + UFixedNxM, |
| 10 | + UintN, |
| 11 | + UintN16, |
| 12 | + UintN32, |
| 13 | + UintN64, |
| 14 | + UintN8, |
| 15 | +} from '@algorandfoundation/algorand-typescript/arc4' |
2 | 16 |
|
3 | 17 | export class PrimitiveOpsContract extends arc4.Contract { |
4 | 18 | @arc4.abimethod() |
@@ -390,27 +404,26 @@ export class PrimitiveOpsContract extends arc4.Contract { |
390 | 404 | return result |
391 | 405 | } |
392 | 406 |
|
393 | | - // TODO: uncomment when arc4 types are available |
394 | | - // @arc4.abimethod |
395 | | - // public verify_log( # noqa: PLR0913 |
396 | | - // self, |
397 | | - // a: String, |
398 | | - // b: uint64, |
399 | | - // c: bytes, |
400 | | - // d: bytes, |
401 | | - // e: arc4.boolean, |
402 | | - // f: arc4.String, |
403 | | - // g: arc4.UIntN[typing.Literal[64]], |
404 | | - // h: arc4.BigUIntN[typing.Literal[256]], |
405 | | - // i: arc4.UFixedNxM[typing.Literal[32], typing.Literal[8]], |
406 | | - // j: arc4.BigUFixedNxM[typing.Literal[256], typing.Literal[16]], |
407 | | - // k: bytes, |
408 | | - // m: bytes, |
409 | | - // n: bytes, |
410 | | - // ) : None: |
411 | | - // d_biguint = BigUint(d) |
412 | | - // arc4_k = arc4.StaticArray[arc4.UInt8, typing.Literal[3]].from_bytes(k) |
413 | | - // arc4_m = arc4.DynamicArray[arc4.UInt16].from_bytes(m) |
414 | | - // arc4_n = arc4.Tuple[arc4.UInt32, arc4.uint64, arc4.String].from_bytes(n) |
415 | | - // log(a, b, c, d_biguint, e, f, g, h, i, j, arc4_k, arc4_m, arc4_n, sep="-") |
| 407 | + @arc4.abimethod() |
| 408 | + public verify_log( |
| 409 | + a: string, |
| 410 | + b: uint64, |
| 411 | + c: bytes, |
| 412 | + d: bytes, |
| 413 | + e: Bool, |
| 414 | + f: Str, |
| 415 | + g: UintN<64>, |
| 416 | + h: UintN<256>, |
| 417 | + i: UFixedNxM<32, 8>, |
| 418 | + j: UFixedNxM<256, 16>, |
| 419 | + k: bytes, |
| 420 | + m: bytes, |
| 421 | + n: bytes, |
| 422 | + ) { |
| 423 | + const d_biguint = BigUint(d) |
| 424 | + const arc4_k = interpretAsArc4<StaticArray<UintN8, 3>>(k) |
| 425 | + const arc4_m = interpretAsArc4<DynamicArray<UintN16>>(m) |
| 426 | + const arc4_n = interpretAsArc4<Tuple<[UintN32, UintN64, Str]>>(n) |
| 427 | + log(a, b, c, d_biguint, e, f, g, h, i, j, arc4_k, arc4_m, arc4_n) |
| 428 | + } |
416 | 429 | } |
0 commit comments