Skip to content

Commit f2d8455

Browse files
hosseinkarami-devGitHub Actions Bot
andauthored
chore: regenerate client from OpenAPI (#105)
Co-authored-by: GitHub Actions Bot <automation@github.com>
1 parent bd5c9de commit f2d8455

157 files changed

Lines changed: 3506 additions & 32546 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

client/src/main/kotlin/io/github/hosseinkarami_dev/near/rpc/client/NearClient.kt

Lines changed: 408 additions & 1897 deletions
Large diffs are not rendered by default.

client/src/test/kotlin/io/github/hosseinkarami_dev/near/rpc/client/ModelSerializationTests.kt

Lines changed: 96 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,22 @@ class ModelSerializationTests {
839839
}
840840
}
841841

842+
@Test
843+
fun testDepositCostFailureReasonEncodeDecode() {
844+
val data = loadMockJson("DepositCostFailureReason.json")
845+
assertNotNull(data, "Mock file DepositCostFailureReason.json does not exist!")
846+
847+
try {
848+
val decoded = json.decodeFromString(io.github.hosseinkarami_dev.near.rpc.models.DepositCostFailureReason.serializer(), data)
849+
val encoded = json.encodeToString(io.github.hosseinkarami_dev.near.rpc.models.DepositCostFailureReason.serializer(), decoded)
850+
val decoded2 = json.decodeFromString(io.github.hosseinkarami_dev.near.rpc.models.DepositCostFailureReason.serializer(), encoded)
851+
assertEquals(decoded, decoded2)
852+
} catch (e: Exception) {
853+
e.printStackTrace()
854+
fail("Serialization test failed for DepositCostFailureReason: ${e.message}")
855+
}
856+
}
857+
842858
@Test
843859
fun testDetailedDebugStatusEncodeDecode() {
844860
val data = loadMockJson("DetailedDebugStatus.json")
@@ -951,22 +967,6 @@ class ModelSerializationTests {
951967
}
952968
}
953969

954-
@Test
955-
fun testDynamicReshardingConfigViewEncodeDecode() {
956-
val data = loadMockJson("DynamicReshardingConfigView.json")
957-
assertNotNull(data, "Mock file DynamicReshardingConfigView.json does not exist!")
958-
959-
try {
960-
val decoded = json.decodeFromString(io.github.hosseinkarami_dev.near.rpc.models.DynamicReshardingConfigView.serializer(), data)
961-
val encoded = json.encodeToString(io.github.hosseinkarami_dev.near.rpc.models.DynamicReshardingConfigView.serializer(), decoded)
962-
val decoded2 = json.decodeFromString(io.github.hosseinkarami_dev.near.rpc.models.DynamicReshardingConfigView.serializer(), encoded)
963-
assertEquals(decoded, decoded2)
964-
} catch (e: Exception) {
965-
e.printStackTrace()
966-
fail("Serialization test failed for DynamicReshardingConfigView: ${e.message}")
967-
}
968-
}
969-
970970
@Test
971971
fun testEpochIdEncodeDecode() {
972972
val data = loadMockJson("EpochId.json")
@@ -1639,6 +1639,38 @@ class ModelSerializationTests {
16391639
}
16401640
}
16411641

1642+
@Test
1643+
fun testGasKeyInfoEncodeDecode() {
1644+
val data = loadMockJson("GasKeyInfo.json")
1645+
assertNotNull(data, "Mock file GasKeyInfo.json does not exist!")
1646+
1647+
try {
1648+
val decoded = json.decodeFromString(io.github.hosseinkarami_dev.near.rpc.models.GasKeyInfo.serializer(), data)
1649+
val encoded = json.encodeToString(io.github.hosseinkarami_dev.near.rpc.models.GasKeyInfo.serializer(), decoded)
1650+
val decoded2 = json.decodeFromString(io.github.hosseinkarami_dev.near.rpc.models.GasKeyInfo.serializer(), encoded)
1651+
assertEquals(decoded, decoded2)
1652+
} catch (e: Exception) {
1653+
e.printStackTrace()
1654+
fail("Serialization test failed for GasKeyInfo: ${e.message}")
1655+
}
1656+
}
1657+
1658+
@Test
1659+
fun testGasKeyNoncesViewEncodeDecode() {
1660+
val data = loadMockJson("GasKeyNoncesView.json")
1661+
assertNotNull(data, "Mock file GasKeyNoncesView.json does not exist!")
1662+
1663+
try {
1664+
val decoded = json.decodeFromString(io.github.hosseinkarami_dev.near.rpc.models.GasKeyNoncesView.serializer(), data)
1665+
val encoded = json.encodeToString(io.github.hosseinkarami_dev.near.rpc.models.GasKeyNoncesView.serializer(), decoded)
1666+
val decoded2 = json.decodeFromString(io.github.hosseinkarami_dev.near.rpc.models.GasKeyNoncesView.serializer(), encoded)
1667+
assertEquals(decoded, decoded2)
1668+
} catch (e: Exception) {
1669+
e.printStackTrace()
1670+
fail("Serialization test failed for GasKeyNoncesView: ${e.message}")
1671+
}
1672+
}
1673+
16421674
@Test
16431675
fun testGenesisConfigEncodeDecode() {
16441676
val data = loadMockJson("GenesisConfig.json")
@@ -4983,6 +5015,38 @@ class ModelSerializationTests {
49835015
}
49845016
}
49855017

