Skip to content

Commit

Permalink
Update quicksort to functional runtime syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
dansteren committed Sep 25, 2023
1 parent 9adec96 commit a5b6f47
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
# "examples/generics",
# "examples/ledger_canister",
# "examples/manual_reply",
# "examples/motoko_examples/quicksort",
# "examples/motoko_examples/simple-to-do",
# "examples/motoko_examples/superheroes",
# "examples/motoko_examples/threshold_ecdsa",
Expand Down Expand Up @@ -113,6 +112,7 @@ jobs:
"examples/motoko_examples/minimal-counter-dapp",
"examples/motoko_examples/persistent-storage",
"examples/motoko_examples/phone-book",
"examples/motoko_examples/quicksort",
"examples/primitive_types",
"examples/principal",
"examples/query",
Expand Down
3 changes: 2 additions & 1 deletion examples/motoko_examples/quicksort/dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"root": "src",
"ts": "src/index.ts",
"candid": "src/index.did",
"wasm": ".azle/quicksort/quicksort.wasm.gz",
"wasm": ".azle/quicksort/quicksort.wasm",
"gzip": true,
"declarations": {
"output": "test/dfx_generated/quicksort",
"node_compatibility": true
Expand Down
9 changes: 4 additions & 5 deletions examples/motoko_examples/quicksort/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import { int, Vec, query, Service } from 'azle';
import { Int } from './comparison';
import * as Quicksort from './quicksort';

export default class extends Service {
@query([Vec(int)], Vec(int))
sort(xs: Vec<int>): Vec<int> {
export default Service({
sort: query([Vec(int)], Vec(int), (xs: Vec<int>) => {
return Quicksort.sortBy(xs, Int.compare);
}
}
})
});

0 comments on commit a5b6f47

Please sign in to comment.