From cfdf857b601798a3591d8122ac68491ce03c3268 Mon Sep 17 00:00:00 2001 From: Bobby Lat Date: Fri, 17 Jan 2025 12:07:02 +0800 Subject: [PATCH] feat: add tests for multi-inheritance contract --- .../multi-inheritance/contract.algo.ts | 58 ++++ .../data/BaseOne.approval.teal | 84 ++++++ .../multi-inheritance/data/BaseOne.arc32.json | 85 ++++++ .../multi-inheritance/data/BaseOne.arc56.json | 149 +++++++++++ .../multi-inheritance/data/BaseOne.clear.teal | 7 + .../data/BaseTwo.approval.teal | 83 ++++++ .../multi-inheritance/data/BaseTwo.arc32.json | 86 ++++++ .../multi-inheritance/data/BaseTwo.arc56.json | 150 +++++++++++ .../multi-inheritance/data/BaseTwo.clear.teal | 7 + .../data/CommonBase.approval.teal | 65 +++++ .../data/CommonBase.arc32.json | 68 +++++ .../data/CommonBase.arc56.json | 126 +++++++++ .../data/CommonBase.clear.teal | 7 + .../data/MultiBases.approval.teal | 162 ++++++++++++ .../data/MultiBases.arc32.json | 158 +++++++++++ .../data/MultiBases.arc56.json | 249 ++++++++++++++++++ .../data/MultiBases.clear.teal | 7 + tests/multi-inheritance.spec.ts | 46 ++++ 18 files changed, 1597 insertions(+) create mode 100644 tests/artifacts/multi-inheritance/contract.algo.ts create mode 100644 tests/artifacts/multi-inheritance/data/BaseOne.approval.teal create mode 100644 tests/artifacts/multi-inheritance/data/BaseOne.arc32.json create mode 100644 tests/artifacts/multi-inheritance/data/BaseOne.arc56.json create mode 100644 tests/artifacts/multi-inheritance/data/BaseOne.clear.teal create mode 100644 tests/artifacts/multi-inheritance/data/BaseTwo.approval.teal create mode 100644 tests/artifacts/multi-inheritance/data/BaseTwo.arc32.json create mode 100644 tests/artifacts/multi-inheritance/data/BaseTwo.arc56.json create mode 100644 tests/artifacts/multi-inheritance/data/BaseTwo.clear.teal create mode 100644 tests/artifacts/multi-inheritance/data/CommonBase.approval.teal create mode 100644 tests/artifacts/multi-inheritance/data/CommonBase.arc32.json create mode 100644 tests/artifacts/multi-inheritance/data/CommonBase.arc56.json create mode 100644 tests/artifacts/multi-inheritance/data/CommonBase.clear.teal create mode 100644 tests/artifacts/multi-inheritance/data/MultiBases.approval.teal create mode 100644 tests/artifacts/multi-inheritance/data/MultiBases.arc32.json create mode 100644 tests/artifacts/multi-inheritance/data/MultiBases.arc56.json create mode 100644 tests/artifacts/multi-inheritance/data/MultiBases.clear.teal create mode 100644 tests/multi-inheritance.spec.ts diff --git a/tests/artifacts/multi-inheritance/contract.algo.ts b/tests/artifacts/multi-inheritance/contract.algo.ts new file mode 100644 index 0000000..b6d53cb --- /dev/null +++ b/tests/artifacts/multi-inheritance/contract.algo.ts @@ -0,0 +1,58 @@ +import type { uint64 } from '@algorandfoundation/algorand-typescript' +import { Contract, GlobalState, Uint64 } from '@algorandfoundation/algorand-typescript' +import { classes } from 'polytype' + +export class CommonBase extends Contract { + stateCommon = GlobalState({ initialValue: 123 }) + + methodCommon() { + return 'common' + } + + b2CantOverride(): string { + return 'common' + } +} + +export class BaseOne extends CommonBase { + stateOne = GlobalState({ initialValue: Uint64(45) }) + methodOne() { + return 'base-one' + } +} + +export class BaseTwo extends CommonBase { + stateTwo = GlobalState({ initialValue: 'Hello' }) + methodTwo() { + return 'base-two' + } + + /** + * Because CommonBase implements this method, and MRO for polytype is depth first; this method + * should not be accessible from MultiBases as the MRO should be `BaseOne => CommonBase => BaseTwo => CommonBase` + * and since CommonBase provides an implementation, this one should not be used + */ + b2CantOverride(): string { + return 'base-two' + } +} + +export class MultiBases extends classes(BaseOne, BaseTwo) { + stateMulti = GlobalState({ initialValue: 'Hmmm' }) + + methodMulti() { + return 'multi-bases' + } + + methodCallsSuper() { + return super.methodTwo() + } + + callB2CantOverride() { + return super.class(BaseTwo).b2CantOverride() + } + + callB2Common() { + return super.class(BaseTwo).methodCommon() + } +} diff --git a/tests/artifacts/multi-inheritance/data/BaseOne.approval.teal b/tests/artifacts/multi-inheritance/data/BaseOne.approval.teal new file mode 100644 index 0000000..93e1908 --- /dev/null +++ b/tests/artifacts/multi-inheritance/data/BaseOne.approval.teal @@ -0,0 +1,84 @@ +#pragma version 10 +#pragma typetrack false + +// @algorandfoundation/algorand-typescript/arc4/index.d.ts::Contract.approvalProgram() -> uint64: +main: + intcblock 1 + bytecblock 0x151f7c750006636f6d6d6f6e + txn ApplicationID + bnz main_after_if_else@2 + // tests/artifacts/multi-inheritance/contract.algo.ts:6 + // stateCommon = GlobalState({ initialValue: 123 }) + pushbytes "stateCommon" + pushint 123 // 123 + app_global_put + // tests/artifacts/multi-inheritance/contract.algo.ts:18 + // stateOne = GlobalState({ initialValue: Uint64(45) }) + pushbytes "stateOne" + pushint 45 // 45 + app_global_put + +main_after_if_else@2: + // tests/artifacts/multi-inheritance/contract.algo.ts:17 + // export class BaseOne extends CommonBase { + txn NumAppArgs + bz main_bare_routing@10 + pushbytess 0xc32533e3 0x455c8d09 0xf9f5142c // method "methodOne()string", method "methodCommon()string", method "b2CantOverride()string" + txna ApplicationArgs 0 + match main_methodOne_route@5 main_methodCommon_route@6 main_b2CantOverride_route@7 + +main_after_if_else@14: + // tests/artifacts/multi-inheritance/contract.algo.ts:17 + // export class BaseOne extends CommonBase { + pushint 0 // 0 + return + +main_b2CantOverride_route@7: + // tests/artifacts/multi-inheritance/contract.algo.ts:12 + // b2CantOverride(): string { + txn OnCompletion + ! + assert // OnCompletion is not NoOp + txn ApplicationID + assert // can only call when not creating + bytec_0 // 0x151f7c750006636f6d6d6f6e + log + intc_0 // 1 + return + +main_methodCommon_route@6: + // tests/artifacts/multi-inheritance/contract.algo.ts:8 + // methodCommon() { + txn OnCompletion + ! + assert // OnCompletion is not NoOp + txn ApplicationID + assert // can only call when not creating + bytec_0 // 0x151f7c750006636f6d6d6f6e + log + intc_0 // 1 + return + +main_methodOne_route@5: + // tests/artifacts/multi-inheritance/contract.algo.ts:19 + // methodOne() { + txn OnCompletion + ! + assert // OnCompletion is not NoOp + txn ApplicationID + assert // can only call when not creating + pushbytes 0x151f7c750008626173652d6f6e65 + log + intc_0 // 1 + return + +main_bare_routing@10: + // tests/artifacts/multi-inheritance/contract.algo.ts:17 + // export class BaseOne extends CommonBase { + txn OnCompletion + bnz main_after_if_else@14 + txn ApplicationID + ! + assert // can only call when creating + intc_0 // 1 + return diff --git a/tests/artifacts/multi-inheritance/data/BaseOne.arc32.json b/tests/artifacts/multi-inheritance/data/BaseOne.arc32.json new file mode 100644 index 0000000..001916c --- /dev/null +++ b/tests/artifacts/multi-inheritance/data/BaseOne.arc32.json @@ -0,0 +1,85 @@ +{ + "hints": { + "methodOne()string": { + "call_config": { + "no_op": "CALL" + } + }, + "methodCommon()string": { + "call_config": { + "no_op": "CALL" + } + }, + "b2CantOverride()string": { + "call_config": { + "no_op": "CALL" + } + } + }, + "source": { + "approval": "I3ByYWdtYSB2ZXJzaW9uIDEwCiNwcmFnbWEgdHlwZXRyYWNrIGZhbHNlCgovLyBAYWxnb3JhbmRmb3VuZGF0aW9uL2FsZ29yYW5kLXR5cGVzY3JpcHQvYXJjNC9pbmRleC5kLnRzOjpDb250cmFjdC5hcHByb3ZhbFByb2dyYW0oKSAtPiB1aW50NjQ6Cm1haW46CiAgICBpbnRjYmxvY2sgMQogICAgYnl0ZWNibG9jayAweDE1MWY3Yzc1MDAwNjYzNmY2ZDZkNmY2ZQogICAgdHhuIEFwcGxpY2F0aW9uSUQKICAgIGJueiBtYWluX2FmdGVyX2lmX2Vsc2VAMgogICAgLy8gdGVzdHMvYXJ0aWZhY3RzL211bHRpLWluaGVyaXRhbmNlL2NvbnRyYWN0LmFsZ28udHM6NgogICAgLy8gc3RhdGVDb21tb24gPSBHbG9iYWxTdGF0ZTx1aW50NjQ+KHsgaW5pdGlhbFZhbHVlOiAxMjMgfSkKICAgIHB1c2hieXRlcyAic3RhdGVDb21tb24iCiAgICBwdXNoaW50IDEyMyAvLyAxMjMKICAgIGFwcF9nbG9iYWxfcHV0CiAgICAvLyB0ZXN0cy9hcnRpZmFjdHMvbXVsdGktaW5oZXJpdGFuY2UvY29udH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ICBwdXNoYnl0ZXMgMHgxNTFmN2M3NTAwMDg2MjYxNzM2NTJkNmY2ZTY1CiAgICBsb2cKICAgIGludGNfMCAvLyAxCiAgICByZXR1cm4KCm1haW5fYmFyZV9yb3V0aW5nQDEwOgogICAgLy8gdGVzdHMvYXJ0aWZhY3RzL211bHRpLWluaGVyaXRhbmNlL2NvbnRyYWN0LmFsZ28udHM6MTcKICAgIC8vIGV4cG9ydCBjbGFzcyBCYXNlT25lIGV4dGVuZHMgQ29tbW9uQmFzZSB7CiAgICB0eG4gT25Db21wbGV0aW9uCiAgICBibnogbWFpbl9hZnRlcl9pZl9lbHNlQDE0CiAgICB0eG4gQXBwbGljYXRpb25JRAogICAgIQogICAgYXNzZXJ0IC8vIGNhbiBvbmx5IGNhbGwgd2hlbiBjcmVhdGluZwogICAgaW50Y18wIC8vIDEKICAgIHJldHVybgo=", + "clear": "I3ByYWdtYSB2ZXJzaW9uIDEwCiNwcmFnbWEgdHlwZXRyYWNrIGZhbHNlCgovLyBAYWxnb3JhbmRmb3VuZGF0aW9uL2FsZ29yYW5kLXR5cGVzY3JpcHQvYmFzZS1jb250cmFjdC5kLnRzOjpCYXNlQ29udHJhY3QuY2xlYXJTdGF0ZVByb2dyYW0oKSAtPiB1aW50NjQ6Cm1haW46CiAgICBwdXNoaW50IDEgLy8gMQogICAgcmV0dXJuCg==" + }, + "state": { + "global": { + "num_byte_slices": 0, + "num_uints": 2 + }, + "local": { + "num_byte_slices": 0, + "num_uints": 0 + } + }, + "schema": { + "global": { + "declared": { + "stateCommon": { + "type": "uint64", + "key": "stateCommon" + }, + "stateOne": { + "type": "uint64", + "key": "stateOne" + } + }, + "reserved": {} + }, + "local": { + "declared": {}, + "reserved": {} + } + }, + "contract": { + "name": "BaseOne", + "methods": [ + { + "name": "methodOne", + "args": [], + "readonly": false, + "returns": { + "type": "string" + } + }, + { + "name": "methodCommon", + "args": [], + "readonly": false, + "returns": { + "type": "string" + } + }, + { + "name": "b2CantOverride", + "args": [], + "readonly": false, + "returns": { + "type": "string" + } + } + ], + "networks": {} + }, + "bare_call_config": { + "no_op": "CREATE" + } +} \ No newline at end of file diff --git a/tests/artifacts/multi-inheritance/data/BaseOne.arc56.json b/tests/artifacts/multi-inheritance/data/BaseOne.arc56.json new file mode 100644 index 0000000..9802627 --- /dev/null +++ b/tests/artifacts/multi-inheritance/data/BaseOne.arc56.json @@ -0,0 +1,149 @@ +{ + "name": "BaseOne", + "structs": {}, + "methods": [ + { + "name": "methodOne", + "args": [], + "returns": { + "type": "string" + }, + "actions": { + "create": [], + "call": [ + "NoOp" + ] + }, + "readonly": false, + "events": [], + "recommendations": {} + }, + { + "name": "methodCommon", + "args": [], + "returns": { + "type": "string" + }, + "actions": { + "create": [], + "call": [ + "NoOp" + ] + }, + "readonly": false, + "events": [], + "recommendations": {} + }, + { + "name": "b2CantOverride", + "args": [], + "returns": { + "type": "string" + }, + "actions": { + "create": [], + "call": [ + "NoOp" + ] + }, + "readonly": false, + "events": [], + "recommendations": {} + } + ], + "arcs": [ + 22, + 28 + ], + "networks": {}, + "state": { + "schema": { + "global": { + "ints": 2, + "bytes": 0 + }, + "local": { + "ints": 0, + "bytes": 0 + } + }, + "keys": { + "global": { + "stateOne": { + "keyType": "AVMString", + "valueType": "AVMUint64", + "key": "c3RhdGVPbmU=" + }, + "stateCommon": { + "keyType": "AVMString", + "valueType": "AVMUint64", + "key": "c3RhdGVDb21tb24=" + } + }, + "local": {}, + "box": {} + }, + "maps": { + "global": {}, + "local": {}, + "box": {} + } + }, + "bareActions": { + "create": [ + "NoOp" + ], + "call": [] + }, + "sourceInfo": { + "approval": { + "sourceInfo": [ + { + "pc": [ + 92, + 103, + 114 + ], + "errorMessage": "OnCompletion is not NoOp" + }, + { + "pc": [ + 145 + ], + "errorMessage": "can only call when creating" + }, + { + "pc": [ + 95, + 106, + 117 + ], + "errorMessage": "can only call when not creating" + } + ], + "pcOffsetMethod": "none" + }, + "clear": { + "sourceInfo": [], + "pcOffsetMethod": "none"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C8vIGNhbiBvbmx5IGNhbGwgd2hlbiBjcmVhdGluZwogICAgaW50Y18wIC8vIDEKICAgIHJldHVybgo=", + "clear": "I3ByYWdtYSB2ZXJzaW9uIDEwCiNwcmFnbWEgdHlwZXRyYWNrIGZhbHNlCgovLyBAYWxnb3JhbmRmb3VuZGF0aW9uL2FsZ29yYW5kLXR5cGVzY3JpcHQvYmFzZS1jb250cmFjdC5kLnRzOjpCYXNlQ29udHJhY3QuY2xlYXJTdGF0ZVByb2dyYW0oKSAtPiB1aW50NjQ6Cm1haW46CiAgICBwdXNoaW50IDEgLy8gMQogICAgcmV0dXJuCg==" + }, + "byteCode": { + "approval": "CiABASYBDBUffHUABmNvbW1vbjEYQAAdgAtzdGF0ZUNvbW1vboF7Z4AIc3RhdGVPbmWBLWcxG0EAT4IDBMMlM+MERVyNCQT59RQsNhoAjgMAGQAOAAOBAEMxGRREMRhEKLAiQzEZFEQxGEQosCJDMRkURDEYRIAOFR98dQAIYmFzZS1vbmWwIkMxGUD/yDEYFEQiQw==", + "clear": "CoEBQw==" + }, + "compilerInfo": { + "compiler": "puya", + "compilerVersion": { + "major": 4, + "minor": 1, + "patch": 1 + } + }, + "events": [], + "templateVariables": {} +} \ No newline at end of file diff --git a/tests/artifacts/multi-inheritance/data/BaseOne.clear.teal b/tests/artifacts/multi-inheritance/data/BaseOne.clear.teal new file mode 100644 index 0000000..a4d5804 --- /dev/null +++ b/tests/artifacts/multi-inheritance/data/BaseOne.clear.teal @@ -0,0 +1,7 @@ +#pragma version 10 +#pragma typetrack false + +// @algorandfoundation/algorand-typescript/base-contract.d.ts::BaseContract.clearStateProgram() -> uint64: +main: + pushint 1 // 1 + return diff --git a/tests/artifacts/multi-inheritance/data/BaseTwo.approval.teal b/tests/artifacts/multi-inheritance/data/BaseTwo.approval.teal new file mode 100644 index 0000000..8d9796b --- /dev/null +++ b/tests/artifacts/multi-inheritance/data/BaseTwo.approval.teal @@ -0,0 +1,83 @@ +#pragma version 10 +#pragma typetrack false + +// @algorandfoundation/algorand-typescript/arc4/index.d.ts::Contract.approvalProgram() -> uint64: +main: + intcblock 1 + bytecblock 0x151f7c750008626173652d74776f + txn ApplicationID + bnz main_after_if_else@2 + // tests/artifacts/multi-inheritance/contract.algo.ts:6 + // stateCommon = GlobalState({ initialValue: 123 }) + pushbytes "stateCommon" + pushint 123 // 123 + app_global_put + // tests/artifacts/multi-inheritance/contract.algo.ts:25 + // stateTwo = GlobalState({ initialValue: 'Hello' }) + pushbytess "stateTwo" "Hello" // "stateTwo", "Hello" + app_global_put + +main_after_if_else@2: + // tests/artifacts/multi-inheritance/contract.algo.ts:24 + // export class BaseTwo extends CommonBase { + txn NumAppArgs + bz main_bare_routing@10 + pushbytess 0x363b329e 0xf9f5142c 0x455c8d09 // method "methodTwo()string", method "b2CantOverride()string", method "methodCommon()string" + txna ApplicationArgs 0 + match main_methodTwo_route@5 main_b2CantOverride_route@6 main_methodCommon_route@7 + +main_after_if_else@14: + // tests/artifacts/multi-inheritance/contract.algo.ts:24 + // export class BaseTwo extends CommonBase { + pushint 0 // 0 + return + +main_methodCommon_route@7: + // tests/artifacts/multi-inheritance/contract.algo.ts:8 + // methodCommon() { + txn OnCompletion + ! + assert // OnCompletion is not NoOp + txn ApplicationID + assert // can only call when not creating + pushbytes 0x151f7c750006636f6d6d6f6e + log + intc_0 // 1 + return + +main_b2CantOverride_route@6: + // tests/artifacts/multi-inheritance/contract.algo.ts:35 + // b2CantOverride(): string { + txn OnCompletion + ! + assert // OnCompletion is not NoOp + txn ApplicationID + assert // can only call when not creating + bytec_0 // 0x151f7c750008626173652d74776f + log + intc_0 // 1 + return + +main_methodTwo_route@5: + // tests/artifacts/multi-inheritance/contract.algo.ts:26 + // methodTwo() { + txn OnCompletion + ! + assert // OnCompletion is not NoOp + txn ApplicationID + assert // can only call when not creating + bytec_0 // 0x151f7c750008626173652d74776f + log + intc_0 // 1 + return + +main_bare_routing@10: + // tests/artifacts/multi-inheritance/contract.algo.ts:24 + // export class BaseTwo extends CommonBase { + txn OnCompletion + bnz main_after_if_else@14 + txn ApplicationID + ! + assert // can only call when creating + intc_0 // 1 + return diff --git a/tests/artifacts/multi-inheritance/data/BaseTwo.arc32.json b/tests/artifacts/multi-inheritance/data/BaseTwo.arc32.json new file mode 100644 index 0000000..36e5893 --- /dev/null +++ b/tests/artifacts/multi-inheritance/data/BaseTwo.arc32.json @@ -0,0 +1,86 @@ +{ + "hints": { + "methodTwo()string": { + "call_config": { + "no_op": "CALL" + } + }, + "b2CantOverride()string": { + "call_config": { + "no_op": "CALL" + } + }, + "methodCommon()string": { + "call_config": { + "no_op": "CALL" + } + } + }, + "source": { + "approval": "I3ByYWdtYSB2ZXJzaW9uIDEwCiNwcmFnbWEgdHlwZXRyYWNrIGZhbHNlCgovLyBAYWxnb3JhbmRmb3VuZGF0aW9uL2FsZ29yYW5kLXR5cGVzY3JpcHQvYXJjNC9pbmRleC5kLnRzOjpDb250cmFjdC5hcHByb3ZhbFByb2dyYW0oKSAtPiB1aW50NjQ6Cm1haW46CiAgICBpbnRjYmxvY2sgMQogICAgYnl0ZWNibG9jayAweDE1MWY3Yzc1MDAwODYyNjE3MzY1MmQ3NDc3NmYKICAgIHR4biBBcHBsaWNhdGlvbklECiAgICBibnogbWFpbl9hZnRlcl9pZl9lbHNlQDIKICAgIC8vIHRlc3RzL2FydGlmYWN0cy9tdWx0aS1pbmhlcml0YW5jZS9jb250cmFjdC5hbGdvLnRzOjYKICAgIC8vIHN0YXRlQ29tbW9uID0gR2xvYmFsU3RhdGU8dWludDY0Pih7IGluaXRpYWxWYWx1ZTogMTIzIH0pCiAgICBwdXNoYnl0ZXMgInN0YXRlQ29tbW9uIgogICAgcHVzaGludCAxMjMgLy8gMTIzCiAgICBhcHBfZ2xvYmFsX3B1dAogICAgLy8gdGVzdHMvYXJ0aWZhY3RzL211bHRpLWluaGVyaXRhbmNlL2NvbnRyYWN0LmFsZ28udHM6MjUKICAgIC8vIHN0YXRlVHdvID0gR2xvYmFsU3R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jI2MTczNjUyZDc0Nzc2ZgogICAgbG9nCiAgICBpbnRjXzAgLy8gMQogICAgcmV0dXJuCgptYWluX2JhcmVfcm91dGluZ0AxMDoKICAgIC8vIHRlc3RzL2FydGlmYWN0cy9tdWx0aS1pbmhlcml0YW5jZS9jb250cmFjdC5hbGdvLnRzOjI0CiAgICAvLyBleHBvcnQgY2xhc3MgQmFzZVR3byBleHRlbmRzIENvbW1vbkJhc2UgewogICAgdHhuIE9uQ29tcGxldGlvbgogICAgYm56IG1haW5fYWZ0ZXJfaWZfZWxzZUAxNAogICAgdHhuIEFwcGxpY2F0aW9uSUQKICAgICEKICAgIGFzc2VydCAvLyBjYW4gb25seSBjYWxsIHdoZW4gY3JlYXRpbmcKICAgIGludGNfMCAvLyAxCiAgICByZXR1cm4K", + "clear": "I3ByYWdtYSB2ZXJzaW9uIDEwCiNwcmFnbWEgdHlwZXRyYWNrIGZhbHNlCgovLyBAYWxnb3JhbmRmb3VuZGF0aW9uL2FsZ29yYW5kLXR5cGVzY3JpcHQvYmFzZS1jb250cmFjdC5kLnRzOjpCYXNlQ29udHJhY3QuY2xlYXJTdGF0ZVByb2dyYW0oKSAtPiB1aW50NjQ6Cm1haW46CiAgICBwdXNoaW50IDEgLy8gMQogICAgcmV0dXJuCg==" + }, + "state": { + "global": { + "num_byte_slices": 1, + "num_uints": 1 + }, + "local": { + "num_byte_slices": 0, + "num_uints": 0 + } + }, + "schema": { + "global": { + "declared": { + "stateCommon": { + "type": "uint64", + "key": "stateCommon" + }, + "stateTwo": { + "type": "bytes", + "key": "stateTwo" + } + }, + "reserved": {} + }, + "local": { + "declared": {}, + "reserved": {} + } + }, + "contract": { + "name": "BaseTwo", + "methods": [ + { + "name": "methodTwo", + "args": [], + "readonly": false, + "returns": { + "type": "string" + } + }, + { + "name": "b2CantOverride", + "args": [], + "readonly": false, + "returns": { + "type": "string" + }, + "desc": "Because CommonBase implements this method, and MRO for polytype is depth first; this method\nshould not be accessible from MultiBases as the MRO should be `BaseOne => CommonBase => BaseTwo => CommonBase`\nand since CommonBase provides an implementation, this one should not be used" + }, + { + "name": "methodCommon", + "args": [], + "readonly": false, + "returns": { + "type": "string" + } + } + ], + "networks": {} + }, + "bare_call_config": { + "no_op": "CREATE" + } +} \ No newline at end of file diff --git a/tests/artifacts/multi-inheritance/data/BaseTwo.arc56.json b/tests/artifacts/multi-inheritance/data/BaseTwo.arc56.json new file mode 100644 index 0000000..d11a57d --- /dev/null +++ b/tests/artifacts/multi-inheritance/data/BaseTwo.arc56.json @@ -0,0 +1,150 @@ +{ + "name": "BaseTwo", + "structs": {}, + "methods": [ + { + "name": "methodTwo", + "args": [], + "returns": { + "type": "string" + }, + "actions": { + "create": [], + "call": [ + "NoOp" + ] + }, + "readonly": false, + "events": [], + "recommendations": {} + }, + { + "name": "b2CantOverride", + "args": [], + "returns": { + "type": "string" + }, + "actions": { + "create": [], + "call": [ + "NoOp" + ] + }, + "readonly": false, + "desc": "Because CommonBase implements this method, and MRO for polytype is depth first; this method\nshould not be accessible from MultiBases as the MRO should be `BaseOne => CommonBase => BaseTwo => CommonBase`\nand since CommonBase provides an implementation, this one should not be used", + "events": [], + "recommendations": {} + }, + { + "name": "methodCommon", + "args": [], + "returns": { + "type": "string" + }, + "actions": { + "create": [], + "call": [ + "NoOp" + ] + }, + "readonly": false, + "events": [], + "recommendations": {} + } + ], + "arcs": [ + 22, + 28 + ], + "networks": {}, + "state": { + "schema": { + "global": { + "ints": 1, + "bytes": 1 + }, + "local": { + "ints": 0, + "bytes": 0 + } + }, + "keys": { + "global": { + "stateTwo": { + "keyType": "AVMString", + "valueType": "AVMString", + "key": "c3RhdGVUd28=" + }, + "stateCommon": { + "keyType": "AVMString", + "valueType": "AVMUint64", + "key": "c3RhdGVDb21tb24=" + } + }, + "local": {}, + "box": {} + }, + "maps": { + "global": {}, + "local": {}, + "box": {} + } + }, + "bareActions": { + "create": [ + "NoOp" + ], + "call": [] + }, + "sourceInfo": { + "approval": { + "sourceInfo": [ + { + "pc": [ + 99, + 123, + 134 + ], + "errorMessage": "OnCompletion is not NoOp" + }, + { + "pc": [ + 150 + ], + "errorMessage": "can only call when creating" + }, + { + "pc": [ + 102, + 126, + 137 + ], + "errorMessage": "can only call when not creating" + } + ], + "pcOffsetMethod": "none" + }, + "clear": { + "sourceInfo": [], + "pcOffsetMethod": "none" + } + }, + "source": { + "approval": "I3ByYWdtYSB2ZXJzaW9uIDEwCiNwcmFnbWEgdHlwZXRyYWNrIGZhbHNlCgovLyBAYWxnb3JhbmRmb3VuZGF0aW9uL2FsZ29yYW5kLXR5cGVzY3JpcHQvYXJjNC9pbmRleC5kLnRzOjpDb250cmFjdC5hcHByb3ZhbFByb2dyYW0oKSAtPiB1aW50NjQ6Cm1haW46CiAgICBpbnRjYmxvY2sgMQogICAgYnl0ZWNibG9jayAweDE1MWY3Yzc1MDAwODYyNjE3MzY1MmQ3NDc3NmYKICAgIHR4biBBcHBsaWNhdGlvbklECiAgICBibnogbWFpbl9hZnRlcl9pZl9lbHNlQDIKICAgIC8vIHRlc3RzL2FydGlmYWN0cy9tdWx0aS1pbmhlcml0YW5jZS9jb250cmFjdC5hbGdvLnRzOjYKICAgIC8vIHN0YXRlQ29tbW9uID0gR2xvYmFsU3RhdGU8dWludDY0Pih7IGluaXRpYWxWYWx1ZTogMTIzIH0pCiAgICBwdXNoYnl0ZXMgInN0YXRlQ29tbW9uIgogICAgcHVzaGludCAxMjMgLy8gMTIzCiAgICBhcHBfZ2xvYmFsX3B1dAogICAgLy8gdGVzdHMvYXJ0aWZhY3RzL211bHRpLWluaGVyaXRhbmNlL2NvbnRyYWN0LmFsZ28udHM6MjUKICAgIC8vIHN0YXRlVHdvID0gR2xvYmFsU3RhdGUoeyBpbml0aWFsVmFsdWU6ICdIZWxsbycgfSkKICAgIHB1c2hieXRlc3MgInN0YXRlVHdvIiAiSGVsbG8iIC8vICJzdGF0ZVR3byIsICJIZWxsbyIKICAgIGFwcF9nbG9iYWxfcHV0CgptYWluX2FmdGVy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cmFjdC5hbGdvLnRzOjI0CiAgICAvLyBleHBvcnQgY2xhc3MgQmFzZVR3byBleHRlbmRzIENvbW1vbkJhc2UgewogICAgdHhuIE9uQ29tcGxldGlvbgogICAgYm56IG1haW5fYWZ0ZXJfaWZfZWxzZUAxNAogICAgdHhuIEFwcGxpY2F0aW9uSUQKICAgICEKICAgIGFzc2VydCAvLyBjYW4gb25seSBjYWxsIHdoZW4gY3JlYXRpbmcKICAgIGludGNfMCAvLyAxCiAgICByZXR1cm4K", + "clear": "I3ByYWdtYSB2ZXJzaW9uIDEwCiNwcmFnbWEgdHlwZXRyYWNrIGZhbHNlCgovLyBAYWxnb3JhbmRmb3VuZGF0aW9uL2FsZ29yYW5kLXR5cGVzY3JpcHQvYmFzZS1jb250cmFjdC5kLnRzOjpCYXNlQ29udHJhY3QuY2xlYXJTdGF0ZVByb2dyYW0oKSAtPiB1aW50NjQ6Cm1haW46CiAgICBwdXNoaW50IDEgLy8gMQogICAgcmV0dXJuCg==" + }, + "byteCode": { + "approval": "CiABASYBDhUffHUACGJhc2UtdHdvMRhAACKAC3N0YXRlQ29tbW9ugXtnggIIc3RhdGVUd28FSGVsbG9nMRtBAE2CAwQ2OzKeBPn1FCwERVyNCTYaAI4DACYAGwADgQBDMRkURDEYRIAMFR98dQAGY29tbW9usCJDMRkURDEYRCiwIkMxGRREMRhEKLAiQzEZQP/KMRgURCJD", + "clear": "CoEBQw==" + }, + "compilerInfo": { + "compiler": "puya", + "compilerVersion": { + "major": 4, + "minor": 1, + "patch": 1 + } + }, + "events": [], + "templateVariables": {} +} \ No newline at end of file diff --git a/tests/artifacts/multi-inheritance/data/BaseTwo.clear.teal b/tests/artifacts/multi-inheritance/data/BaseTwo.clear.teal new file mode 100644 index 0000000..a4d5804 --- /dev/null +++ b/tests/artifacts/multi-inheritance/data/BaseTwo.clear.teal @@ -0,0 +1,7 @@ +#pragma version 10 +#pragma typetrack false + +// @algorandfoundation/algorand-typescript/base-contract.d.ts::BaseContract.clearStateProgram() -> uint64: +main: + pushint 1 // 1 + return diff --git a/tests/artifacts/multi-inheritance/data/CommonBase.approval.teal b/tests/artifacts/multi-inheritance/data/CommonBase.approval.teal new file mode 100644 index 0000000..b9df43c --- /dev/null +++ b/tests/artifacts/multi-inheritance/data/CommonBase.approval.teal @@ -0,0 +1,65 @@ +#pragma version 10 +#pragma typetrack false + +// @algorandfoundation/algorand-typescript/arc4/index.d.ts::Contract.approvalProgram() -> uint64: +main: + bytecblock 0x151f7c750006636f6d6d6f6e + txn ApplicationID + bnz main_after_if_else@2 + // tests/artifacts/multi-inheritance/contract.algo.ts:6 + // stateCommon = GlobalState({ initialValue: 123 }) + pushbytes "stateCommon" + pushint 123 // 123 + app_global_put + +main_after_if_else@2: + // tests/artifacts/multi-inheritance/contract.algo.ts:5 + // export class CommonBase extends Contract { + txn NumAppArgs + bz main_bare_routing@9 + pushbytess 0x455c8d09 0xf9f5142c // method "methodCommon()string", method "b2CantOverride()string" + txna ApplicationArgs 0 + match main_methodCommon_route@5 main_b2CantOverride_route@6 + +main_after_if_else@13: + // tests/artifacts/multi-inheritance/contract.algo.ts:5 + // export class CommonBase extends Contract { + pushint 0 // 0 + return + +main_b2CantOverride_route@6: + // tests/artifacts/multi-inheritance/contract.algo.ts:12 + // b2CantOverride(): string { + txn OnCompletion + ! + assert // OnCompletion is not NoOp + txn ApplicationID + assert // can only call when not creating + bytec_0 // 0x151f7c750006636f6d6d6f6e + log + pushint 1 // 1 + return + +main_methodCommon_route@5: + // tests/artifacts/multi-inheritance/contract.algo.ts:8 + // methodCommon() { + txn OnCompletion + ! + assert // OnCompletion is not NoOp + txn ApplicationID + assert // can only call when not creating + bytec_0 // 0x151f7c750006636f6d6d6f6e + log + pushint 1 // 1 + return + +main_bare_routing@9: + // tests/artifacts/multi-inheritance/contract.algo.ts:5 + // export class CommonBase extends Contract { + txn OnCompletion + bnz main_after_if_else@13 + txn ApplicationID + ! + assert // can only call when creating + pushint 1 // 1 + return diff --git a/tests/artifacts/multi-inheritance/data/CommonBase.arc32.json b/tests/artifacts/multi-inheritance/data/CommonBase.arc32.json new file mode 100644 index 0000000..773b9c6 --- /dev/null +++ b/tests/artifacts/multi-inheritance/data/CommonBase.arc32.json @@ -0,0 +1,68 @@ +{ + "hints": { + "methodCommon()string": { + "call_config": { + "no_op": "CALL" + } + }, + "b2CantOverride()string": { + "call_config": { + "no_op": "CALL" + } + } + }, + "source": { + "approval": "I3ByYWdtYSB2ZXJzaW9uIDEwCiNwcmFnbWEgdHlwZXRyYWNrIGZhbHNlCgovLyBAYWxnb3JhbmRmb3VuZGF0aW9uL2FsZ29yYW5kLXR5cGVzY3JpcHQvYXJjNC9pbmRleC5kLnRzOjpDb250cmFjdC5hcHByb3ZhbFByb2dyYW0oKSAtPiB1aW50NjQ6Cm1haW46CiAgICBieXRlY2Jsb2NrIDB4MTUxZjdjNzUwMDA2NjM2ZjZkNmQ2ZjZlCiAgICB0eG4gQXBwbGljYXRpb25JRAogICAgYm56IG1haW5fYWZ0ZXJfaWZfZWxzZUAyCiAgICAvLyB0ZXN0cy9hcnRpZmFjdHMvbXVsdGktaW5oZXJpdGFuY2UvY29udHJhY3QuYWxnby50czo2CiAgICAvLyBzdGF0ZUNvbW1vbiA9IEdsb2JhbFN0YXRlPHVpbnQ2ND4oeyBpbml0aWFsVmFsdWU6IDEyMyB9KQogICAgcHVzaGJ5dGVzICJzdGF0ZUNvbW1vbiIKICAgIHB1c2hpbnQgMTIzIC8vIDEyMwogICAgYXBwX2dsb2JhbF9wdXQKCm1haW5fYWZ0ZXJfaWZfZWxzZUAyOgogICAgLy8gdGVzdHMvYXJ0aWZhY3RzL211bHRpLWluaGVyaXRhbmNlL2NvbnRyYWN0LmFsZ28udHM6NQogICAgLy8gZXhwb3J0IGNsYXNzIENvbW1vbkJhc2UgZXh0ZW5kcyBDb250cmFjdCB7CiAgICB0eG4gTnVtQXBwQXJncwogICAgYnogbWFpbl9iYXJlX3JvdXRpbmdAOQogICAgcHVzaGJ5dGV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AgICAhCiAgICBhc3NlcnQgLy8gT25Db21wbGV0aW9uIGlzIG5vdCBOb09wCiAgICB0eG4gQXBwbGljYXRpb25JRAogICAgYXNzZXJ0IC8vIGNhbiBvbmx5IGNhbGwgd2hlbiBub3QgY3JlYXRpbmcKICAgIGJ5dGVjXzAgLy8gMHgxNTFmN2M3NTAwMDY2MzZmNmQ2ZDZmNmUKICAgIGxvZwogICAgcHVzaGludCAxIC8vIDEKICAgIHJldHVybgoKbWFpbl9iYXJlX3JvdXRpbmdAOToKICAgIC8vIHRlc3RzL2FydGlmYWN0cy9tdWx0aS1pbmhlcml0YW5jZS9jb250cmFjdC5hbGdvLnRzOjUKICAgIC8vIGV4cG9ydCBjbGFzcyBDb21tb25CYXNlIGV4dGVuZHMgQ29udHJhY3QgewogICAgdHhuIE9uQ29tcGxldGlvbgogICAgYm56IG1haW5fYWZ0ZXJfaWZfZWxzZUAxMwogICAgdHhuIEFwcGxpY2F0aW9uSUQKICAgICEKICAgIGFzc2VydCAvLyBjYW4gb25seSBjYWxsIHdoZW4gY3JlYXRpbmcKICAgIHB1c2hpbnQgMSAvLyAxCiAgICByZXR1cm4K", + "clear": "I3ByYWdtYSB2ZXJzaW9uIDEwCiNwcmFnbWEgdHlwZXRyYWNrIGZhbHNlCgovLyBAYWxnb3JhbmRmb3VuZGF0aW9uL2FsZ29yYW5kLXR5cGVzY3JpcHQvYmFzZS1jb250cmFjdC5kLnRzOjpCYXNlQ29udHJhY3QuY2xlYXJTdGF0ZVByb2dyYW0oKSAtPiB1aW50NjQ6Cm1haW46CiAgICBwdXNoaW50IDEgLy8gMQogICAgcmV0dXJuCg==" + }, + "state": { + "global": { + "num_byte_slices": 0, + "num_uints": 1 + }, + "local": { + "num_byte_slices": 0, + "num_uints": 0 + } + }, + "schema": { + "global": { + "declared": { + "stateCommon": { + "type": "uint64", + "key": "stateCommon" + } + }, + "reserved": {} + }, + "local": { + "declared": {}, + "reserved": {} + } + }, + "contract": { + "name": "CommonBase", + "methods": [ + { + "name": "methodCommon", + "args": [], + "readonly": false, + "returns": { + "type": "string" + } + }, + { + "name": "b2CantOverride", + "args": [], + "readonly": false, + "returns": { + "type": "string" + } + } + ], + "networks": {} + }, + "bare_call_config": { + "no_op": "CREATE" + } +} \ No newline at end of file diff --git a/tests/artifacts/multi-inheritance/data/CommonBase.arc56.json b/tests/artifacts/multi-inheritance/data/CommonBase.arc56.json new file mode 100644 index 0000000..e9c1db1 --- /dev/null +++ b/tests/artifacts/multi-inheritance/data/CommonBase.arc56.json @@ -0,0 +1,126 @@ +{ + "name": "CommonBase", + "structs": {}, + "methods": [ + { + "name": "methodCommon", + "args": [], + "returns": { + "type": "string" + }, + "actions": { + "create": [], + "call": [ + "NoOp" + ] + }, + "readonly": false, + "events": [], + "recommendations": {} + }, + { + "name": "b2CantOverride", + "args": [], + "returns": { + "type": "string" + }, + "actions": { + "create": [], + "call": [ + "NoOp" + ] + }, + "readonly": false, + "events": [], + "recommendations": {} + } + ], + "arcs": [ + 22, + 28 + ], + "networks": {}, + "state": { + "schema": { + "global": { + "ints": 1, + "bytes": 0 + }, + "local": { + "ints": 0, + "bytes": 0 + } + }, + "keys": { + "global": { + "stateCommon": { + "keyType": "AVMString", + "valueType": "AVMUint64", + "key": "c3RhdGVDb21tb24=" + } + }, + "local": {}, + "box": {} + }, + "maps": { + "global": {}, + "local": {}, + "box": {} + } + }, + "bareActions": { + "create": [ + "NoOp" + ], + "call": [] + }, + "sourceInfo": { + "approval": { + "sourceInfo": [ + { + "pc": [ + 69, + 81 + ], + "errorMessage": "OnCompletion is not NoOp" + }, + { + "pc": [ + 98 + ], + "errorMessage": "can only call when creating" + }, + { + "pc": [ + 72, + 84 + ], + "errorMessage": "can only call when not creating" + } + ], + "pcOffsetMethod": "none" + }, + "clear": { + "sourceInfo": [], + "pcOffsetMethod": "none" + } + }, + "source": { + "approval": "I3ByYWdtYSB2ZXJzaW9uIDEwCiNwcmFnbWEgdHlwZXRyYWNrIGZhbHNlCgovLyBAYW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ydGlmYWN0cy9tdWx0aS1pbmhlcml0YW5jZS9jb250cmFjdC5hbGdvLnRzOjUKICAgIC8vIGV4cG9ydCBjbGFzcyBDb21tb25CYXNlIGV4dGVuZHMgQ29udHJhY3QgewogICAgdHhuIE9uQ29tcGxldGlvbgogICAgYm56IG1haW5fYWZ0ZXJfaWZfZWxzZUAxMwogICAgdHhuIEFwcGxpY2F0aW9uSUQKICAgICEKICAgIGFzc2VydCAvLyBjYW4gb25seSBjYWxsIHdoZW4gY3JlYXRpbmcKICAgIHB1c2hpbnQgMSAvLyAxCiAgICByZXR1cm4K", + "clear": "I3ByYWdtYSB2ZXJzaW9uIDEwCiNwcmFnbWEgdHlwZXRyYWNrIGZhbHNlCgovLyBAYWxnb3JhbmRmb3VuZGF0aW9uL2FsZ29yYW5kLXR5cGVzY3JpcHQvYmFzZS1jb250cmFjdC5kLnRzOjpCYXNlQ29udHJhY3QuY2xlYXJTdGF0ZVByb2dyYW0oKSAtPiB1aW50NjQ6Cm1haW46CiAgICBwdXNoaW50IDEgLy8gMQogICAgcmV0dXJuCg==" + }, + "byteCode": { + "approval": "CiYBDBUffHUABmNvbW1vbjEYQAAQgAtzdGF0ZUNvbW1vboF7ZzEbQQAwggIERVyNCQT59RQsNhoAjgIADwADgQBDMRkURDEYRCiwgQFDMRkURDEYRCiwgQFDMRlA/+AxGBREgQFD", + "clear": "CoEBQw==" + }, + "compilerInfo": { + "compiler": "puya", + "compilerVersion": { + "major": 4, + "minor": 1, + "patch": 1 + } + }, + "events": [], + "templateVariables": {} +} \ No newline at end of file diff --git a/tests/artifacts/multi-inheritance/data/CommonBase.clear.teal b/tests/artifacts/multi-inheritance/data/CommonBase.clear.teal new file mode 100644 index 0000000..a4d5804 --- /dev/null +++ b/tests/artifacts/multi-inheritance/data/CommonBase.clear.teal @@ -0,0 +1,7 @@ +#pragma version 10 +#pragma typetrack false + +// @algorandfoundation/algorand-typescript/base-contract.d.ts::BaseContract.clearStateProgram() -> uint64: +main: + pushint 1 // 1 + return diff --git a/tests/artifacts/multi-inheritance/data/MultiBases.approval.teal b/tests/artifacts/multi-inheritance/data/MultiBases.approval.teal new file mode 100644 index 0000000..2124dd2 --- /dev/null +++ b/tests/artifacts/multi-inheritance/data/MultiBases.approval.teal @@ -0,0 +1,162 @@ +#pragma version 10 +#pragma typetrack false + +// @algorandfoundation/algorand-typescript/arc4/index.d.ts::Contract.approvalProgram() -> uint64: +main: + intcblock 1 123 + bytecblock 0x151f7c750008626173652d74776f 0x151f7c750006636f6d6d6f6e "stateCommon" + txn ApplicationID + bnz main_after_if_else@2 + // tests/artifacts/multi-inheritance/contract.algo.ts:6 + // stateCommon = GlobalState({ initialValue: 123 }) + bytec_2 // "stateCommon" + intc_1 // 123 + app_global_put + // tests/artifacts/multi-inheritance/contract.algo.ts:18 + // stateOne = GlobalState({ initialValue: Uint64(45) }) + pushbytes "stateOne" + pushint 45 // 45 + app_global_put + // tests/artifacts/multi-inheritance/contract.algo.ts:6 + // stateCommon = GlobalState({ initialValue: 123 }) + bytec_2 // "stateCommon" + intc_1 // 123 + app_global_put + // tests/artifacts/multi-inheritance/contract.algo.ts:25 + // stateTwo = GlobalState({ initialValue: 'Hello' }) + pushbytess "stateTwo" "Hello" // "stateTwo", "Hello" + app_global_put + // tests/artifacts/multi-inheritance/contract.algo.ts:41 + // stateMulti = GlobalState({ initialValue: 'Hmmm' }) + pushbytess "stateMulti" "Hmmm" // "stateMulti", "Hmmm" + app_global_put + +main_after_if_else@2: + // tests/artifacts/multi-inheritance/contract.algo.ts:40 + // export class MultiBases extends classes(BaseOne, BaseTwo) { + txn NumAppArgs + bz main_bare_routing@15 + pushbytess 0x290eba9f 0x839d96ff 0xa978ca56 0x88547eb8 0xc32533e3 0x455c8d09 0xf9f5142c 0x363b329e // method "methodMulti()string", method "methodCallsSuper()string", method "callB2CantOverride()string", method "callB2Common()string", method "methodOne()string", method "methodCommon()string", method "b2CantOverride()string", method "methodTwo()string" + txna ApplicationArgs 0 + match main_methodMulti_route@5 main_methodCallsSuper_route@6 main_callB2CantOverride_route@7 main_callB2Common_route@8 main_methodOne_route@9 main_methodCommon_route@10 main_b2CantOverride_route@11 main_methodTwo_route@12 + +main_after_if_else@19: + // tests/artifacts/multi-inheritance/contract.algo.ts:40 + // export class MultiBases extends classes(BaseOne, BaseTwo) { + pushint 0 // 0 + return + +main_methodTwo_route@12: + // tests/artifacts/multi-inheritance/contract.algo.ts:26 + // methodTwo() { + txn OnCompletion + ! + assert // OnCompletion is not NoOp + txn ApplicationID + assert // can only call when not creating + bytec_0 // 0x151f7c750008626173652d74776f + log + intc_0 // 1 + return + +main_b2CantOverride_route@11: + // tests/artifacts/multi-inheritance/contract.algo.ts:12 + // b2CantOverride(): string { + txn OnCompletion + ! + assert // OnCompletion is not NoOp + txn ApplicationID + assert // can only call when not creating + bytec_1 // 0x151f7c750006636f6d6d6f6e + log + intc_0 // 1 + return + +main_methodCommon_route@10: + // tests/artifacts/multi-inheritance/contract.algo.ts:8 + // methodCommon() { + txn OnCompletion + ! + assert // OnCompletion is not NoOp + txn ApplicationID + assert // can only call when not creating + bytec_1 // 0x151f7c750006636f6d6d6f6e + log + intc_0 // 1 + return + +main_methodOne_route@9: + // tests/artifacts/multi-inheritance/contract.algo.ts:19 + // methodOne() { + txn OnCompletion + ! + assert // OnCompletion is not NoOp + txn ApplicationID + assert // can only call when not creating + pushbytes 0x151f7c750008626173652d6f6e65 + log + intc_0 // 1 + return + +main_callB2Common_route@8: + // tests/artifacts/multi-inheritance/contract.algo.ts:55 + // callB2Common() { + txn OnCompletion + ! + assert // OnCompletion is not NoOp + txn ApplicationID + assert // can only call when not creating + bytec_1 // 0x151f7c750006636f6d6d6f6e + log + intc_0 // 1 + return + +main_callB2CantOverride_route@7: + // tests/artifacts/multi-inheritance/contract.algo.ts:51 + // callB2CantOverride() { + txn OnCompletion + ! + assert // OnCompletion is not NoOp + txn ApplicationID + assert // can only call when not creating + bytec_0 // 0x151f7c750008626173652d74776f + log + intc_0 // 1 + return + +main_methodCallsSuper_route@6: + // tests/artifacts/multi-inheritance/contract.algo.ts:47 + // methodCallsSuper() { + txn OnCompletion + ! + assert // OnCompletion is not NoOp + txn ApplicationID + assert // can only call when not creating + bytec_0 // 0x151f7c750008626173652d74776f + log + intc_0 // 1 + return + +main_methodMulti_route@5: + // tests/artifacts/multi-inheritance/contract.algo.ts:43 + // methodMulti() { + txn OnCompletion + ! + assert // OnCompletion is not NoOp + txn ApplicationID + assert // can only call when not creating + pushbytes 0x151f7c75000b6d756c74692d6261736573 + log + intc_0 // 1 + return + +main_bare_routing@15: + // tests/artifacts/multi-inheritance/contract.algo.ts:40 + // export class MultiBases extends classes(BaseOne, BaseTwo) { + txn OnCompletion + bnz main_after_if_else@19 + txn ApplicationID + ! + assert // can only call when creating + intc_0 // 1 + return diff --git a/tests/artifacts/multi-inheritance/data/MultiBases.arc32.json b/tests/artifacts/multi-inheritance/data/MultiBases.arc32.json new file mode 100644 index 0000000..2edde11 --- /dev/null +++ b/tests/artifacts/multi-inheritance/data/MultiBases.arc32.json @@ -0,0 +1,158 @@ +{ + "hints": { + "methodMulti()string": { + "call_config": { + "no_op": "CALL" + } + }, + "methodCallsSuper()string": { + "call_config": { + "no_op": "CALL" + } + }, + "callB2CantOverride()string": { + "call_config": { + "no_op": "CALL" + } + }, + "callB2Common()string": { + "call_config": { + "no_op": "CALL" + } + }, + "methodOne()string": { + "call_config": { + "no_op": "CALL" + } + }, + "methodCommon()string": { + "call_config": { + "no_op": "CALL" + } + }, + "b2CantOverride()string": { + "call_config": { + "no_op": "CALL" + } + }, + "methodTwo()string": { + "call_config": { + "no_op": "CALL" + } + } + }, + "source": { + "approval": "I3ByYWdtYSB2ZXJzaW9uIDEwCiNwcmFnbWEgdHlwZXRyYWNrIGZhbHNlCgovLyBAYWxnb3JhbmRmb3VuZGF0aW9uL2FsZ29yYW5kLXR5cGVzY3JpcHQvYXJjNC9pbmRleC5kLnRzOjpDb250cmFjdC5hcHByb3ZhbFByb2dyYW0o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NlT25lLCBCYXNlVHdvKSB7CiAgICB0eG4gT25Db21wbGV0aW9uCiAgICBibnogbWFpbl9hZnRlcl9pZl9lbHNlQDE5CiAgICB0eG4gQXBwbGljYXRpb25JRAogICAgIQogICAgYXNzZXJ0IC8vIGNhbiBvbmx5IGNhbGwgd2hlbiBjcmVhdGluZwogICAgaW50Y18wIC8vIDEKICAgIHJldHVybgo=", + "clear": "I3ByYWdtYSB2ZXJzaW9uIDEwCiNwcmFnbWEgdHlwZXRyYWNrIGZhbHNlCgovLyBAYWxnb3JhbmRmb3VuZGF0aW9uL2FsZ29yYW5kLXR5cGVzY3JpcHQvYmFzZS1jb250cmFjdC5kLnRzOjpCYXNlQ29udHJhY3QuY2xlYXJTdGF0ZVByb2dyYW0oKSAtPiB1aW50NjQ6Cm1haW46CiAgICBwdXNoaW50IDEgLy8gMQogICAgcmV0dXJuCg==" + }, + "state": { + "global": { + "num_byte_slices": 2, + "num_uints": 2 + }, + "local": { + "num_byte_slices": 0, + "num_uints": 0 + } + }, + "schema": { + "global": { + "declared": { + "stateCommon": { + "type": "uint64", + "key": "stateCommon" + }, + "stateMulti": { + "type": "bytes", + "key": "stateMulti" + }, + "stateOne": { + "type": "uint64", + "key": "stateOne" + }, + "stateTwo": { + "type": "bytes", + "key": "stateTwo" + } + }, + "reserved": {} + }, + "local": { + "declared": {}, + "reserved": {} + } + }, + "contract": { + "name": "MultiBases", + "methods": [ + { + "name": "methodMulti", + "args": [], + "readonly": false, + "returns": { + "type": "string" + } + }, + { + "name": "methodCallsSuper", + "args": [], + "readonly": false, + "returns": { + "type": "string" + } + }, + { + "name": "callB2CantOverride", + "args": [], + "readonly": false, + "returns": { + "type": "string" + } + }, + { + "name": "callB2Common", + "args": [], + "readonly": false, + "returns": { + "type": "string" + } + }, + { + "name": "methodOne", + "args": [], + "readonly": false, + "returns": { + "type": "string" + } + }, + { + "name": "methodCommon", + "args": [], + "readonly": false, + "returns": { + "type": "string" + } + }, + { + "name": "b2CantOverride", + "args": [], + "readonly": false, + "returns": { + "type": "string" + } + }, + { + "name": "methodTwo", + "args": [], + "readonly": false, + "returns": { + "type": "string" + } + } + ], + "networks": {} + }, + "bare_call_config": { + "no_op": "CREATE" + } +} \ No newline at end of file diff --git a/tests/artifacts/multi-inheritance/data/MultiBases.arc56.json b/tests/artifacts/multi-inheritance/data/MultiBases.arc56.json new file mode 100644 index 0000000..ccab0c8 --- /dev/null +++ b/tests/artifacts/multi-inheritance/data/MultiBases.arc56.json @@ -0,0 +1,249 @@ +{ + "name": "MultiBases", + "structs": {}, + "methods": [ + { + "name": "methodMulti", + "args": [], + "returns": { + "type": "string" + }, + "actions": { + "create": [], + "call": [ + "NoOp" + ] + }, + "readonly": false, + "events": [], + "recommendations": {} + }, + { + "name": "methodCallsSuper", + "args": [], + "returns": { + "type": "string" + }, + "actions": { + "create": [], + "call": [ + "NoOp" + ] + }, + "readonly": false, + "events": [], + "recommendations": {} + }, + { + "name": "callB2CantOverride", + "args": [], + "returns": { + "type": "string" + }, + "actions": { + "create": [], + "call": [ + "NoOp" + ] + }, + "readonly": false, + "events": [], + "recommendations": {} + }, + { + "name": "callB2Common", + "args": [], + "returns": { + "type": "string" + }, + "actions": { + "create": [], + "call": [ + "NoOp" + ] + }, + "readonly": false, + "events": [], + "recommendations": {} + }, + { + "name": "methodOne", + "args": [], + "returns": { + "type": "string" + }, + "actions": { + "create": [], + "call": [ + "NoOp" + ] + }, + "readonly": false, + "events": [], + "recommendations": {} + }, + { + "name": "methodCommon", + "args": [], + "returns": { + "type": "string" + }, + "actions": { + "create": [], + "call": [ + "NoOp" + ] + }, + "readonly": false, + "events": [], + "recommendations": {} + }, + { + "name": "b2CantOverride", + "args": [], + "returns": { + "type": "string" + }, + "actions": { + "create": [], + "call": [ + "NoOp" + ] + }, + "readonly": false, + "events": [], + "recommendations": {} + }, + { + "name": "methodTwo", + "args": [], + "returns": { + "type": "string" + }, + "actions": { + "create": [], + "call": [ + "NoOp" + ] + }, + "readonly": false, + "events": [], + "recommendations": {} + } + ], + "arcs": [ + 22, + 28 + ], + "networks": {}, + "state": { + "schema": { + "global": { + "ints": 2, + "bytes": 2 + }, + "local": { + "ints": 0, + "bytes": 0 + } + }, + "keys": { + "global": { + "stateMulti": { + "keyType": "AVMString", + "valueType": "AVMString", + "key": "c3RhdGVNdWx0aQ==" + }, + "stateOne": { + "keyType": "AVMString", + "valueType": "AVMUint64", + "key": "c3RhdGVPbmU=" + }, + "stateCommon": { + "keyType": "AVMString", + "valueType": "AVMUint64", + "key": "c3RhdGVDb21tb24=" + }, + "stateTwo": { + "keyType": "AVMString", + "valueType": "AVMString", + "key": "c3RhdGVUd28=" + } + }, + "local": {}, + "box": {} + }, + "maps": { + "global": {}, + "local": {}, + "box": {} + } + }, + "bareActions": { + "create": [ + "NoOp" + ], + "call": [] + }, + "sourceInfo": { + "approval": { + "sourceInfo": [ + { + "pc": [ + 182, + 193, + 204, + 215, + 241, + 252, + 263, + 274 + ], + "errorMessage": "OnCompletion is not NoOp" + }, + { + "pc": [ + 308 + ], + "errorMessage": "can only call when creating" + }, + { + "pc": [ + 185, + 196, + 207, + 218, + 244, + 255, + 266, + 277 + ], + "errorMessage": "can only call when not creating" + } + ], + "pcOffsetMethod": "none" + }, + "clear": { + "sourceInfo": [], + "pcOffsetMethod": "none" + } + }, + "source": { + "approval": "I3ByYWdtYSB2ZXJzaW9uIDEwCiNwcmFnbWEgdHlwZXRyYWNrIGZhbHNlCgovLyBAYWxnb3JhbmRmb3VuZGF0aW9uL2FsZ29yYW5kLXR5cGVzY3JpcHQvYXJjNC9pbmRleC5kLnRzOjpDb250cmFjdC5hcHByb3ZhbFByb2dyYW0oKSAtPiB1aW50NjQ6Cm1haW46CiAgICBpbnRjYmxvY2sgMSAxMjMKICAgIGJ5dGVjYmxvY2sgMHgxNTFmN2M3NTAwMDg2MjYxNzM2NTJkNzQ3NzZmIDB4MTUxZjdjNzUwMDA2NjM2ZjZkNmQ2ZjZlICJzdGF0ZUNvbW1vbiIKIC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ICAgaW50Y18wIC8vIDEKICAgIHJldHVybgo=", + "clear": "I3ByYWdtYSB2ZXJzaW9uIDEwCiNwcmFnbWEgdHlwZXRyYWNrIGZhbHNlCgovLyBAYWxnb3JhbmRmb3VuZGF0aW9uL2FsZ29yYW5kLXR5cGVzY3JpcHQvYmFzZS1jb250cmFjdC5kLnRzOjpCYXNlQ29udHJhY3QuY2xlYXJTdGF0ZVByb2dyYW0oKSAtPiB1aW50NjQ6Cm1haW46CiAgICBwdXNoaW50IDEgLy8gMQogICAgcmV0dXJuCg==" + }, + "byteCode": { + "approval": "CiACAXsmAw4VH3x1AAhiYXNlLXR3bwwVH3x1AAZjb21tb24Lc3RhdGVDb21tb24xGEAAOCojZ4AIc3RhdGVPbmWBLWcqI2eCAghzdGF0ZVR3bwVIZWxsb2eCAgpzdGF0ZU11bHRpBEhtbW1nMRtBALuCCAQpDrqfBIOdlv8EqXjKVgSIVH64BMMlM+MERVyNCQT59RQsBDY7Mp42GgCOCABfAFQASQA+ACQAGQAOAAOBAEMxGRREMRhEKLAiQzEZFEQxGEQpsCJDMRkURDEYRCmwIkMxGRREMRhEgA4VH3x1AAhiYXNlLW9uZbAiQzEZFEQxGEQpsCJDMRkURDEYRCiwIkMxGRREMRhEKLAiQzEZFEQxGESAERUffHUAC211bHRpLWJhc2VzsCJDMRlA/38xGBREIkM=", + "clear": "CoEBQw==" + }, + "compilerInfo": { + "compiler": "puya", + "compilerVersion": { + "major": 4, + "minor": 1, + "patch": 1 + } + }, + "events": [], + "templateVariables": {} +} \ No newline at end of file diff --git a/tests/artifacts/multi-inheritance/data/MultiBases.clear.teal b/tests/artifacts/multi-inheritance/data/MultiBases.clear.teal new file mode 100644 index 0000000..a4d5804 --- /dev/null +++ b/tests/artifacts/multi-inheritance/data/MultiBases.clear.teal @@ -0,0 +1,7 @@ +#pragma version 10 +#pragma typetrack false + +// @algorandfoundation/algorand-typescript/base-contract.d.ts::BaseContract.clearStateProgram() -> uint64: +main: + pushint 1 // 1 + return diff --git a/tests/multi-inheritance.spec.ts b/tests/multi-inheritance.spec.ts new file mode 100644 index 0000000..26543bd --- /dev/null +++ b/tests/multi-inheritance.spec.ts @@ -0,0 +1,46 @@ +import { AppSpec } from '@algorandfoundation/algokit-utils/types/app-spec' +import { TestExecutionContext } from '@algorandfoundation/algorand-typescript-testing' +import { afterEach } from 'node:test' +import { describe, expect, it } from 'vitest' +import { MultiBases } from './artifacts/multi-inheritance/contract.algo' +import appSpecJson from './artifacts/multi-inheritance/data/MultiBases.arc32.json' +import { getAlgorandAppClient, getAvmResult } from './avm-invoker' + +describe('multi-inheritance', async () => { + const ctx = new TestExecutionContext() + const appClient = await getAlgorandAppClient(appSpecJson as AppSpec) + + afterEach(() => ctx.reset()) + + it('should be able to call methods from super classes', async () => { + const contract = ctx.contract.create(MultiBases) + + const avmMethod1Result = await getAvmResult({ appClient }, 'methodOne') + const avmMethod2Result = await getAvmResult({ appClient }, 'methodTwo') + const avmMethodMultiResult = await getAvmResult({ appClient }, 'methodMulti') + const avmMethodCallsSuperResult = await getAvmResult({ appClient }, 'methodCallsSuper') + const avmCallB2CantOverrideResult = await getAvmResult({ appClient }, 'callB2CantOverride') + const avmCallB2CommonResult = await getAvmResult({ appClient }, 'callB2Common') + + const method1Result = contract.methodOne() + const method2Result = contract.methodTwo() + const methodMultiResult = contract.methodMulti() + const methodCallsSuperResult = contract.methodCallsSuper() + const callB2CantOverrideResult = contract.callB2CantOverride() + const callB2CommonResult = contract.callB2Common() + + expect(method1Result).toEqual('base-one') + expect(method2Result).toEqual('base-two') + expect(methodMultiResult).toEqual('multi-bases') + expect(methodCallsSuperResult).toEqual('base-two') + expect(callB2CantOverrideResult).toEqual('base-two') + expect(callB2CommonResult).toEqual('common') + + expect(method1Result).toEqual(avmMethod1Result) + expect(method2Result).toEqual(avmMethod2Result) + expect(methodMultiResult).toEqual(avmMethodMultiResult) + expect(methodCallsSuperResult).toEqual(avmMethodCallsSuperResult) + expect(callB2CantOverrideResult).toEqual(avmCallB2CantOverrideResult) + expect(callB2CommonResult).toEqual(avmCallB2CommonResult) + }) +})