Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
= 0.7.6

== icx-proxy

The streaming callback mechanism now requires the following record structure for the token:
type StreamingCallbackToken = record {
key: text;
content_encoding: text;
index: nat;
sha256: opt blob;
};

Previously, the token could be a record with any set of fields.

= 0.7.1

== DFX
Expand Down
79 changes: 56 additions & 23 deletions Cargo.lock

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

11 changes: 3 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,14 @@ members = [
[patch.crates-io.ic-agent]
version = "0.5.1"
git = "https://github.com/dfinity/agent-rs.git"
rev = "de2e774e4afb39dd06db00d390ec2dbbc5a51597"
rev = "c6543eb3a2a9df0c706092de75f8888331ae81b1"

[patch.crates-io.ic-identity-hsm]
version = "0.3.2"
git = "https://github.com/dfinity/agent-rs.git"
rev = "de2e774e4afb39dd06db00d390ec2dbbc5a51597"

[patch.crates-io.ic-types]
version = "0.1.4"
git = "https://github.com/dfinity/agent-rs.git"
rev = "de2e774e4afb39dd06db00d390ec2dbbc5a51597"
rev = "c6543eb3a2a9df0c706092de75f8888331ae81b1"

[patch.crates-io.ic-utils]
version = "0.3.2"
git = "https://github.com/dfinity/agent-rs.git"
rev = "de2e774e4afb39dd06db00d390ec2dbbc5a51597"
rev = "c6543eb3a2a9df0c706092de75f8888331ae81b1"
10 changes: 5 additions & 5 deletions e2e/tests-dfx/assetscanister.bash
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,14 @@ teardown() {

assert_command dfx canister --no-wallet call --query e2e_project_assets get '(record{key="/text-with-newlines.txt";accept_encodings=vec{"identity"}})'

assert_command dfx canister --no-wallet call --query e2e_project_assets get_chunk '(record{key="/text-with-newlines.txt";content_encoding="identity";index=0;sha256=vec { 243; 191; 114; 177; 83; 18; 144; 121; 131; 38; 109; 183; 89; 244; 120; 136; 53; 187; 14; 74; 8; 112; 86; 100; 115; 8; 179; 155; 69; 78; 95; 160; }})'
assert_command dfx canister --no-wallet call --query e2e_project_assets get_chunk '(record{key="/text-with-newlines.txt";content_encoding="identity";index=0;sha256=opt vec { 243; 191; 114; 177; 83; 18; 144; 121; 131; 38; 109; 183; 89; 244; 120; 136; 53; 187; 14; 74; 8; 112; 86; 100; 115; 8; 179; 155; 69; 78; 95; 160; }})'
assert_command dfx canister --no-wallet call --query e2e_project_assets get_chunk '(record{key="/text-with-newlines.txt";content_encoding="identity";index=0})'
assert_command_fail dfx canister --no-wallet call --query e2e_project_assets get_chunk '(record{key="/text-with-newlines.txt";content_encoding="identity";index=0;sha256=vec { 88; 87; 86; }})'
assert_command_fail dfx canister --no-wallet call --query e2e_project_assets get_chunk '(record{key="/text-with-newlines.txt";content_encoding="identity";index=0;sha256=opt vec { 88; 87; 86; }})'
assert_match 'sha256 mismatch'

assert_command dfx canister --no-wallet call --query e2e_project_assets http_request_streaming_callback '(record{key="/text-with-newlines.txt";content_encoding="identity";index=0;sha256=vec { 243; 191; 114; 177; 83; 18; 144; 121; 131; 38; 109; 183; 89; 244; 120; 136; 53; 187; 14; 74; 8; 112; 86; 100; 115; 8; 179; 155; 69; 78; 95; 160; }})'
assert_command dfx canister --no-wallet call --query e2e_project_assets http_request_streaming_callback '(record{key="/text-with-newlines.txt";content_encoding="identity";index=0;sha256=opt vec { 243; 191; 114; 177; 83; 18; 144; 121; 131; 38; 109; 183; 89; 244; 120; 136; 53; 187; 14; 74; 8; 112; 86; 100; 115; 8; 179; 155; 69; 78; 95; 160; }})'
assert_command dfx canister --no-wallet call --query e2e_project_assets http_request_streaming_callback '(record{key="/text-with-newlines.txt";content_encoding="identity";index=0})'
assert_command_fail dfx canister --no-wallet call --query e2e_project_assets http_request_streaming_callback '(record{key="/text-with-newlines.txt";content_encoding="identity";index=0;sha256=vec { 88; 87; 86; }})'
assert_command_fail dfx canister --no-wallet call --query e2e_project_assets http_request_streaming_callback '(record{key="/text-with-newlines.txt";content_encoding="identity";index=0;sha256=opt vec { 88; 87; 86; }})'
assert_match 'sha256 mismatch'

}
Expand All @@ -197,7 +197,7 @@ teardown() {
assert_eq '(blob "\b8\01 \80\0aw12 \00xy\0aKL\0b\0ajk")'

assert_command dfx canister call --query e2e_project_assets retrieve '("/text-with-newlines.txt")' --output idl
assert_eq '(blob "cherries\0ait'\''s cherry season\0aCHERRIES")'
assert_eq '(blob "cherries\0ait\27s cherry season\0aCHERRIES")'

assert_command dfx canister call --update e2e_project_assets store '(record{key="AA"; content_type="text/plain"; content_encoding="identity"; content=blob "hello, world!"})'
assert_eq '()'
Expand Down
14 changes: 7 additions & 7 deletions e2e/tests-dfx/basic-project.bash
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ teardown() {
dfx canister install hello

assert_command dfx canister call hello read
assert_eq "(0)"
assert_eq "(0 : nat)"

assert_command dfx canister call hello inc
assert_eq "()"

assert_command dfx canister call hello read
assert_eq "(1)"
assert_eq "(1 : nat)"

dfx canister call hello inc
assert_command dfx canister call hello read
assert_eq "(2)"
assert_eq "(2 : nat)"

assert_command dfx canister call hello read --output raw
assert_eq "4449444c00017d02"
Expand All @@ -77,7 +77,7 @@ teardown() {

dfx canister call hello inc
assert_command dfx canister call --query hello read
assert_eq "(3)"
assert_eq "(3 : nat)"

assert_command dfx canister call hello inc --async
assert_command dfx canister request-status "$stdout" "$(dfx canister id hello)"
Expand All @@ -90,7 +90,7 @@ teardown() {
# Call with user Identity as Sender
assert_command dfx canister --no-wallet call hello read --async
assert_command dfx canister request-status "$stdout" "$(dfx canister id hello)"
assert_eq "(1_337)"
assert_eq "(1_337 : nat)"

# Call using the wallet's call forwarding
assert_command dfx canister --wallet="$(dfx identity get-wallet)" call hello read --async
Expand All @@ -107,7 +107,7 @@ teardown() {
dfx canister install --all

assert_command dfx canister call hello inc '(42,false,"testzZ",vec{1;2;3},opt record{head=42; tail=opt record{head=+43; tail=null}}, variant { cons=record{ 42; variant { cons=record{43; variant { nil }} } } })' --output idl
assert_eq "(43, true, \"uftu{[\", vec { 2; 3; 4;}, opt record { head = 43; tail = opt record { head = 44; tail = null;};}, variant { cons = record { 43; variant { cons = record { 44; variant { nil };} };} })"
assert_eq "(43 : int, true, \"uftu{[\", vec { 2 : nat; 3 : nat; 4 : nat;}, opt record { head = 43 : int; tail = opt record { head = 44 : int; tail = null;};}, variant { cons = record { 43 : int; variant { cons = record { 44 : int; variant { nil };} };} })"
}

@test "build + install + call -- matrix_multiply_mo" {
Expand All @@ -118,5 +118,5 @@ teardown() {
dfx canister install --all

assert_command dfx canister call hello multiply '(vec{vec{1;2};vec{3;4};vec{5;6}},vec{vec{1;2;3};vec{4;5;6}})'
assert_eq "(vec { vec { 9; 12; 15 }; vec { 19; 26; 33 }; vec { 29; 40; 51 } })"
assert_eq "( vec { vec { 9 : int; 12 : int; 15 : int }; vec { 19 : int; 26 : int; 33 : int }; vec { 29 : int; 40 : int; 51 : int }; }, )"
}
2 changes: 1 addition & 1 deletion e2e/tests-dfx/build_granular.bash
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ teardown() {
assert_eq '(blob "\b8\01 \80\0aw12 \00xy\0aKL\0b\0ajk")'

assert_command dfx canister call --query e2e_project_assets retrieve '("/text-with-newlines.txt")' --output idl
assert_eq '(blob "cherries\0ait'\''s cherry season\0aCHERRIES")'
assert_eq '(blob "cherries\0ait\27s cherry season\0aCHERRIES")'
}

@test "cyclic dependencies are detected" {
Expand Down
2 changes: 1 addition & 1 deletion nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"agent-rs": {
"branch": "main",
"repo": "https://github.com/dfinity/agent-rs",
"rev": "de2e774e4afb39dd06db00d390ec2dbbc5a51597",
"rev": "c6543eb3a2a9df0c706092de75f8888331ae81b1",
"type": "git"
},
"bats-support": {
Expand Down
14 changes: 5 additions & 9 deletions src/dfx/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ actix-web = { version = "3.0.2", features = [ "default", "openssl", "rustls" ] }
anyhow = "1.0.34"
atty = "0.2.13"
base64 = "0.11.0"
candid = { version = "0.6.20", features = [ "random" ] }
candid = { version = "0.7.1", features = [ "random" ] }
chrono = "0.4.9"
clap = "3.0.0-beta.2"
console = "0.7.7"
Expand All @@ -36,6 +36,7 @@ futures = "0.3.5"
futures-intrusive = "0.4.0"
garcon = { version = "0.2", features = ["async"] }
hex = {version = "0.4.2", features = ["serde"] }
ic-types = "0.2.0"
indicatif = "0.13.0"
lazy-init = "0.5.0"
lazy_static = "1.4.0"
Expand Down Expand Up @@ -78,23 +79,18 @@ webpki-roots = "0.21.0"
[dependencies.ic-agent]
version = "0.5.1"
git = "https://github.com/dfinity/agent-rs.git"
rev = "de2e774e4afb39dd06db00d390ec2dbbc5a51597"
rev = "c6543eb3a2a9df0c706092de75f8888331ae81b1"
features = ["reqwest"]

[dependencies.ic-identity-hsm]
version = "0.3.2"
git = "https://github.com/dfinity/agent-rs.git"
rev = "de2e774e4afb39dd06db00d390ec2dbbc5a51597"

[dependencies.ic-types]
version = "0.1.4"
git = "https://github.com/dfinity/agent-rs.git"
rev = "de2e774e4afb39dd06db00d390ec2dbbc5a51597"
rev = "c6543eb3a2a9df0c706092de75f8888331ae81b1"

[dependencies.ic-utils]
version = "0.3.2"
git = "https://github.com/dfinity/agent-rs.git"
rev = "de2e774e4afb39dd06db00d390ec2dbbc5a51597"
rev = "c6543eb3a2a9df0c706092de75f8888331ae81b1"

[dev-dependencies]
env_logger = "0.6"
Expand Down
2 changes: 1 addition & 1 deletion src/dfx/src/commands/wallet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::lib::root_key::fetch_root_key_if_needed;
use crate::lib::waiter::waiter_with_timeout;
use crate::util::expiry_duration;

use candid::de::ArgumentDecoder;
use candid::utils::ArgumentDecoder;
use candid::CandidType;
use clap::Clap;
use ic_utils::call::SyncCall;
Expand Down
2 changes: 1 addition & 1 deletion src/dfx/src/lib/operations/canister/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use crate::lib::identity::Identity;
use crate::lib::waiter::waiter_with_timeout;

use anyhow::anyhow;
use candid::de::ArgumentDecoder;
use candid::utils::ArgumentDecoder;
use candid::CandidType;
use ic_types::principal::Principal as CanisterId;
use ic_types::Principal;
Expand Down