Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_maxAutomaticTokenAssociations default value should be null/undefined #1443

Closed
ochikov opened this issue Feb 3, 2023 · 1 comment · Fixed by #1444
Closed

_maxAutomaticTokenAssociations default value should be null/undefined #1443

ochikov opened this issue Feb 3, 2023 · 1 comment · Fixed by #1444
Assignees
Labels
bug Something isn't working
Milestone

Comments

@ochikov
Copy link
Contributor

ochikov commented Feb 3, 2023

Description

_maxAutomaticTokenAssociations default value should be null/undefined.
The ContractUpdateTransaction returns NOT_SUPPORTED

Steps to reproduce

let response = await new FileCreateTransaction()
            .setKeys([operatorKey])
            .setContents(smartContractBytecode)
            .execute(env.client);

        let receipt = await response.getReceipt(env.client);

        expect(receipt.fileId).to.not.be.null;
        expect(receipt.fileId != null ? receipt.fileId.num > 0 : false).to.be
            .true;

        const file = receipt.fileId;

        response = await new ContractCreateTransaction()
            .setAdminKey(operatorKey)
            .setGas(100000)
            .setConstructorParameters(
                new ContractFunctionParameters().addString("Hello from Hedera.")
            )
            .setBytecodeFileId(file)
            .setContractMemo("[e2e::ContractCreateTransaction]")
            .execute(env.client);

        receipt = await response.getReceipt(env.client);

        expect(receipt.contractId).to.not.be.null;
        expect(receipt.contractId != null ? receipt.contractId.num > 0 : false)
            .to.be.true;

        let contract = receipt.contractId;

        let info = await new ContractInfoQuery()
            .setContractId(contract)
            .setQueryPayment(new Hbar(1))
            .execute(env.client);

        expect(info.contractId.toString()).to.be.equal(contract.toString());
        expect(info.accountId).to.be.not.null;
        expect(
            info.contractId != null ? info.contractId.toString() : ""
        ).to.be.equal(contract.toString());
        expect(info.adminKey).to.be.not.null;
        expect(
            info.adminKey != null ? info.adminKey.toString() : ""
        ).to.be.equal(operatorKey.toString());
        expect(info.storage.toInt()).to.be.equal(128);
        expect(info.contractMemo).to.be.equal(
            "[e2e::ContractCreateTransaction]"
        );

        await (
            await new ContractUpdateTransaction()
                .setContractId(contract)
                .setContractMemo("[e2e::ContractUpdateTransaction]")
                .execute(env.client)
        ).getReceipt(env.client);

        info = await new ContractInfoQuery()
            .setContractId(contract)
            .setQueryPayment(new Hbar(5))
            .execute(env.client);

        expect(info.contractId.toString()).to.be.equal(contract.toString());
        expect(info.accountId).to.be.not.null;
        expect(
            info.contractId != null ? info.contractId.toString() : ""
        ).to.be.equal(contract.toString());
        expect(info.adminKey).to.be.not.null;
        expect(
            info.adminKey != null ? info.adminKey.toString() : ""
        ).to.be.equal(operatorKey.toString());
        expect(info.storage.toInt()).to.be.equal(128);
        expect(info.contractMemo).to.be.equal(
            "[e2e::ContractUpdateTransaction]"
        );

        await (
            await new ContractDeleteTransaction()
                .setContractId(contract)
                .setTransferAccountId(env.client.operatorAccountId)
                .execute(env.client)
        ).getReceipt(env.client);

        await (
            await new FileDeleteTransaction()
                .setFileId(file)
                .execute(env.client)
        ).getReceipt(env.client);


### Additional context

_No response_

### Hedera network

other

### Version

v2.19.2

### Operating system

Other
@ochikov ochikov added the bug Something isn't working label Feb 3, 2023
@ochikov ochikov self-assigned this Feb 3, 2023
@ochikov ochikov added this to the 2.20.0 milestone Feb 3, 2023
@petreze petreze linked a pull request Feb 3, 2023 that will close this issue
2 tasks
@ochikov
Copy link
Contributor Author

ochikov commented Feb 14, 2023

@ochikov ochikov closed this as completed Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant