Skip to content

Support importing puya-ts packages #117

@tasosbit

Description

@tasosbit

It doesn't look like importing a third party puya-ts package is supported

In this branch I tried testing a method that calls out to an external puya-ts package

When running that test (npm run test -- -t 'with committee') I get:

 FAIL  smart_contracts/oracle/oracle.algo.spec.ts > Oracle contract > with committee > getCommitteeMetadata should get correct information
Error: This method is intentionally not implemented.

If you are attempting to unit test your contract, check the configuration of your test transformer (see @algorandfoundation/algorand-typescript-testing)
 ❯ Module.BoxMap ../../node_modules/.pnpm/@algorandfoundation+algorand-typescript@1.0.0-alpha.91_tslib@2.8.1/node_modules/@algorandfoundation/src/box.ts:152:9
 ❯ Module.sbMetaBox ../../node_modules/.pnpm/@d13co+superbox@1.1.0_tslib@2.8.1/node_modules/@d13co/superbox/smart_contracts/superbox/lib/utils.algo.ts:21:44
     21|  * @param num Data box index
     22|  * @returns
     23|  */
       |   ^
     24| export function sbDataBoxName(name: string, num: uint64) {
     25|   return Bytes(name).concat(Bytes(itoa(num)))
 ❯ Module.sbCreate ../../node_modules/.pnpm/@d13co+superbox@1.1.0_tslib@2.8.1/node_modules/@d13co/superbox/smart_contracts/superbox/lib/superbox.algo.ts:17:41
 ❯ CommitteeOracle.registerCommittee smart_contracts/oracle/oracle.algo.ts:84:5
 ❯ ../../node_modules/.pnpm/@algorandfoundation+algorand-typescript-testing@1.1.0_tslib@2.8.1/node_modules/@algorandfoundation/src/subcontexts/contract-context.ts:270:63
 ❯ Object.execute ../../node_modules/.pnpm/@algorandfoundation+algorand-typescript-testing@1.1.0_tslib@2.8.1/node_modules/@algorandfoundation/src/subcontexts/transaction-context.ts:124:24
 ❯ Proxy.<anonymous> ../../node_modules/.pnpm/@algorandfoundation+algorand-typescript-testing@1.1.0_tslib@2.8.1/node_modules/@algorandfoundation/src/subcontexts/contract-context.ts:266:58
 ❯ smart_contracts/oracle/oracle.algo.spec.ts:29:16

Is there a way to manually include that package to the transformation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions