Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
0d97d80
chore: implement proof verification sugar for new queries
shumkov Jan 28, 2025
474ecfa
chore: add methods for new queries to dapi client
shumkov Jan 28, 2025
f5d1f71
chore: fetch implementation in progress
shumkov Jan 29, 2025
ed9dc9e
chore(sdk): implement queries and fetch methods
shumkov Jan 29, 2025
a23f8d0
Merge branch 'v2.0-tokens-dev' into feat/sdk/queries
shumkov Jan 30, 2025
c2c3c94
fix: fetch implementation for non-optional values
shumkov Jan 30, 2025
9d4920d
fix: fetch objects aren't available from SDK
shumkov Feb 1, 2025
3e571e6
feat(drive): add generate test data logic for init chain
shumkov Feb 3, 2025
bdd7ff8
chore(sdk): improvements and fixes for token queries
shumkov Feb 3, 2025
22212aa
test(sdk): fix SDK test framework
shumkov Feb 3, 2025
21de3a4
test(sdk): add query and group tests
shumkov Feb 3, 2025
27bf8bf
refactor: minor refactorings after PR review
shumkov Feb 3, 2025
9816146
refactor: remove broadcast methods from ST builders
shumkov Feb 3, 2025
42e3e16
fix: some minor fixes
shumkov Feb 3, 2025
1c3ba5e
fix: identity contract nonce
shumkov Feb 3, 2025
e56f057
test: fixtures
shumkov Feb 4, 2025
fdab153
test: more fixtures
shumkov Feb 4, 2025
2351b50
fix: proof result error for credit transfers in sdk
pauldelucia Feb 4, 2025
79f7038
fix: `TokenTransition` has no methods
shumkov Feb 4, 2025
da14f7c
chore: print identity keys
shumkov Feb 4, 2025
21c4d73
Merge remote-tracking branch 'origin/feat/sdk/queries' into feat/sdk/…
shumkov Feb 4, 2025
28727ac
fix: missing methods in token transitions
shumkov Feb 4, 2025
288dca1
chore: add getProof request logging
shumkov Feb 4, 2025
440fc27
fix: more missing methods
shumkov Feb 5, 2025
f173e89
test: fix tests
shumkov Feb 5, 2025
f445d52
fix: invalid GetProof request
shumkov Feb 5, 2025
a52b6bc
fix: cannot read properties of undefined (reading 'dataContract')
shumkov Feb 5, 2025
e317e47
fix: cannot read properties of undefined (reading 'toString')
shumkov Feb 6, 2025
a365cfd
fix: wrong data contract id to verify historical token proof
shumkov Feb 6, 2025
84359ea
fix: the token config is fetched wrong the wrong contract
shumkov Feb 6, 2025
bbadd12
fix: can't create a token contract from buffer
shumkov Feb 6, 2025
a0402cd
set limit to 1 on single key sized query
pauldelucia Feb 7, 2025
3e87933
fix: proofs for historical contracts
shumkov Feb 7, 2025
c809ebd
Merge remote-tracking branch 'origin/feat/sdk/queries' into feat/sdk/…
shumkov Feb 7, 2025
58259a3
fix: set limit to 1 for token info for id query
pauldelucia Feb 10, 2025
1e2b0b9
fix: invalid token contract id
shumkov Feb 11, 2025
d728f64
fix: token history contract description
pauldelucia Feb 11, 2025
4397cec
chore: update example token contract
pauldelucia Feb 11, 2025
1412c03
chore: kick off CI
shumkov Feb 13, 2025
d153226
Merge branch 'v2.0-dev' into feat/sdk/queries
shumkov Feb 14, 2025
0ce15c4
refactor: remove duplicate imports
shumkov Feb 14, 2025
37af281
feat: add `SDK_TEST_DATA=true` env to start network with test data
shumkov Feb 14, 2025
525adc8
Merge branch 'v2.0-dev' into feat/sdk/queries
shumkov Feb 20, 2025
b5292b5
Merge branch 'v2.0-dev' into feat/sdk/queries
shumkov Feb 20, 2025
88cf7d9
Merge branch 'refs/heads/v2.0-dev' into feat/sdk/queries
shumkov Feb 21, 2025
fa63231
revert: proof verification changes
shumkov Feb 21, 2025
9f73f90
chore: remove debug output
shumkov Feb 21, 2025
d27c127
test: update sdk tests
shumkov Feb 24, 2025
f1bae2d
test: fix identity_token_info test
shumkov Feb 25, 2025
952b1f2
Merge branch 'v2.0-dev' into feat/sdk/queries
lklimek Mar 6, 2025
149f509
Merge branch 'v2.0-dev' into feat/sdk/queries
shumkov Mar 11, 2025
4234d6d
fix: invalid token config binding
shumkov Mar 11, 2025
f3bbb0a
fix: duplicate imports
shumkov Mar 11, 2025
50be13b
Merge branch 'v2.0-dev' into feat/sdk/queries
shumkov Mar 11, 2025
fcd9878
test: fix tests
shumkov Mar 12, 2025
93e697f
docs: document build argument
shumkov Mar 12, 2025
4f52339
refactor: move code to conventional modules
shumkov Mar 12, 2025
fbe4906
test: fixed SDK tests
shumkov Mar 12, 2025
c30407e
test: bring default network testnet to fix tests
shumkov Mar 13, 2025
b6a2bc0
fix: increase example token supplies
shumkov Mar 13, 2025
1d12bd9
fix: npm security vulnerability
shumkov Mar 13, 2025
e56e68d
test: test with all features enables sdk test data that lead to failures
shumkov Mar 13, 2025
37ddb14
build: fix create sdk test data flag
shumkov Mar 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
27 changes: 27 additions & 0 deletions .cargo/config-test-sdk-data.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[target.aarch64-unknown-linux-musl]
rustflags = ["-C", "target-feature=-crt-static"]