5018+
@Test
5019+
fun testTransferToGasKeyActionEncodeDecode() {
5020+
val data = loadMockJson("TransferToGasKeyAction.json")
5021+
assertNotNull(data, "Mock file TransferToGasKeyAction.json does not exist!")
5022+
5023+
try {
5024+
val decoded = json.decodeFromString(io.github.hosseinkarami_dev.near.rpc.models.TransferToGasKeyAction.serializer(), data)
5025+
val encoded = json.encodeToString(io.github.hosseinkarami_dev.near.rpc.models.TransferToGasKeyAction.serializer(), decoded)
5026+
val decoded2 = json.decodeFromString(io.github.hosseinkarami_dev.near.rpc.models.TransferToGasKeyAction.serializer(), encoded)
5027+
assertEquals(decoded, decoded2)
5028+
} catch (e: Exception) {
5029+
e.printStackTrace()
5030+
fail("Serialization test failed for TransferToGasKeyAction: ${e.message}")
5031+
}
5032+
}
5033+
5034+
@Test
5035+
fun testTrieSplitEncodeDecode() {
5036+
val data = loadMockJson("TrieSplit.json")
5037+
assertNotNull(data, "Mock file TrieSplit.json does not exist!")
5038+
5039+
try {
5040+
val decoded = json.decodeFromString(io.github.hosseinkarami_dev.near.rpc.models.TrieSplit.serializer(), data)
5041+
val encoded = json.encodeToString(io.github.hosseinkarami_dev.near.rpc.models.TrieSplit.serializer(), decoded)
5042+
val decoded2 = json.decodeFromString(io.github.hosseinkarami_dev.near.rpc.models.TrieSplit.serializer(), encoded)
5043+
assertEquals(decoded, decoded2)
5044+
} catch (e: Exception) {
5045+
e.printStackTrace()
5046+
fail("Serialization test failed for TrieSplit: ${e.message}")
5047+
}
5048+
}
5049+
49865050
@Test
49875051
fun testTxExecutionErrorEncodeDecode() {
49885052
val data = loadMockJson("TxExecutionError.json")
@@ -5191,6 +5255,22 @@ class ModelSerializationTests {
51915255
}
51925256
}
51935257

5258+
@Test
5259+
fun testWithdrawFromGasKeyActionEncodeDecode() {
5260+
val data = loadMockJson("WithdrawFromGasKeyAction.json")
5261+
assertNotNull(data, "Mock file WithdrawFromGasKeyAction.json does not exist!")
5262+
5263+
try {
5264+
val decoded = json.decodeFromString(io.github.hosseinkarami_dev.near.rpc.models.WithdrawFromGasKeyAction.serializer(), data)
5265+
val encoded = json.encodeToString(io.github.hosseinkarami_dev.near.rpc.models.WithdrawFromGasKeyAction.serializer(), decoded)
5266+
val decoded2 = json.decodeFromString(io.github.hosseinkarami_dev.near.rpc.models.WithdrawFromGasKeyAction.serializer(), encoded)
5267+
assertEquals(decoded, decoded2)
5268+
} catch (e: Exception) {
5269+
e.printStackTrace()
5270+
fail("Serialization test failed for WithdrawFromGasKeyAction: ${e.message}")
5271+
}
5272+
}
5273+
51945274
@Test
51955275
fun testWitnessConfigViewEncodeDecode() {
51965276
val data = loadMockJson("WitnessConfigView.json")

0 commit comments

Comments
 (0)