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

fix: change FEE_SCHEDULE_FILE_PART_UPLOADED to not show as an error #2537

Merged
merged 6 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/transaction/TransactionReceiptQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ export default class TransactionReceiptQuery extends Query {
case Status.ReceiptNotFound:
return [status, ExecutionState.Retry];
case Status.Success:
case Status.FeeScheduleFilePartUploaded:
return [status, ExecutionState.Finished];
default:
return [
Expand Down
5 changes: 4 additions & 1 deletion src/transaction/TransactionResponse.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ export default class TransactionResponse {
async getReceipt(client) {
const receipt = await this.getReceiptQuery().execute(client);

if (receipt.status !== Status.Success) {
if (
receipt.status !== Status.Success &&
receipt.status !== Status.FeeScheduleFilePartUploaded
) {
throw new ReceiptStatusError({
transactionReceipt: receipt,
status: receipt.status,
Expand Down
27 changes: 26 additions & 1 deletion test/integration/FileUpdateIntegrationTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ import {
FileInfoQuery,
Hbar,
Status,
AccountId,
PrivateKey,
} from "../../src/exports.js";
import IntegrationTestEnv from "./client/NodeIntegrationTestEnv.js";
import IntegrationTestEnv, { Client } from "./client/NodeIntegrationTestEnv.js";

describe("FileUpdate", function () {
let env;
Expand Down Expand Up @@ -94,6 +96,29 @@ describe("FileUpdate", function () {
}
});

it("should not error when FEE_SCHEDULE_FILE_PART_UPLOADED response", async function () {
this.timeout(120000);

const OPERATOR_ID = AccountId.fromString("0.0.2");
const OPERATOR_KEY = PrivateKey.fromStringED25519(
"302e020100300506032b65700422042091132178e72057a1d7528025956fe39b0b847f200ab59b2fdd367017f3087137",
);
const FEES_FILE_ID = "0.0.111";
const DUMMY_TEXT = "Hello, Hedera!";

const client = Client.forLocalNode().setOperator(
OPERATOR_ID,
OPERATOR_KEY,
);

await (
await new FileUpdateTransaction()
.setFileId(FEES_FILE_ID)
.setContents(DUMMY_TEXT)
.execute(client)
).getReceipt(client);
});

after(async function () {
await env.close();
});
Expand Down