From dbc476e8c043c19910e9aa04c42af878221eca64 Mon Sep 17 00:00:00 2001 From: Luca8991 Date: Wed, 9 Aug 2023 12:25:20 +0200 Subject: [PATCH] chore: ws_types.did import downloaded from: https://github.com/omnia-network/ic-websocket-cdk-rs/blob/85bc5993984106991108b08cfd554618f44b2d6e/src/ic-websocket-cdk/ws_types.did --- .../src/test_canister/test_canister.did | 82 +----------------- .../src/test_canister/ws_types.did | 86 +++++++++++++++++++ 2 files changed, 87 insertions(+), 81 deletions(-) create mode 100644 tests/test_canister/src/test_canister/ws_types.did diff --git a/tests/test_canister/src/test_canister/test_canister.did b/tests/test_canister/src/test_canister/test_canister.did index d911f36..268eefe 100644 --- a/tests/test_canister/src/test_canister/test_canister.did +++ b/tests/test_canister/src/test_canister/test_canister.did @@ -1,84 +1,4 @@ -type ClientPublicKey = blob; - -type DirectClientMessage = record { - client_key : ClientPublicKey; - message : blob; -}; - -type RelayedClientMessage = record { - content : blob; - sig : blob; -}; - -type CanisterIncomingMessage = variant { - DirectlyFromClient : DirectClientMessage; - RelayedByGateway : RelayedClientMessage; - IcWebSocketEstablished : ClientPublicKey; -}; - -type CanisterOutputMessage = record { - client_key : ClientPublicKey; - key : text; - val : blob; -}; - -type CanisterOutputCertifiedMessages = record { - messages : vec CanisterOutputMessage; - cert : blob; - tree : blob; -}; - -type CanisterWsRegisterArguments = record { - client_key : ClientPublicKey; -}; - -type CanisterWsRegisterResult = variant { - Ok : null; - Err : text; -}; - -type CanisterWsOpenArguments = record { - msg : blob; - sig : blob; -}; - -type CanisterWsOpenResultValue = record { - client_key : ClientPublicKey; - canister_id : principal; - nonce : nat64; -}; - -type CanisterWsOpenResult = variant { - Ok : CanisterWsOpenResultValue; - Err : text; -}; - -type CanisterWsCloseArguments = record { - client_key : ClientPublicKey; -}; - -type CanisterWsCloseResult = variant { - Ok : null; - Err : text; -}; - -type CanisterWsMessageArguments = record { - msg : CanisterIncomingMessage; -}; - -type CanisterWsMessageResult = variant { - Ok : null; - Err : text; -}; - -type CanisterWsGetMessagesArguments = record { - nonce : nat64; -}; - -type CanisterWsGetMessagesResult = variant { - Ok : CanisterOutputCertifiedMessages; - Err : text; -}; +import "./ws_types.did"; type CanisterWsSendResult = variant { Ok : null; diff --git a/tests/test_canister/src/test_canister/ws_types.did b/tests/test_canister/src/test_canister/ws_types.did new file mode 100644 index 0000000..70c01f0 --- /dev/null +++ b/tests/test_canister/src/test_canister/ws_types.did @@ -0,0 +1,86 @@ +type ClientPublicKey = blob; + +type DirectClientMessage = record { + client_key : ClientPublicKey; + message : blob; +}; + +type RelayedClientMessage = record { + content : blob; + sig : blob; +}; + +type GatewayStatusMessage = record { + status_index : nat64; +}; + +type CanisterIncomingMessage = variant { + DirectlyFromClient : DirectClientMessage; + RelayedByGateway : RelayedClientMessage; + IcWebSocketEstablished : ClientPublicKey; + IcWebSocketGatewayStatus : GatewayStatusMessage; +}; + +type CanisterOutputMessage = record { + client_key : ClientPublicKey; + key : text; + val : blob; +}; + +type CanisterOutputCertifiedMessages = record { + messages : vec CanisterOutputMessage; + cert : blob; + tree : blob; +}; + +type CanisterWsRegisterArguments = record { + client_key : ClientPublicKey; +}; + +type CanisterWsRegisterResult = variant { + Ok : null; + Err : text; +}; + +type CanisterWsOpenArguments = record { + msg : blob; + sig : blob; +}; + +type CanisterWsOpenResultValue = record { + client_key : ClientPublicKey; + canister_id : principal; + nonce : nat64; +}; + +type CanisterWsOpenResult = variant { + Ok : CanisterWsOpenResultValue; + Err : text; +}; + +type CanisterWsCloseArguments = record { + client_key : ClientPublicKey; +}; + +type CanisterWsCloseResult = variant { + Ok : null; + Err : text; +}; + +type CanisterWsMessageArguments = record { + msg : CanisterIncomingMessage; +}; + +type CanisterWsMessageResult = variant { + Ok : null; + Err : text; +}; + +type CanisterWsGetMessagesArguments = record { + nonce : nat64; +}; + +type CanisterWsGetMessagesResult = variant { + Ok : CanisterOutputCertifiedMessages; + Err : text; +};