[target.x86_64-unknown-linux-musl]
rustflags = [
"-C",
"target-feature=-crt-static",
"-C",
"target-cpu=x86-64",
]

[target.x86_64-unknown-linux-gnu]
rustflags = [
"-C",
"target-feature=-crt-static",
"-C",
"target-cpu=x86-64",
]

[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"

[target.wasm32-unknown-unknown]
rustflags = ['--cfg', 'getrandom_backend="wasm_js"']

[target.'cfg(all())']
rustflags = ["--cfg", "tokio_unstable", '--cfg', 'create_sdk_test_data']
10 changes: 2 additions & 8 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
# TODO: We shouldn't go with tokio_unstable to production

[target.aarch64-unknown-linux-musl]
rustflags = ["-C", "target-feature=-crt-static", "--cfg", "tokio_unstable"]
rustflags = ["-C", "target-feature=-crt-static"]

[target.x86_64-unknown-linux-musl]
rustflags = [
"-C",
"target-feature=-crt-static",
"--cfg",
"tokio_unstable",
"-C",
"target-cpu=x86-64",
]
Expand All @@ -17,8 +13,6 @@ rustflags = [
rustflags = [
"-C",
"target-feature=-crt-static",
"--cfg",
"tokio_unstable",
"-C",
"target-cpu=x86-64",
]
Expand All @@ -29,5 +23,5 @@ linker = "aarch64-linux-gnu-gcc"
[target.wasm32-unknown-unknown]
rustflags = ['--cfg', 'getrandom_backend="wasm_js"']

[build]
[target.'cfg(all())']
rustflags = ["--cfg", "tokio_unstable"]
2,130 changes: 1,046 additions & 1,084 deletions .pnp.cjs

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
18 changes: 9 additions & 9 deletions Cargo.lock

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

24 changes: 19 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
# - ALPINE_VERSION - use different version of Alpine base image; requires also rust:apline...
# image to be available
# - USERNAME, USER_UID, USER_GID - specification of user used to run the binary
# - SDK_TEST_DATA - set to `true` to create SDK test data on chain genesis. It should be used only for testing
# purpose in local development environment
#
# # sccache cache backends
#
Expand Down Expand Up @@ -400,6 +402,11 @@ RUN --mount=type=secret,id=AWS \
# This will prebuild majority of dependencies
FROM deps AS build-drive-abci

# Pass SDK_TEST_DATA=true to create SDK test data on chain genesis
# This is only for testing purpose and should be used only for
# local development environment
ARG SDK_TEST_DATA

SHELL ["/bin/bash", "-o", "pipefail","-e", "-x", "-c"]

WORKDIR /platform
Expand All @@ -416,7 +423,10 @@ RUN --mount=type=cache,sharing=shared,id=cargo_registry_index,target=${CARGO_HOM
if [[ "${CARGO_BUILD_PROFILE}" == "release" ]] ; then \
mv .cargo/config-release.toml .cargo/config.toml; \
else \
export FEATURES_FLAG="--features=console,grovedbg" ; \
export FEATURES_FLAG="--features=console,grovedbg"; \
fi && \
if [ "${SDK_TEST_DATA}" == "true" ]; then \
mv .cargo/config-test-sdk-data.toml .cargo/config.toml; \
fi && \
cargo chef cook \
--recipe-path recipe.json \
Expand Down Expand Up @@ -473,11 +483,14 @@ RUN --mount=type=cache,sharing=shared,id=cargo_registry_index,target=${CARGO_HOM
set -ex; \
source /root/env && \
if [[ "${CARGO_BUILD_PROFILE}" == "release" ]] ; then \
mv .cargo/config-release.toml .cargo/config.toml && \
export OUT_DIRECTORY=release ; \
mv .cargo/config-release.toml .cargo/config.toml; \
export OUT_DIRECTORY=release; \
else \
export FEATURES_FLAG="--features=console,grovedbg" ; \
export OUT_DIRECTORY=debug ; \
export FEATURES_FLAG="--features=console,grovedbg"; \
export OUT_DIRECTORY=debug; \
fi && \
if [ "${SDK_TEST_DATA}" == "true" ]; then \
mv .cargo/config-test-sdk-data.toml .cargo/config.toml; \
fi && \
# Workaround: as we cache dapi-grpc, its build.rs is not rerun, so we need to touch it
echo "// $(date) " >> /platform/packages/dapi-grpc/build.rs && \
Expand Down Expand Up @@ -736,6 +749,7 @@ COPY --from=build-dapi /platform/packages/dapi /platform/packages/dapi
COPY --from=build-dapi /platform/packages/dapi-grpc /platform/packages/dapi-grpc
COPY --from=build-dapi /platform/packages/js-grpc-common /platform/packages/js-grpc-common
COPY --from=build-dapi /platform/packages/wasm-dpp /platform/packages/wasm-dpp
COPY --from=build-dapi /platform/packages/token-history-contract /platform/packages/token-history-contract

RUN cp /platform/packages/dapi/.env.example /platform/packages/dapi/.env

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"protobufjs": "^6.11.4",
"browserify-sign": "4.2.2",
"istanbul-lib-processinfo": "2.0.3",
"@babel/core": "7.23.3",
"@babel/runtime": "^7.26.10",
"tsconfig-paths": "4.2.0",
"ansi-regex": "5.0.1",
"cacache": "18.0.0",
Expand Down
16 changes: 14 additions & 2 deletions packages/dapi-grpc/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
// Derive features for versioned messages
//
// "GetConsensusParamsRequest" is excluded as this message does not support proofs
const VERSIONED_REQUESTS: [&str; 34] = [
const VERSIONED_REQUESTS: [&str; 40] = [
"GetDataContractHistoryRequest",
"GetDataContractRequest",
"GetDataContractsRequest",
Expand Down Expand Up @@ -98,14 +98,20 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
"GetIdentitiesTokenBalancesRequest",
"GetIdentityTokenInfosRequest",
"GetIdentitiesTokenInfosRequest",
"GetTokenStatusesRequest",
"GetTokenTotalSupplyRequest",
"GetGroupInfoRequest",
"GetGroupInfosRequest",
"GetGroupActionsRequest",
"GetGroupActionSignersRequest",
];

// The following responses are excluded as they don't support proofs:
// - "GetConsensusParamsResponse"
// - "GetStatusResponse"
//
// "GetEvonodesProposedEpochBlocksResponse" is used for 2 Requests
const VERSIONED_RESPONSES: [&str; 33] = [
const VERSIONED_RESPONSES: [&str; 39] = [
"GetDataContractHistoryResponse",
"GetDataContractResponse",
"GetDataContractsResponse",
Expand Down Expand Up @@ -139,6 +145,12 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
"GetIdentitiesTokenBalancesResponse",
"GetIdentityTokenInfosResponse",
"GetIdentitiesTokenInfosResponse",
"GetTokenStatusesResponse",
"GetTokenTotalSupplyResponse",
"GetGroupInfoResponse",
"GetGroupInfosResponse",
"GetGroupActionsResponse",
"GetGroupActionSignersResponse",
];

check_unique(&VERSIONED_REQUESTS).expect("VERSIONED_REQUESTS");
Expand Down
Loading