Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Boa to remove critical bug and add many new ECMAScript Features including async/await and Promises #817

Merged
merged 2 commits into from
Dec 8, 2022
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
4 changes: 2 additions & 2 deletions canisters/ledger/address/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { blob, Principal } from '../../../index';
import { getCrc32 } from '@dfinity/principal/lib/esm/utils/getCrc';
import { sha224 } from 'hash.js';
import { sha224 } from 'js-sha256';
import { Address } from '../index';

// TODO we need to review these heavily
Expand Down Expand Up @@ -50,7 +50,7 @@ function address_from_principal(
const subaccountBytes = getSubAccountArray(subaccount);

const hash = new Uint8Array(
sha224()
sha224
.update([...prefixBytes, ...principalBytes, ...subaccountBytes])
.digest()
);
Expand Down
2 changes: 1 addition & 1 deletion examples/date/src/index.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
service : {
service : () -> {
get_date : (text) -> (nat32) query;
get_day : (text) -> (nat32) query;
get_full_year : (text) -> (nat32) query;
Expand Down
3 changes: 2 additions & 1 deletion examples/imports/package-lock.json

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

3 changes: 2 additions & 1 deletion examples/imports/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"test": "ts-node --transpile-only --ignore=false test/test.ts"
},
"dependencies": {
"azle": "0.8.0"
"azle": "0.8.0",
"js-sha256": "0.9.0"
},
"devDependencies": {
"@dfinity/agent": "0.11.1",
Expand Down
2 changes: 1 addition & 1 deletion examples/imports/src/imports.did
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
service : {
service : () -> {
getOne : () -> (text) query;
getThree : () -> (text) query;
getTwo : () -> (text) query;
Expand Down
4 changes: 2 additions & 2 deletions examples/imports/src/imports.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Query } from 'azle';
import { one, two, three } from './library';
import { sha224 } from 'hash.js';
import { sha224 } from 'js-sha256';

export function getOne(): Query<string> {
return one();
Expand All @@ -15,5 +15,5 @@ export function getThree(): Query<string> {
}

export function sha224Hash(message: string): Query<string> {
return sha224().update(message).digest('hex');
return sha224.update(message).hex();
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
type Archive = record { canister_id : principal };
type Archives = record { archives : vec Archive };
type AzleInline11804335565527792297 = record {
to : vec nat8;
fee : Tokens;
from : vec nat8;
amount : Tokens;
};
type AzleInline12373753716509696688 = record {
from : vec nat8;
amount : Tokens;
Expand All @@ -16,10 +10,16 @@ type AzleInline14801010896561872351 = record {
requested_index : nat64;
first_valid_index : nat64;
};
type AzleInline15497265404079156732 = record { to : vec nat8; amount : Tokens };
type AzleInline16382696833118207597 = record { balance : Tokens };
type AzleInline2802593598360289448 = record { duplicate_of : nat64 };
type AzleInline3751257598229003272 = record { to : vec nat8; amount : Tokens };
type AzleInline437713155240343969 = record {
type AzleInline4311096731304566805 = record {
to : vec nat8;
fee : Tokens;
from : vec nat8;
amount : Tokens;
};
type AzleInline5573285044870263930 = record {
callback : func (GetBlocksArgs) -> (
variant { Ok : BlockRange; Err : QueryArchiveError },
) query;
Expand All @@ -46,8 +46,8 @@ type GetNameResult = variant { ok : text; err : text };
type GetTransferFeeResult = variant { ok : TransferFee; err : text };
type Operation = variant {
Burn : AzleInline12373753716509696688;
Mint : AzleInline3751257598229003272;
Transfer : AzleInline11804335565527792297;
Mint : AzleInline15497265404079156732;
Transfer : AzleInline4311096731304566805;
};
type QueryArchiveError = variant {
BadFirstBlockIndex : AzleInline14801010896561872351;
Expand All @@ -58,7 +58,7 @@ type QueryBlocksResponse = record {
blocks : vec Block;
chain_length : nat64;
first_block_index : nat64;
archived_blocks : vec AzleInline437713155240343969;
archived_blocks : vec AzleInline5573285044870263930;
};
type TimeStamp = record { timestamp_nanos : nat64 };
type Tokens = record { e8s : nat64 };
Expand Down
35 changes: 4 additions & 31 deletions package-lock.json

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

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"azle-syn": "0.0.0",
"esbuild": "0.14.25",
"fs-extra": "10.0.1",
"hash.js": "1.1.7",
"js-sha256": "0.9.0",
"ts-node": "10.3.1",
"typescript": "4.4.4"
Expand Down
Loading