Search in sources :

Example 1 with FeeSchedules

use of com.hedera.hashgraph.sdk.FeeSchedules in project hedera-sdk-java by hashgraph.

the class FeeSchedulesTest method canFetchFeeSchedules.

@Test
@DisplayName("FeeSchedules (CurrentAndNextFeeSchedule) is fetched and parsed from file 0.0.111")
void canFetchFeeSchedules() throws Exception {
    var testEnv = new IntegrationTestEnv(1);
    ByteString feeSchedulesBytes = new FileContentsQuery().setFileId(new FileId(0, 0, 111)).execute(testEnv.client);
    FeeSchedules feeSchedules = FeeSchedules.fromBytes(feeSchedulesBytes.toByteArray());
    /*
         * Test whether the file 0.0.111 actually contains stuff
         */
    assertThat(feeSchedules.getCurrent()).isNotNull();
    testEnv.close();
}
Also used : FileContentsQuery(com.hedera.hashgraph.sdk.FileContentsQuery) FeeSchedules(com.hedera.hashgraph.sdk.FeeSchedules) ByteString(com.google.protobuf.ByteString) FileId(com.hedera.hashgraph.sdk.FileId) Test(org.junit.jupiter.api.Test) DisplayName(org.junit.jupiter.api.DisplayName)

Aggregations

ByteString (com.google.protobuf.ByteString)1 FeeSchedules (com.hedera.hashgraph.sdk.FeeSchedules)1 FileContentsQuery (com.hedera.hashgraph.sdk.FileContentsQuery)1 FileId (com.hedera.hashgraph.sdk.FileId)1 DisplayName (org.junit.jupiter.api.DisplayName)1 Test (org.junit.jupiter.api.Test)1