From caa0da2c41eec095c11aa06872d8583c2445e348 Mon Sep 17 00:00:00 2001 From: Ricky Saechao Date: Mon, 3 Jun 2024 11:35:37 -0700 Subject: [PATCH] chore: update test snapshots and pre check status Signed-off-by: Ricky Saechao --- Sources/Hedera/MirrorNodeRouter.swift | 2 +- Tests/HederaE2ETests/Contract/ContractCreate.swift | 7 +++---- .../__Snapshots__/ContractInfoTests/testFromBytes.1.txt | 2 +- .../__Snapshots__/ContractInfoTests/testFromProtobuf.1.txt | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Sources/Hedera/MirrorNodeRouter.swift b/Sources/Hedera/MirrorNodeRouter.swift index e4d71ed4..841cf262 100644 --- a/Sources/Hedera/MirrorNodeRouter.swift +++ b/Sources/Hedera/MirrorNodeRouter.swift @@ -40,7 +40,7 @@ internal struct MirrorNodeRouter { tokensAccountRoute: "/accounts/%@/tokens", ] - private func MirrorNodeRouter() {} + private func mirrorNodeRouter() {} static func getMirrorNodeUrl(_ mirrorNetwork: [String], _ ledgerId: LedgerId?) throws -> String { var mirrorNodeAddress: String = "" diff --git a/Tests/HederaE2ETests/Contract/ContractCreate.swift b/Tests/HederaE2ETests/Contract/ContractCreate.swift index 1f32ce5b..3efd1ccf 100644 --- a/Tests/HederaE2ETests/Contract/ContractCreate.swift +++ b/Tests/HederaE2ETests/Contract/ContractCreate.swift @@ -92,12 +92,11 @@ internal final class ContractCreate: XCTestCase { .constructorParameters(ContractFunctionParameters().addString("Hello from Hedera.")) .bytecodeFileId(bytecode.fileId) .contractMemo("[e2e::ContractCreateTransaction]") - .execute(testEnv.client) - .getReceipt(testEnv.client), + .execute(testEnv.client), "expected error creating contract" ) { error in - guard case .receiptStatus(let status, transactionId: _) = error.kind else { - XCTFail("`\(error.kind)` is not `.receiptStatus`") + guard case .transactionPreCheckStatus(let status, transactionId: _) = error.kind else { + XCTFail("`\(error.kind)` is not `.transactionPreCheckStatus`") return } diff --git a/Tests/HederaTests/__Snapshots__/ContractInfoTests/testFromBytes.1.txt b/Tests/HederaTests/__Snapshots__/ContractInfoTests/testFromBytes.1.txt index 3bd5aa11..0cf20454 100644 --- a/Tests/HederaTests/__Snapshots__/ContractInfoTests/testFromBytes.1.txt +++ b/Tests/HederaTests/__Snapshots__/ContractInfoTests/testFromBytes.1.txt @@ -1 +1 @@ -ContractInfo(contractId: 0.0.1, accountId: 0.0.5006, contractAccountId: "3", adminKey: nil, expirationTime: Optional(1554158728000000000), autoRenewPeriod: Optional(Hedera.Duration(seconds: 432000)), storage: 0, contractMemo: "flook", balance: 8 tℏ, isDeleted: false, autoRenewAccountId: nil, maxAutomaticTokenAssociations: 0, ledgerId: testnet, stakingInfo: Hedera.StakingInfo(declineStakingReward: false, stakePeriodStart: nil, pendingReward: 0 tℏ, stakedToMe: 0 tℏ, stakedAccountId: nil, stakedNodeId: nil)) \ No newline at end of file +ContractInfo(contractId: 0.0.1, accountId: 0.0.5006, contractAccountId: "3", adminKey: nil, expirationTime: Optional(1554158728000000000), autoRenewPeriod: Optional(Hedera.Duration(seconds: 432000)), storage: 0, contractMemo: "flook", balance: 8 tℏ, isDeleted: false, autoRenewAccountId: nil, maxAutomaticTokenAssociations: 0, tokenRelationships: [:], ledgerId: testnet, stakingInfo: Hedera.StakingInfo(declineStakingReward: false, stakePeriodStart: nil, pendingReward: 0 tℏ, stakedToMe: 0 tℏ, stakedAccountId: nil, stakedNodeId: nil)) \ No newline at end of file diff --git a/Tests/HederaTests/__Snapshots__/ContractInfoTests/testFromProtobuf.1.txt b/Tests/HederaTests/__Snapshots__/ContractInfoTests/testFromProtobuf.1.txt index 3bd5aa11..0cf20454 100644 --- a/Tests/HederaTests/__Snapshots__/ContractInfoTests/testFromProtobuf.1.txt +++ b/Tests/HederaTests/__Snapshots__/ContractInfoTests/testFromProtobuf.1.txt @@ -1 +1 @@ -ContractInfo(contractId: 0.0.1, accountId: 0.0.5006, contractAccountId: "3", adminKey: nil, expirationTime: Optional(1554158728000000000), autoRenewPeriod: Optional(Hedera.Duration(seconds: 432000)), storage: 0, contractMemo: "flook", balance: 8 tℏ, isDeleted: false, autoRenewAccountId: nil, maxAutomaticTokenAssociations: 0, ledgerId: testnet, stakingInfo: Hedera.StakingInfo(declineStakingReward: false, stakePeriodStart: nil, pendingReward: 0 tℏ, stakedToMe: 0 tℏ, stakedAccountId: nil, stakedNodeId: nil)) \ No newline at end of file +ContractInfo(contractId: 0.0.1, accountId: 0.0.5006, contractAccountId: "3", adminKey: nil, expirationTime: Optional(1554158728000000000), autoRenewPeriod: Optional(Hedera.Duration(seconds: 432000)), storage: 0, contractMemo: "flook", balance: 8 tℏ, isDeleted: false, autoRenewAccountId: nil, maxAutomaticTokenAssociations: 0, tokenRelationships: [:], ledgerId: testnet, stakingInfo: Hedera.StakingInfo(declineStakingReward: false, stakePeriodStart: nil, pendingReward: 0 tℏ, stakedToMe: 0 tℏ, stakedAccountId: nil, stakedNodeId: nil)) \ No newline at end of file