Cyrill Leutwiler 1 жил өмнө
parent
commit
d409c1e152
53 өөрчлөгдсөн 109 нэмэгдсэн , 7 устгасан
  1. 6 6
      Cargo.toml
  2. 2 0
      integration/anchor/tests/call_anchor.spec.ts
  3. 2 0
      integration/polkadot/UniswapV2ERC20.spec.ts
  4. 2 0
      integration/polkadot/UniswapV2Factory.spec.ts
  5. 2 0
      integration/polkadot/UniswapV2Pair.spec.ts
  6. 2 0
      integration/polkadot/array_struct_mapping_storage.spec.ts
  7. 2 0
      integration/polkadot/arrays.spec.ts
  8. 2 0
      integration/polkadot/asserts.spec.ts
  9. 2 0
      integration/polkadot/balances.spec.ts
  10. 2 0
      integration/polkadot/builtins.spec.ts
  11. 2 0
      integration/polkadot/builtins2.spec.ts
  12. 2 0
      integration/polkadot/call_flags.spec.ts
  13. 2 0
      integration/polkadot/caller_is_root.spec.ts
  14. 2 0
      integration/polkadot/chain_extension.spec.ts
  15. 2 0
      integration/polkadot/constructor_dispatch.spec.ts
  16. 2 0
      integration/polkadot/create_contract.spec.ts
  17. 2 0
      integration/polkadot/debug_buffer_format.spec.ts
  18. 2 0
      integration/polkadot/delegate_call.spec.ts
  19. 2 0
      integration/polkadot/destruct.spec.ts
  20. 2 0
      integration/polkadot/events.spec.ts
  21. 2 0
      integration/polkadot/external_call.spec.ts
  22. 2 0
      integration/polkadot/flipper.spec.ts
  23. 2 0
      integration/polkadot/index.ts
  24. 2 0
      integration/polkadot/ink_cross_calls.spec.ts
  25. 2 0
      integration/polkadot/is_contract.spec.ts
  26. 2 0
      integration/polkadot/issue666.spec.ts
  27. 2 0
      integration/polkadot/msg_sender.spec.ts
  28. 2 0
      integration/polkadot/overloading.spec.ts
  29. 2 0
      integration/polkadot/primitives.spec.ts
  30. 2 0
      integration/polkadot/release_version.spec.ts
  31. 2 0
      integration/polkadot/runtime_errors.spec.ts
  32. 2 0
      integration/polkadot/set_code_hash.spec.ts
  33. 2 0
      integration/polkadot/store.spec.ts
  34. 2 0
      integration/polkadot/structs.spec.ts
  35. 2 0
      integration/polkadot/tornado.spec.ts
  36. 2 0
      integration/polkadot/try_catch.spec.ts
  37. 2 0
      integration/polkadot/upgradeable_proxy.spec.ts
  38. 2 0
      integration/solana/simple.spec.ts
  39. 1 1
      src/abi/polkadot.rs
  40. 2 0
      vscode/src/client/extension.ts
  41. 2 0
      vscode/src/server/server.ts
  42. 2 0
      vscode/src/test/runTest.ts
  43. 2 0
      vscode/src/test/suite/extension.test.ts
  44. 2 0
      vscode/src/test/suite/helper.ts
  45. 2 0
      vscode/src/test/suite/index.ts
  46. 2 0
      vscode/src/utils/download.ts
  47. 2 0
      vscode/src/utils/downloadFile.ts
  48. 2 0
      vscode/src/utils/downloadWithRetryDialog.ts
  49. 2 0
      vscode/src/utils/executableVersion.ts
  50. 2 0
      vscode/src/utils/expandPathResolving.ts
  51. 2 0
      vscode/src/utils/fetchLatestRelease.ts
  52. 2 0
      vscode/src/utils/getPlatform.ts
  53. 2 0
      vscode/src/utils/getServer.ts

+ 6 - 6
Cargo.toml

@@ -31,9 +31,9 @@ serde_derive = { version = "1.0" }
 inkwell = { version = "0.4.0", features = ["target-webassembly", "no-libffi-linking", "llvm16-0"], optional = true }
 blake2-rfc = "0.2.18"
 handlebars = "5.1"
-contract-metadata = "3.2"
+contract-metadata = "4.0.2"
 semver = { version = "1.0", features = ["serde"] }
