Skip to content

Commit

Permalink
Purge remaining usages V1 GRPC API. (#291)
Browse files Browse the repository at this point in the history
* bump base.

* CHANGELOG

* Remove v1 usages.

* Remove unused imports.
  • Loading branch information
MilkywayPirate authored Jan 3, 2024
1 parent 6578715 commit 2b7b0e4
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 62 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

## Unreleased changes
- Purge remaining usages of V1 GRPC API.

## 6.0.0
- Added method `waitUntilFinalized` for waiting until a given transaction is finalized.
Expand Down
2 changes: 1 addition & 1 deletion concordium-base
Submodule concordium-base updated 88 files
+24 −58 .github/workflows/build-test-contracts-common.yaml
+28 −73 .github/workflows/build-test-smart-contracts.yaml
+17 −37 .github/workflows/build-test-sources.yaml
+1 −0 concordium-base.cabal
+1 −1 concordium-grpc-api
+3 −0 haskell-bins/genesis/Genesis.hs
+4 −1 haskell-src/Concordium/Constants.hs
+6 −0 haskell-src/Concordium/Crypto/SignatureScheme.hs
+125 −1 haskell-src/Concordium/GRPC2.hs
+19 −0 haskell-src/Concordium/Genesis/Data.hs
+143 −0 haskell-src/Concordium/Genesis/Data/P7.hs
+50 −0 haskell-src/Concordium/Types/Execution.hs
+7 −0 haskell-src/Concordium/Types/Migration.hs
+2 −0 haskell-src/Concordium/Types/Parameters.hs
+25 −2 haskell-src/Concordium/Types/ProtocolVersion.hs
+49 −70 haskell-src/Concordium/Types/Queries.hs
+1 −0 haskell-src/Concordium/Types/SeedState.hs
+1 −0 haskell-tests/Types/UpdatesSpec.hs
+2 −2 identity-provider-service/Cargo.lock
+4 −1 idiss-csharp/CHANGELOG.md
+162 −96 idiss-csharp/IdissLib/Idiss.cs
+1 −1 idiss-csharp/IdissLib/IdissLib.csproj
+38 −0 idiss-csharp/data/valid_request_v1.json
+4 −0 idiss/CHANGELOG.md
+3 −3 idiss/Cargo.lock
+2 −1 idiss/Cargo.toml
+32 −25 idiss/src/cs_exports.rs
+4 −0 mobile_wallet/CHANGELOG.md
+5 −4 mobile_wallet/Cargo.lock
+2 −2 mobile_wallet/Cargo.toml
+4 −0 rust-bins/CHANGELOG.md
+5 −4 rust-bins/Cargo.lock
+2 −2 rust-bins/Cargo.toml
+8 −4 rust-bins/src/bin/client.rs
+20 −25 rust-bins/src/bin/user_cli.rs
+18 −3 rust-src/Cargo.lock
+4 −2 rust-src/Cargo.toml
+18 −0 rust-src/concordium_base/CHANGELOG.md
+1 −1 rust-src/concordium_base/Cargo.toml
+78 −60 rust-src/concordium_base/benches/encrypted_transfers_benchmarks.rs
+6 −5 rust-src/concordium_base/benches/multiexp_bench.rs
+11 −2 rust-src/concordium_base/src/base.rs
+4 −1 rust-src/concordium_base/src/common/mod.rs
+0 −1 rust-src/concordium_base/src/common/serialize.rs
+53 −29 rust-src/concordium_base/src/curve_arithmetic/mod.rs
+31 −1 rust-src/concordium_base/src/dodis_yampolskiy_prf/secret.rs
+8 −0 rust-src/concordium_base/src/ffi_helpers/common.rs
+102 −2 rust-src/concordium_base/src/id/types.rs
+6 −0 rust-src/concordium_base/src/lib.rs
+33 −2 rust-src/concordium_base/src/smart_contracts.rs
+49 −0 rust-src/concordium_base/src/transactions.rs
+13 −0 rust-src/key_derivation/CHANGELOG.md
+2 −1 rust-src/key_derivation/Cargo.toml
+307 −16 rust-src/key_derivation/src/lib.rs
+7 −0 rust-src/wallet_library/CHANGELOG.md
+28 −0 rust-src/wallet_library/Cargo.toml
+32 −0 rust-src/wallet_library/resources/ars_infos.json
+8 −0 rust-src/wallet_library/resources/global.json
+57 −0 rust-src/wallet_library/resources/identity-object.json
+13 −0 rust-src/wallet_library/resources/ip_info.json
+315 −0 rust-src/wallet_library/src/credential.rs
+356 −0 rust-src/wallet_library/src/identity.rs
+6 −0 rust-src/wallet_library/src/lib.rs
+52 −0 rust-src/wallet_library/src/test_helpers.rs
+338 −0 rust-src/wallet_library/src/wallet.rs
+2 −0 smart-contracts/contracts-common/Cargo.toml
+1 −1 smart-contracts/contracts-common/concordium-contracts-common-derive/src/lib.rs
+8 −0 smart-contracts/contracts-common/concordium-contracts-common/CHANGELOG.md
+1 −1 smart-contracts/contracts-common/concordium-contracts-common/Cargo.toml
+2 −3 smart-contracts/contracts-common/concordium-contracts-common/src/schema.rs
+5 −5 smart-contracts/contracts-common/concordium-contracts-common/src/schema_json.rs
+82 −7 smart-contracts/contracts-common/concordium-contracts-common/src/types.rs
+3 −0 smart-contracts/wasm-chain-integration/CHANGELOG.md
+1 −1 smart-contracts/wasm-chain-integration/Cargo.lock
+8 −6 smart-contracts/wasm-chain-integration/benches/v1-host-functions.rs
+5 −14 smart-contracts/wasm-chain-integration/benches/wasm.rs
+81 −40 smart-contracts/wasm-chain-integration/src/lib.rs
+72 −30 smart-contracts/wasm-chain-integration/src/utils.rs
+4 −4 smart-contracts/wasm-chain-integration/src/v1/crypto_primitives_tests.rs
+1 −0 smart-contracts/wasm-chain-integration/src/v1/ffi.rs
+401 −65 smart-contracts/wasm-chain-integration/src/v1/mod.rs
+10 −24 smart-contracts/wasm-chain-integration/src/v1/tests.rs
+11 −0 smart-contracts/wasm-chain-integration/src/v1/trie/api.rs
+23 −1 smart-contracts/wasm-chain-integration/src/v1/trie/low_level.rs
+1 −1 smart-contracts/wasm-chain-integration/src/v1/trie/types.rs
+122 −21 smart-contracts/wasm-chain-integration/src/v1/types.rs
+4 −0 smart-contracts/wasm-chain-integration/src/validation_tests.rs
+1 −1 smart-contracts/wasm-test/Cargo.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package com.concordium.sdk.responses.peerlist;

import com.concordium.grpc.v2.PeersInfo;
import concordium.ConcordiumP2PRpc;

/**
* Represents Catchup Status of a Node.
*/
Expand Down Expand Up @@ -34,27 +32,6 @@ public enum PeerCatchupStatus {
this.value = value;
}

/**
* Parses the input {@link ConcordiumP2PRpc.PeerElement.CatchupStatus}.
*
* @param catchupStatus input {@link ConcordiumP2PRpc.PeerElement.CatchupStatus}.
* @return Parsed {@link PeerCatchupStatus}.
*/
public static PeerCatchupStatus parse(ConcordiumP2PRpc.PeerElement.CatchupStatus catchupStatus) {
switch (catchupStatus) {
case UPTODATE:
return PeerCatchupStatus.UP_TO_DATE;
case PENDING:
return PeerCatchupStatus.PENDING;
case CATCHINGUP:
return PeerCatchupStatus.CATCHING_UP;
default:
throw new IllegalArgumentException(String.format(
"Invalid catchup status received: %d",
catchupStatus.getNumber()));
}
}

/**
* Parses the input {@link com.concordium.grpc.v2.PeersInfo.Peer.CatchupStatus}.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
package com.concordium.sdk.types;

import com.concordium.sdk.crypto.SHA256;
import com.concordium.sdk.serializing.JsonMapper;
import com.concordium.sdk.transactions.AccountType;
import com.concordium.sdk.transactions.Base58;
import com.concordium.sdk.transactions.CredentialRegistrationId;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.google.common.collect.ImmutableList;
import concordium.ConcordiumP2PRpc;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.val;
Expand All @@ -23,7 +19,6 @@
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Objects;
import java.util.Optional;


@EqualsAndHashCode(callSuper = true)
Expand Down Expand Up @@ -125,19 +120,6 @@ public static AccountAddress fromBytes(ByteBuffer source) {
return AccountAddress.from(addressBytes);
}

public static Optional<ImmutableList<AccountAddress>> toList(ConcordiumP2PRpc.JsonResponse res) {
try {
val array = JsonMapper.INSTANCE.readValue(res.getValue(), AccountAddress[].class);
if (Objects.isNull(array)) {
return Optional.empty();
}

return Optional.of(ImmutableList.copyOf(array));
} catch (JsonProcessingException e) {
throw new IllegalArgumentException("Cannot parse AccountInfo Array JSON", e);
}
}

@JsonCreator
AccountAddress(String encodedAddress) {
super(AccountType.ADDRESS_ACCOUNT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,10 @@
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.google.common.collect.ImmutableList;
import concordium.ConcordiumP2PRpc;
import lombok.*;

import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.Objects;
import java.util.Optional;

@Getter
@ToString
Expand Down Expand Up @@ -51,20 +47,6 @@ public String toJson() {
}
}

public static Optional<ImmutableList<ContractAddress>> toList(ConcordiumP2PRpc.JsonResponse res) {
try {
val array = JsonMapper.INSTANCE.readValue(res.getValue(), ContractAddress[].class);

if (Objects.isNull(array)) {
return Optional.empty();
}

return Optional.of(ImmutableList.copyOf(array));
} catch (JsonProcessingException e) {
throw new IllegalArgumentException("Cannot parse ContractAddress Array JSON", e);
}
}

public static ContractAddress from(long index, long subIndex) {
return ContractAddress.builder()
.index(index)
Expand Down
4 changes: 2 additions & 2 deletions crypto-jni/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2b7b0e4

Please sign in to comment.