-tempfile = "3.9"
+tempfile = "3.10"
 libc = { version = "0.2", optional = true }
 tower-lsp = { version = "0.20", optional = true }
 tokio = { version = "1.27", features = ["rt", "io-std", "macros"], optional = true }
@@ -58,11 +58,11 @@ ink_env = "5.0.0"
 ink_metadata = "5.0.0"
 scale-info = "2.10"
 petgraph = "0.6"
-wasmparser = "0.121.0"
-wasm-encoder = "0.41"
+wasmparser = "0.202.0"
+wasm-encoder = "0.202"
 toml = "0.8"
-wasm-opt = { version = "0.113.0", optional = true }
-contract-build = { version = "3.2", optional = true }
+wasm-opt = { version = "0.116.0", default-features = false, optional = true }
+contract-build = { version = "4.0.2", optional = true }
 primitive-types = { version = "0.12", features = ["codec"] }
 normalize-path = "0.2.1"
 bitflags = "2.4"

+ 2 - 0
integration/anchor/tests/call_anchor.spec.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import expect from 'expect';
 import { AnchorProvider, Program } from '@coral-xyz/anchor';
 import {

+ 2 - 0
integration/polkadot/UniswapV2ERC20.spec.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import expect from 'expect';
 import { weight, createConnection, deploy, transaction, aliceKeypair, daveKeypair, query } from './index';
 import { ContractPromise } from '@polkadot/api-contract';

+ 2 - 0
integration/polkadot/UniswapV2Factory.spec.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import expect from 'expect';
 import { weight, createConnection, deploy, transaction, aliceKeypair, daveKeypair, query } from './index';
 import { ContractPromise } from '@polkadot/api-contract';

+ 2 - 0
integration/polkadot/UniswapV2Pair.spec.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import expect from 'expect';
 import { weight, query, createConnection, deploy, transaction, aliceKeypair, daveKeypair } from './index';
 import { ContractPromise } from '@polkadot/api-contract';

+ 2 - 0
integration/polkadot/array_struct_mapping_storage.spec.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import expect from 'expect';
 import { weight, createConnection, deploy, aliceKeypair, transaction, query } from './index';
 import { ContractPromise } from '@polkadot/api-contract';

+ 2 - 0
integration/polkadot/arrays.spec.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import expect from 'expect';
 import crypto from 'crypto';
 import { createConnection, deploy, transaction, aliceKeypair, weight, query, } from './index';

+ 2 - 0
integration/polkadot/asserts.spec.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import expect from 'expect';
 import { weight, createConnection, deploy, transaction, aliceKeypair, query, } from './index';
 import { ContractPromise } from '@polkadot/api-contract';

+ 2 - 0
integration/polkadot/balances.spec.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import expect from 'expect';
 import { weight, createConnection, deploy, transaction, aliceKeypair, daveKeypair, query } from './index';
 import { ContractPromise } from '@polkadot/api-contract';

+ 2 - 0
integration/polkadot/builtins.spec.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import expect from 'expect';
 import { createConnection, deploy, transaction, aliceKeypair, query, } from './index';
 import { ContractPromise } from '@polkadot/api-contract';

+ 2 - 0
integration/polkadot/builtins2.spec.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import expect from 'expect';
 import { createConnection, deploy, aliceKeypair, weight, query } from './index';
 import { ContractPromise } from '@polkadot/api-contract';

+ 2 - 0
integration/polkadot/call_flags.spec.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import expect from 'expect';
 import { createConnection, deploy, aliceKeypair, query, debug_buffer, } from './index';
 import { ContractPromise } from '@polkadot/api-contract';

+ 2 - 0
integration/polkadot/caller_is_root.spec.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import expect from 'expect';
 import { createConnection, deploy, aliceKeypair, query, weight, transaction } from './index';
 import { ContractPromise } from '@polkadot/api-contract';

+ 2 - 0
integration/polkadot/chain_extension.spec.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import expect from 'expect';
 import { createConnection, deploy, aliceKeypair, query, } from './index';
 import { ContractPromise } from '@polkadot/api-contract';

+ 2 - 0
integration/polkadot/constructor_dispatch.spec.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import { createConnection, deploy, aliceKeypair, query, debug_buffer, weight, transaction, daveKeypair, } from './index';
 import { ContractPromise } from '@polkadot/api-contract';
 import { ApiPromise } from '@polkadot/api';

+ 2 - 0
integration/polkadot/create_contract.spec.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import expect from 'expect';
 import { weight, createConnection, deploy, transaction, aliceKeypair, query, debug_buffer, dry_run, } from './index';
 import { ContractPromise } from '@polkadot/api-contract';

+ 2 - 0
integration/polkadot/debug_buffer_format.spec.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import { createConnection, deploy, aliceKeypair, debug_buffer } from "./index";
 import expect from 'expect';
 import { ContractPromise } from "@polkadot/api-contract";

+ 2 - 0
integration/polkadot/delegate_call.spec.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import expect from 'expect';
 import { weight, createConnection, deploy, transaction, aliceKeypair, daveKeypair, debug_buffer, query, } from './index';
 import { ContractPromise } from '@polkadot/api-contract';

+ 2 - 0
integration/polkadot/destruct.spec.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import expect from 'expect';
 import { weight, createConnection, deploy, transaction, aliceKeypair, daveKeypair, query } from './index';
 import { ContractPromise } from '@polkadot/api-contract';

+ 2 - 0
integration/polkadot/events.spec.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import expect from 'expect';
 import { weight, createConnection, deploy, transaction, aliceKeypair, } from './index';
 import { ContractPromise } from '@polkadot/api-contract';

+ 2 - 0
integration/polkadot/external_call.spec.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import expect from 'expect';
 import { weight, createConnection, deploy, transaction, aliceKeypair, query, } from './index';
 import { ContractPromise } from '@polkadot/api-contract';

+ 2 - 0
integration/polkadot/flipper.spec.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import expect from 'expect';
 import { weight, createConnection, deploy, transaction, aliceKeypair, query, } from './index';
 import { ContractPromise } from '@polkadot/api-contract';

+ 2 - 0
integration/polkadot/index.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import '@polkadot/api-augment';
 import fs, { PathLike } from 'fs';
 import { ApiPromise, WsProvider, Keyring } from '@polkadot/api';

+ 2 - 0
integration/polkadot/ink_cross_calls.spec.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import expect from 'expect';
 import { weight, createConnection, deploy, transaction, aliceKeypair, query, } from './index';
 import { ContractPromise } from '@polkadot/api-contract';

+ 2 - 0
integration/polkadot/is_contract.spec.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import expect from 'expect';
 import { createConnection, deploy, aliceKeypair, query, } from './index';
 import { ContractPromise } from '@polkadot/api-contract';

+ 2 - 0
integration/polkadot/issue666.spec.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import expect from 'expect';
 import { weight, createConnection, deploy, transaction, aliceKeypair, } from './index';
 import { ContractPromise } from '@polkadot/api-contract';

+ 2 - 0
integration/polkadot/msg_sender.spec.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import expect from "expect";
 import { aliceKeypair, createConnection, deploy, weight, transaction, query } from "./index";
 import { ContractPromise } from "@polkadot/api-contract";

+ 2 - 0
integration/polkadot/overloading.spec.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import expect from 'expect';
 import { createConnection, deploy, transaction, aliceKeypair, query, } from './index';
 import { ContractPromise } from '@polkadot/api-contract';

+ 2 - 0
integration/polkadot/primitives.spec.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import expect from 'expect';
 import { createConnection, deploy, aliceKeypair, daveKeypair, query, } from './index';
 import { ContractPromise } from '@polkadot/api-contract';

+ 2 - 0
integration/polkadot/release_version.spec.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import { createConnection, deploy, aliceKeypair, debug_buffer } from "./index";
 import expect from 'expect';
 import { ContractPromise } from "@polkadot/api-contract";

+ 2 - 0
integration/polkadot/runtime_errors.spec.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import { createConnection, deploy, aliceKeypair, debug_buffer } from "./index";
 import expect from 'expect';
 import { ContractPromise } from "@polkadot/api-contract";

+ 2 - 0
integration/polkadot/set_code_hash.spec.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import expect from 'expect';
 import { createConnection, deploy, aliceKeypair, query, debug_buffer, weight, transaction, } from './index';
 import { ContractPromise } from '@polkadot/api-contract';

+ 2 - 0
integration/polkadot/store.spec.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import expect from 'expect';
 import { weight, createConnection, deploy, transaction, aliceKeypair, } from './index';
 import { ContractPromise } from '@polkadot/api-contract';

+ 2 - 0
integration/polkadot/structs.spec.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import expect from 'expect';
 import { createConnection, deploy, transaction, aliceKeypair, weight, query, } from './index';
 import { ContractPromise } from '@polkadot/api-contract';

+ 2 - 0
integration/polkadot/tornado.spec.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 // Tests against the tornado cash core contracts.
 // The tornado contracts used here contain minor mechanical changes to work fine on Polkadot.
 // The ZK-SNARK setup is the same as ETH Tornado on mainnet.

+ 2 - 0
integration/polkadot/try_catch.spec.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import expect from 'expect';
 import { createConnection, deploy, aliceKeypair, query, } from './index';
 import { ContractPromise } from '@polkadot/api-contract';

+ 2 - 0
integration/polkadot/upgradeable_proxy.spec.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import expect from 'expect';
 import { weight, createConnection, deploy, transaction, aliceKeypair, query, } from './index';
 import { ContractPromise } from '@polkadot/api-contract';

+ 2 - 0
integration/solana/simple.spec.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import expect from 'expect';
 import { loadContractAndCallConstructor } from './setup';
 import crypto from 'crypto';

+ 1 - 1
src/abi/polkadot.rs

@@ -606,5 +606,5 @@ pub fn metadata(
     let project_json = serde_json::to_value(gen_project(contract_no, ns)).unwrap();
     let abi = serde_json::from_value(project_json).unwrap();
 
-    serde_json::to_value(ContractMetadata::new(source, contract, None, abi)).unwrap()
+    serde_json::to_value(ContractMetadata::new(source, contract, None, None, abi)).unwrap()
 }

+ 2 - 0
vscode/src/client/extension.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 // The module 'vscode' contains the VS Code extensibility API
 // Import the module and reference it with the alias vscode in your code below
 import * as vscode from 'vscode';

+ 2 - 0
vscode/src/server/server.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import { createConnection, InitializeResult, DefinitionRequest } from 'vscode-languageserver';
 import * as rpc from 'vscode-jsonrpc';
 

+ 2 - 0
vscode/src/test/runTest.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import * as path from 'path';
 
 import { runTests } from '@vscode/test-electron';

+ 2 - 0
vscode/src/test/suite/extension.test.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import * as assert from 'assert';
 
 import * as vscode from 'vscode';

+ 2 - 0
vscode/src/test/suite/helper.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import * as vscode from 'vscode';
 import * as path from 'path';
 

+ 2 - 0
vscode/src/test/suite/index.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import * as path from 'path';
 import * as Mocha from 'mocha';
 import * as glob from 'glob';

+ 2 - 0
vscode/src/utils/download.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import * as vscode from 'vscode';
 import * as path from 'path';
 import * as crypto from 'crypto';

+ 2 - 0
vscode/src/utils/downloadFile.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import fetch from 'node-fetch';
 import { PathLike, createWriteStream } from 'fs';
 import * as stream from 'stream';

+ 2 - 0
vscode/src/utils/downloadWithRetryDialog.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import * as vscode from 'vscode';
 
 export default async function downloadWithRetryDialog<T>(downloadFunc: () => Promise<T>): Promise<T> {

+ 2 - 0
vscode/src/utils/executableVersion.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import { spawnSync } from 'child_process';
 
 export default function executableVersion(path: string): string | undefined {

+ 2 - 0
vscode/src/utils/expandPathResolving.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import { homedir } from 'os';
 
 export default function expandPathResolving(path: string): string {

+ 2 - 0
vscode/src/utils/fetchLatestRelease.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import fetch from 'node-fetch';
 
 export default async function fetchLatestRelease() {

+ 2 - 0
vscode/src/utils/getPlatform.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 export default function getPlatform(): string | undefined {
   switch (`${process.arch} ${process.platform}`) {
     case 'x64 win32':

+ 2 - 0
vscode/src/utils/getServer.ts

@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: Apache-2.0
+
 import * as vscode from 'vscode';
 import * as path from 'path';
 import { promises as fs } from 'fs';