difftreelog
NFTPAR-93 SIT: Flipper smart contract can be deployed, getting of value works, flipping works.
in: master
15 files changed
purge-running-node.shdiffbeforeafterboth--- /dev/null
+++ b/purge-running-node.sh
@@ -0,0 +1,3 @@
+docker-compose exec node nft purge-chain --dev --base-path=/chain-data -y
+docker-compose down
+docker-compose up -d
tests/flipper-src/.gitignorediffbeforeafterboth--- /dev/null
+++ b/tests/flipper-src/.gitignore
@@ -0,0 +1,9 @@
+# Ignore build artifacts from the local tests sub-crate.
+/target/
+
+# Ignore backup files creates by cargo fmt.
+**/*.rs.bk
+
+# Remove Cargo.lock when creating an executable, leave it for libraries
+# More information here http://doc.crates.io/guide.html#cargotoml-vs-cargolock
+Cargo.lock
tests/flipper-src/.ink/abi_gen/Cargo.tomldiffbeforeafterboth--- /dev/null
+++ b/tests/flipper-src/.ink/abi_gen/Cargo.toml
@@ -0,0 +1,16 @@
+[package]
+name = "abi-gen"
+version = "0.1.0"
+authors = ["Parity Technologies <admin@parity.io>"]
+edition = "2018"
+publish = false
+
+[[bin]]
+name = "abi-gen"
+path = "main.rs"
+
+[dependencies]
+contract = { path = "../..", package = "flipper", default-features = false, features = ["ink-generate-abi"] }
+ink_lang = { version = "2", git = "https://github.com/paritytech/ink", tag = "latest-v2", package = "ink_lang", default-features = false, features = ["ink-generate-abi"] }
+serde = "1.0"
+serde_json = "1.0"
tests/flipper-src/.ink/abi_gen/main.rsdiffbeforeafterboth--- /dev/null
+++ b/tests/flipper-src/.ink/abi_gen/main.rs
@@ -0,0 +1,7 @@
+fn main() -> Result<(), std::io::Error> {
+ let abi = <contract::Flipper as ink_lang::GenerateAbi>::generate_abi();
+ let contents = serde_json::to_string_pretty(&abi)?;
+ std::fs::create_dir("target").ok();
+ std::fs::write("target/metadata.json", contents)?;
+ Ok(())
+}
tests/flipper-src/Cargo.tomldiffbeforeafterboth--- /dev/null
+++ b/tests/flipper-src/Cargo.toml
@@ -0,0 +1,67 @@
+[package]
+name = "flipper"
+version = "0.1.0"
+authors = ["[your_name] <[your_email]>"]
+edition = "2018"
+
+[dependencies]
+ink_abi = { version = "2", git = "https://github.com/paritytech/ink", tag = "latest-v2", package = "ink_abi", default-features = false, features = ["derive"], optional = true }
+ink_primitives = { version = "2", git = "https://github.com/paritytech/ink", tag = "latest-v2", package = "ink_primitives", default-features = false }
+ink_core = { version = "2", git = "https://github.com/paritytech/ink", tag = "latest-v2", package = "ink_core", default-features = false }
+ink_lang = { version = "2", git = "https://github.com/paritytech/ink", tag = "latest-v2", package = "ink_lang", default-features = false }
+
+scale = { package = "parity-scale-codec", version = "1.2", default-features = false, features = ["derive"] }
+
+[dependencies.type-metadata]
+git = "https://github.com/type-metadata/type-metadata.git"
+rev = "02eae9f35c40c943b56af5b60616219f2b72b47d"
+default-features = false
+features = ["derive"]
+optional = true
+
+[lib]
+name = "flipper"
+path = "lib.rs"
+crate-type = [
+ # Used for normal contract Wasm blobs.
+ "cdylib",
+ # Required for ABI generation, and using this contract as a dependency.
+ # If using `cargo contract build`, it will be automatically disabled to produce a smaller Wasm binary
+ "rlib",
+]
+
+[features]
+default = ["test-env"]
+std = [
+ "ink_abi/std",
+ "ink_core/std",
+ "ink_primitives/std",
+ "scale/std",
+ "type-metadata/std",
+]
+test-env = [
+ "std",
+ "ink_lang/test-env",
+]
+ink-generate-abi = [
+ "std",
+ "ink_abi",
+ "type-metadata",
+ "ink_core/ink-generate-abi",
+ "ink_lang/ink-generate-abi",
+]
+ink-as-dependency = []
+
+[profile.release]
+panic = "abort"
+lto = true
+opt-level = "z"
+overflow-checks = true
+
+[workspace]
+members = [
+ ".ink/abi_gen"
+]
+exclude = [
+ ".ink"
+]
tests/flipper-src/build.shdiffbeforeafterboth--- /dev/null
+++ b/tests/flipper-src/build.sh
@@ -0,0 +1,2 @@
+cargo +nightly contract build
+cargo +nightly contract generate-metadata
tests/flipper-src/lib.rsdiffbeforeafterboth--- /dev/null
+++ b/tests/flipper-src/lib.rs
@@ -0,0 +1,76 @@
+#![cfg_attr(not(feature = "std"), no_std)]
+
+use ink_lang as ink;
+
+#[ink::contract(version = "0.1.0")]
+mod flipper {
+ use ink_core::storage;
+
+ /// Defines the storage of your contract.
+ /// Add new fields to the below struct in order
+ /// to add new static storage fields to your contract.
+ #[ink(storage)]
+ struct Flipper {
+ /// Stores a single `bool` value on the storage.
+ value: storage::Value<bool>,
+ }
+
+ impl Flipper {
+ /// Constructor that initializes the `bool` value to the given `init_value`.
+ #[ink(constructor)]
+ fn new(&mut self, init_value: bool) {
+ self.value.set(init_value);
+ }
+
+ /// Constructor that initializes the `bool` value to `false`.
+ ///
+ /// Constructors can delegate to other constructors.
+ #[ink(constructor)]
+ fn default(&mut self) {
+ self.new(false)
+ }
+
+ /// A message that can be called on instantiated contracts.
+ /// This one flips the value of the stored `bool` from `true`
+ /// to `false` and vice versa.
+ #[ink(message)]
+ fn flip(&mut self) {
+ *self.value = !self.get();
+ }
+
+ /// Simply returns the current value of our `bool`.
+ #[ink(message)]
+ fn get(&self) -> bool {
+ *self.value
+ }
+ }
+
+ /// Unit tests in Rust are normally defined within such a `#[cfg(test)]`
+ /// module and test functions are marked with a `#[test]` attribute.
+ /// The below code is technically just normal Rust code.
+ #[cfg(test)]
+ mod tests {
+ /// Imports all the definitions from the outer scope so we can use them here.
+ use super::*;
+
+ /// We test if the default constructor does its job.
+ #[test]
+ fn default_works() {
+ // Note that even though we defined our `#[ink(constructor)]`
+ // above as `&mut self` functions that return nothing we can call
+ // them in test code as if they were normal Rust constructors
+ // that take no `self` argument but return `Self`.
+ let flipper = Flipper::default();
+ assert_eq!(flipper.get(), false);
+ }
+
+ /// We test a simple use case of our contract.
+ #[test]
+ fn it_works() {
+ let mut flipper = Flipper::new(false);
+ assert_eq!(flipper.get(), false);
+ flipper.flip();
+ assert_eq!(flipper.get(), true);
+ }
+ }
+}
tests/package-lock.jsondiffbeforeafterboth3916 }3916 }3917 },3917 },3918 "@polkadot/api": {3918 "@polkadot/api": {3919 "version": "1.31.2",3919 "version": "1.34.1",3920 "resolved": "https://registry.npmjs.org/@polkadot/api/-/api-1.31.2.tgz",3920 "resolved": "https://registry.npmjs.org/@polkadot/api/-/api-1.34.1.tgz",3921 "integrity": "sha512-5nMraRQYFt+xeInQi5i7c00fwOiSeZgU3Y1LJWz+z+Vnxep7xzjVBMLgBi4fe7g2eWKUYB79ApFNV8r2thsQZg==",3921 "integrity": "sha512-3gCibNRchH+XbEdULS1bwiV1RgarZW1PDw1Y1mAQBVqPrUpkYqntp1D52SQOpAbRzldkwk296Sj+mx9/IeDRXA==",3922 "requires": {3922 "requires": {3923 "@babel/runtime": "^7.11.2",3923 "@babel/runtime": "^7.11.2",3924 "@polkadot/api-derive": "1.31.2",3924 "@polkadot/api-derive": "1.34.1",3925 "@polkadot/keyring": "^3.4.1",3925 "@polkadot/keyring": "^3.4.1",3926 "@polkadot/metadata": "1.31.2",3926 "@polkadot/metadata": "1.34.1",3927 "@polkadot/rpc-core": "1.31.2",3927 "@polkadot/rpc-core": "1.34.1",3928 "@polkadot/rpc-provider": "1.31.2",3928 "@polkadot/rpc-provider": "1.34.1",3929 "@polkadot/types": "1.31.2",3929 "@polkadot/types": "1.34.1",3930 "@polkadot/types-known": "1.31.2",3930 "@polkadot/types-known": "1.34.1",3931 "@polkadot/util": "^3.4.1",3931 "@polkadot/util": "^3.4.1",3932 "@polkadot/util-crypto": "^3.4.1",3932 "@polkadot/util-crypto": "^3.4.1",3933 "bn.js": "^5.1.3",3933 "bn.js": "^5.1.3",3934 "eventemitter3": "^4.0.6",3934 "eventemitter3": "^4.0.7",3935 "rxjs": "^6.6.2"3935 "rxjs": "^6.6.3"3936 },3936 },3937 "dependencies": {3937 "dependencies": {3938 "@polkadot/metadata": {3938 "@polkadot/metadata": {3939 "version": "1.31.2",3939 "version": "1.34.1",3940 "resolved": "https://registry.npmjs.org/@polkadot/metadata/-/metadata-1.31.2.tgz",3940 "resolved": "https://registry.npmjs.org/@polkadot/metadata/-/metadata-1.34.1.tgz",3941 "integrity": "sha512-UAcZLxh6QFwhF2Ccmax6LUYa99NntBZrAe8oUN92UJlHbtAutd5sq322P+liG2EHfyhUZs5T5v8jLD79pMTjdA==",3941 "integrity": "sha512-uoaOhNHjECDaLBYvGRaLvF0mhZBFmsV3oikYDP4sZx3a5oD0xYsyXtr5bFPQDImwPFASP8/ltrMVqcYTX42xFg==",3942 "requires": {3942 "requires": {3943 "@babel/runtime": "^7.11.2",3943 "@babel/runtime": "^7.11.2",3944 "@polkadot/types": "1.31.2",3944 "@polkadot/types": "1.34.1",3945 "@polkadot/types-known": "1.31.2",3945 "@polkadot/types-known": "1.34.1",3946 "@polkadot/util": "^3.4.1",3946 "@polkadot/util": "^3.4.1",3947 "@polkadot/util-crypto": "^3.4.1",3947 "@polkadot/util-crypto": "^3.4.1",3948 "bn.js": "^5.1.3"3948 "bn.js": "^5.1.3"3949 }3949 }3950 },3950 },3951 "@polkadot/types": {3951 "@polkadot/types": {3952 "version": "1.31.2",3952 "version": "1.34.1",3953 "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-1.31.2.tgz",3953 "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-1.34.1.tgz",3954 "integrity": "sha512-eJsWdMzBlkYYrowR7tl9LYvGW3Za05esDQPxPxc1z2kkwzU2IoX2qijhUb6J9ViESY/h0jWFyEbV/1mBn4uupg==",3954 "integrity": "sha512-jPwix2y+ZXKYB4ghODXlqYmcI3Tnsl3iO3xIkiGsZhhs9PdrKibcNeAv4LUiRpPuGRnAM+mrlPrBbCuzguKSGg==",3955 "requires": {3955 "requires": {3956 "@babel/runtime": "^7.11.2",3956 "@babel/runtime": "^7.11.2",3957 "@polkadot/metadata": "1.31.2",3957 "@polkadot/metadata": "1.34.1",3958 "@polkadot/util": "^3.4.1",3958 "@polkadot/util": "^3.4.1",3959 "@polkadot/util-crypto": "^3.4.1",3959 "@polkadot/util-crypto": "^3.4.1",3960 "@types/bn.js": "^4.11.6",3960 "@types/bn.js": "^4.11.6",3961 "bn.js": "^5.1.3",3961 "bn.js": "^5.1.3",3962 "memoizee": "^0.4.14",3962 "memoizee": "^0.4.14",3963 "rxjs": "^6.6.2"3963 "rxjs": "^6.6.3"3964 }3964 }3965 },3965 },3966 "@polkadot/types-known": {3966 "@polkadot/types-known": {3967 "version": "1.31.2",3967 "version": "1.34.1",3968 "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-1.31.2.tgz",3968 "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-1.34.1.tgz",3969 "integrity": "sha512-sA9IEwYNCsN+Z4eZklxOluJA5OBN2eGNvLz0uUQ6TFvqbi9Z8Mba+h+RZU1iFO6+yq2U7ECvdWzET6RN7zv+oQ==",3969 "integrity": "sha512-H9V8u9cqbKjxU/dxEyLl7kJwoBImXpRskQ5+X0fq3BH7g1nQ6jrIg/buRPpbc3GxKivdFYUZWshPY9hbqE8y8A==",3970 "requires": {3970 "requires": {3971 "@babel/runtime": "^7.11.2",3971 "@babel/runtime": "^7.11.2",3972 "@polkadot/types": "1.31.2",3972 "@polkadot/types": "1.34.1",3973 "@polkadot/util": "^3.4.1",3973 "@polkadot/util": "^3.4.1",3974 "bn.js": "^5.1.3"3974 "bn.js": "^5.1.3"3975 }3975 }3989 }3989 }3990 }3990 }3991 },3991 },3992 "@polkadot/api-contract": {3993 "version": "1.34.1",3994 "resolved": "https://registry.npmjs.org/@polkadot/api-contract/-/api-contract-1.34.1.tgz",3995 "integrity": "sha512-oXh7An6E9wdbczXQhw+TfIkoKLQr4t0j3OwxubrhS5Qn6f99xGoAkk0BIKjsHPGIbMHEJoywmmLrDUAeTxExgg==",3996 "requires": {3997 "@babel/runtime": "^7.11.2",3998 "@polkadot/api": "1.34.1",3999 "@polkadot/rpc-core": "1.34.1",4000 "@polkadot/types": "1.34.1",4001 "@polkadot/util": "^3.4.1",4002 "bn.js": "^5.1.3",4003 "rxjs": "^6.6.3"4004 },4005 "dependencies": {4006 "@polkadot/api": {4007 "version": "1.34.1",4008 "resolved": "https://registry.npmjs.org/@polkadot/api/-/api-1.34.1.tgz",4009 "integrity": "sha512-3gCibNRchH+XbEdULS1bwiV1RgarZW1PDw1Y1mAQBVqPrUpkYqntp1D52SQOpAbRzldkwk296Sj+mx9/IeDRXA==",4010 "requires": {4011 "@babel/runtime": "^7.11.2",4012 "@polkadot/api-derive": "1.34.1",4013 "@polkadot/keyring": "^3.4.1",4014 "@polkadot/metadata": "1.34.1",4015 "@polkadot/rpc-core": "1.34.1",4016 "@polkadot/rpc-provider": "1.34.1",4017 "@polkadot/types": "1.34.1",4018 "@polkadot/types-known": "1.34.1",4019 "@polkadot/util": "^3.4.1",4020 "@polkadot/util-crypto": "^3.4.1",4021 "bn.js": "^5.1.3",4022 "eventemitter3": "^4.0.7",4023 "rxjs": "^6.6.3"4024 }4025 },4026 "@polkadot/api-derive": {4027 "version": "1.34.1",4028 "resolved": "https://registry.npmjs.org/@polkadot/api-derive/-/api-derive-1.34.1.tgz",4029 "integrity": "sha512-LMlCkNJRp29MwKa36crYuY6cZpnkHCFrPCv9dmJEuDbMqrK+EAhXM9/6sTDYJ4uKNhyetJKe9rXslkXdI6pidA==",4030 "requires": {4031 "@babel/runtime": "^7.11.2",4032 "@polkadot/api": "1.34.1",4033 "@polkadot/rpc-core": "1.34.1",4034 "@polkadot/rpc-provider": "1.34.1",4035 "@polkadot/types": "1.34.1",4036 "@polkadot/util": "^3.4.1",4037 "@polkadot/util-crypto": "^3.4.1",4038 "bn.js": "^5.1.3",4039 "memoizee": "^0.4.14",4040 "rxjs": "^6.6.3"4041 }4042 },4043 "@polkadot/metadata": {4044 "version": "1.34.1",4045 "resolved": "https://registry.npmjs.org/@polkadot/metadata/-/metadata-1.34.1.tgz",4046 "integrity": "sha512-uoaOhNHjECDaLBYvGRaLvF0mhZBFmsV3oikYDP4sZx3a5oD0xYsyXtr5bFPQDImwPFASP8/ltrMVqcYTX42xFg==",4047 "requires": {4048 "@babel/runtime": "^7.11.2",4049 "@polkadot/types": "1.34.1",4050 "@polkadot/types-known": "1.34.1",4051 "@polkadot/util": "^3.4.1",4052 "@polkadot/util-crypto": "^3.4.1",4053 "bn.js": "^5.1.3"4054 }4055 },4056 "@polkadot/rpc-core": {4057 "version": "1.34.1",4058 "resolved": "https://registry.npmjs.org/@polkadot/rpc-core/-/rpc-core-1.34.1.tgz",4059 "integrity": "sha512-BVQDyBEkbRe5b/u8p9UPpTCj0sDZ32sTmPEP43Klc4s9+oHtiNvOFYvkjK5oyW9dlcOwXi8HpLsQxGAeMtM7Tw==",4060 "requires": {4061 "@babel/runtime": "^7.11.2",4062 "@polkadot/metadata": "1.34.1",4063 "@polkadot/rpc-provider": "1.34.1",4064 "@polkadot/types": "1.34.1",4065 "@polkadot/util": "^3.4.1",4066 "memoizee": "^0.4.14",4067 "rxjs": "^6.6.3"4068 }4069 },4070 "@polkadot/rpc-provider": {4071 "version": "1.34.1",4072 "resolved": "https://registry.npmjs.org/@polkadot/rpc-provider/-/rpc-provider-1.34.1.tgz",4073 "integrity": "sha512-bebeis9mB4LS9Spk1WSHoadZHsyHmK4gyyC6uKSLZxHZmnopWna6zWnOBIrYHRz7qDHSZC5eNTseuU8NJXtscA==",4074 "requires": {4075 "@babel/runtime": "^7.11.2",4076 "@polkadot/metadata": "1.34.1",4077 "@polkadot/types": "1.34.1",4078 "@polkadot/util": "^3.4.1",4079 "@polkadot/util-crypto": "^3.4.1",4080 "@polkadot/x-fetch": "^0.3.2",4081 "@polkadot/x-ws": "^0.3.2",4082 "bn.js": "^5.1.3",4083 "eventemitter3": "^4.0.7"4084 }4085 },4086 "@polkadot/types": {4087 "version": "1.34.1",4088 "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-1.34.1.tgz",4089 "integrity": "sha512-jPwix2y+ZXKYB4ghODXlqYmcI3Tnsl3iO3xIkiGsZhhs9PdrKibcNeAv4LUiRpPuGRnAM+mrlPrBbCuzguKSGg==",4090 "requires": {4091 "@babel/runtime": "^7.11.2",4092 "@polkadot/metadata": "1.34.1",4093 "@polkadot/util": "^3.4.1",4094 "@polkadot/util-crypto": "^3.4.1",4095 "@types/bn.js": "^4.11.6",4096 "bn.js": "^5.1.3",4097 "memoizee": "^0.4.14",4098 "rxjs": "^6.6.3"4099 }4100 },4101 "@polkadot/types-known": {4102 "version": "1.34.1",4103 "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-1.34.1.tgz",4104 "integrity": "sha512-H9V8u9cqbKjxU/dxEyLl7kJwoBImXpRskQ5+X0fq3BH7g1nQ6jrIg/buRPpbc3GxKivdFYUZWshPY9hbqE8y8A==",4105 "requires": {4106 "@babel/runtime": "^7.11.2",4107 "@polkadot/types": "1.34.1",4108 "@polkadot/util": "^3.4.1",4109 "bn.js": "^5.1.3"4110 }4111 },4112 "@polkadot/util": {4113 "version": "3.4.1",4114 "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-3.4.1.tgz",4115 "integrity": "sha512-CJo0wAzXR8vjAzs9mHDooZr5a3XRW8LlYWik8d/+bv1VDwCC/metSiBrYBOapFhYUjlS5IYIw5bhWS5dnpkXvQ==",4116 "requires": {4117 "@babel/runtime": "^7.11.2",4118 "@types/bn.js": "^4.11.6",4119 "bn.js": "^5.1.3",4120 "camelcase": "^5.3.1",4121 "chalk": "^4.1.0",4122 "ip-regex": "^4.1.0"4123 }4124 }4125 }4126 },3992 "@polkadot/api-derive": {4127 "@polkadot/api-derive": {3993 "version": "1.31.2",4128 "version": "1.34.1",3994 "resolved": "https://registry.npmjs.org/@polkadot/api-derive/-/api-derive-1.31.2.tgz",4129 "resolved": "https://registry.npmjs.org/@polkadot/api-derive/-/api-derive-1.34.1.tgz",3995 "integrity": "sha512-j33elEBZpY7/ucsBRYdUxeWHID8vlvPKm7k9dWgaH8txYuzms0SFfkMHyECgo15SL+RTNhu/VxzSRWryk6dvTA==",4130 "integrity": "sha512-LMlCkNJRp29MwKa36crYuY6cZpnkHCFrPCv9dmJEuDbMqrK+EAhXM9/6sTDYJ4uKNhyetJKe9rXslkXdI6pidA==",3996 "requires": {4131 "requires": {3997 "@babel/runtime": "^7.11.2",4132 "@babel/runtime": "^7.11.2",3998 "@polkadot/api": "1.31.2",4133 "@polkadot/api": "1.34.1",3999 "@polkadot/rpc-core": "1.31.2",4134 "@polkadot/rpc-core": "1.34.1",4000 "@polkadot/rpc-provider": "1.31.2",4135 "@polkadot/rpc-provider": "1.34.1",4001 "@polkadot/types": "1.31.2",4136 "@polkadot/types": "1.34.1",4002 "@polkadot/util": "^3.4.1",4137 "@polkadot/util": "^3.4.1",4003 "@polkadot/util-crypto": "^3.4.1",4138 "@polkadot/util-crypto": "^3.4.1",4004 "bn.js": "^5.1.3",4139 "bn.js": "^5.1.3",4005 "memoizee": "^0.4.14",4140 "memoizee": "^0.4.14",4006 "rxjs": "^6.6.2"4141 "rxjs": "^6.6.3"4007 },4142 },4008 "dependencies": {4143 "dependencies": {4009 "@polkadot/metadata": {4144 "@polkadot/metadata": {4010 "version": "1.31.2",4145 "version": "1.34.1",4011 "resolved": "https://registry.npmjs.org/@polkadot/metadata/-/metadata-1.31.2.tgz",4146 "resolved": "https://registry.npmjs.org/@polkadot/metadata/-/metadata-1.34.1.tgz",4012 "integrity": "sha512-UAcZLxh6QFwhF2Ccmax6LUYa99NntBZrAe8oUN92UJlHbtAutd5sq322P+liG2EHfyhUZs5T5v8jLD79pMTjdA==",4147 "integrity": "sha512-uoaOhNHjECDaLBYvGRaLvF0mhZBFmsV3oikYDP4sZx3a5oD0xYsyXtr5bFPQDImwPFASP8/ltrMVqcYTX42xFg==",4013 "requires": {4148 "requires": {4014 "@babel/runtime": "^7.11.2",4149 "@babel/runtime": "^7.11.2",4015 "@polkadot/types": "1.31.2",4150 "@polkadot/types": "1.34.1",4016 "@polkadot/types-known": "1.31.2",4151 "@polkadot/types-known": "1.34.1",4017 "@polkadot/util": "^3.4.1",4152 "@polkadot/util": "^3.4.1",4018 "@polkadot/util-crypto": "^3.4.1",4153 "@polkadot/util-crypto": "^3.4.1",4019 "bn.js": "^5.1.3"4154 "bn.js": "^5.1.3"4020 }4155 }4021 },4156 },4022 "@polkadot/types": {4157 "@polkadot/types": {4023 "version": "1.31.2",4158 "version": "1.34.1",4024 "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-1.31.2.tgz",4159 "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-1.34.1.tgz",4025 "integrity": "sha512-eJsWdMzBlkYYrowR7tl9LYvGW3Za05esDQPxPxc1z2kkwzU2IoX2qijhUb6J9ViESY/h0jWFyEbV/1mBn4uupg==",4160 "integrity": "sha512-jPwix2y+ZXKYB4ghODXlqYmcI3Tnsl3iO3xIkiGsZhhs9PdrKibcNeAv4LUiRpPuGRnAM+mrlPrBbCuzguKSGg==",4026 "requires": {4161 "requires": {4027 "@babel/runtime": "^7.11.2",4162 "@babel/runtime": "^7.11.2",4028 "@polkadot/metadata": "1.31.2",4163 "@polkadot/metadata": "1.34.1",4029 "@polkadot/util": "^3.4.1",4164 "@polkadot/util": "^3.4.1",4030 "@polkadot/util-crypto": "^3.4.1",4165 "@polkadot/util-crypto": "^3.4.1",4031 "@types/bn.js": "^4.11.6",4166 "@types/bn.js": "^4.11.6",4032 "bn.js": "^5.1.3",4167 "bn.js": "^5.1.3",4033 "memoizee": "^0.4.14",4168 "memoizee": "^0.4.14",4034 "rxjs": "^6.6.2"4169 "rxjs": "^6.6.3"4035 }4170 }4036 },4171 },4037 "@polkadot/types-known": {4172 "@polkadot/types-known": {4038 "version": "1.31.2",4173 "version": "1.34.1",4039 "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-1.31.2.tgz",4174 "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-1.34.1.tgz",4040 "integrity": "sha512-sA9IEwYNCsN+Z4eZklxOluJA5OBN2eGNvLz0uUQ6TFvqbi9Z8Mba+h+RZU1iFO6+yq2U7ECvdWzET6RN7zv+oQ==",4175 "integrity": "sha512-H9V8u9cqbKjxU/dxEyLl7kJwoBImXpRskQ5+X0fq3BH7g1nQ6jrIg/buRPpbc3GxKivdFYUZWshPY9hbqE8y8A==",4041 "requires": {4176 "requires": {4042 "@babel/runtime": "^7.11.2",4177 "@babel/runtime": "^7.11.2",4043 "@polkadot/types": "1.31.2",4178 "@polkadot/types": "1.34.1",4044 "@polkadot/util": "^3.4.1",4179 "@polkadot/util": "^3.4.1",4045 "bn.js": "^5.1.3"4180 "bn.js": "^5.1.3"4046 }4181 }4167 }4302 }4168 },4303 },4169 "@polkadot/metadata": {4304 "@polkadot/metadata": {4170 "version": "1.32.1",4305 "version": "1.34.1",4171 "resolved": "https://registry.npmjs.org/@polkadot/metadata/-/metadata-1.32.1.tgz",4306 "resolved": "https://registry.npmjs.org/@polkadot/metadata/-/metadata-1.34.1.tgz",4172 "integrity": "sha512-0naYURBGYOMKF+z7RxOtIfhwziqIZ3GgXzYDRDra6goq72c4uykwpMUjkrJ07N9KaKBZsHmkn2k3v7pP5aqlzg==",4307 "integrity": "sha512-uoaOhNHjECDaLBYvGRaLvF0mhZBFmsV3oikYDP4sZx3a5oD0xYsyXtr5bFPQDImwPFASP8/ltrMVqcYTX42xFg==",4173 "requires": {4308 "requires": {4174 "@babel/runtime": "^7.11.2",4309 "@babel/runtime": "^7.11.2",4175 "@polkadot/types": "1.32.1",4310 "@polkadot/types": "1.34.1",4176 "@polkadot/types-known": "1.32.1",4311 "@polkadot/types-known": "1.34.1",4177 "@polkadot/util": "^3.4.1",4312 "@polkadot/util": "^3.4.1",4178 "@polkadot/util-crypto": "^3.4.1",4313 "@polkadot/util-crypto": "^3.4.1",4179 "bn.js": "^5.1.3"4314 "bn.js": "^5.1.3"4195 }4330 }4196 },4331 },4197 "@polkadot/rpc-core": {4332 "@polkadot/rpc-core": {4198 "version": "1.31.2",4333 "version": "1.34.1",4199 "resolved": "https://registry.npmjs.org/@polkadot/rpc-core/-/rpc-core-1.31.2.tgz",4334 "resolved": "https://registry.npmjs.org/@polkadot/rpc-core/-/rpc-core-1.34.1.tgz",4200 "integrity": "sha512-amFN0UtxB94TnXVuL9oBSQDFheCrxUN6C/lmVlOBqnWj6ZA1RDAuPPJBNIjhSxNlGmJxS2yIexaCVKgF8kS8Cg==",4335 "integrity": "sha512-BVQDyBEkbRe5b/u8p9UPpTCj0sDZ32sTmPEP43Klc4s9+oHtiNvOFYvkjK5oyW9dlcOwXi8HpLsQxGAeMtM7Tw==",4201 "requires": {4336 "requires": {4202 "@babel/runtime": "^7.11.2",4337 "@babel/runtime": "^7.11.2",4203 "@polkadot/metadata": "1.31.2",4338 "@polkadot/metadata": "1.34.1",4204 "@polkadot/rpc-provider": "1.31.2",4339 "@polkadot/rpc-provider": "1.34.1",4205 "@polkadot/types": "1.31.2",4340 "@polkadot/types": "1.34.1",4206 "@polkadot/util": "^3.4.1",4341 "@polkadot/util": "^3.4.1",4207 "memoizee": "^0.4.14",4342 "memoizee": "^0.4.14",4208 "rxjs": "^6.6.2"4343 "rxjs": "^6.6.3"4209 },4344 },4210 "dependencies": {4345 "dependencies": {4211 "@polkadot/metadata": {4346 "@polkadot/metadata": {4212 "version": "1.31.2",4347 "version": "1.34.1",4213 "resolved": "https://registry.npmjs.org/@polkadot/metadata/-/metadata-1.31.2.tgz",4348 "resolved": "https://registry.npmjs.org/@polkadot/metadata/-/metadata-1.34.1.tgz",4214 "integrity": "sha512-UAcZLxh6QFwhF2Ccmax6LUYa99NntBZrAe8oUN92UJlHbtAutd5sq322P+liG2EHfyhUZs5T5v8jLD79pMTjdA==",4349 "integrity": "sha512-uoaOhNHjECDaLBYvGRaLvF0mhZBFmsV3oikYDP4sZx3a5oD0xYsyXtr5bFPQDImwPFASP8/ltrMVqcYTX42xFg==",4215 "requires": {4350 "requires": {4216 "@babel/runtime": "^7.11.2",4351 "@babel/runtime": "^7.11.2",4217 "@polkadot/types": "1.31.2",4352 "@polkadot/types": "1.34.1",4218 "@polkadot/types-known": "1.31.2",4353 "@polkadot/types-known": "1.34.1",4219 "@polkadot/util": "^3.4.1",4354 "@polkadot/util": "^3.4.1",4220 "@polkadot/util-crypto": "^3.4.1",4355 "@polkadot/util-crypto": "^3.4.1",4221 "bn.js": "^5.1.3"4356 "bn.js": "^5.1.3"4222 }4357 }4223 },4358 },4224 "@polkadot/types": {4359 "@polkadot/types": {4225 "version": "1.31.2",4360 "version": "1.34.1",4226 "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-1.31.2.tgz",4361 "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-1.34.1.tgz",4227 "integrity": "sha512-eJsWdMzBlkYYrowR7tl9LYvGW3Za05esDQPxPxc1z2kkwzU2IoX2qijhUb6J9ViESY/h0jWFyEbV/1mBn4uupg==",4362 "integrity": "sha512-jPwix2y+ZXKYB4ghODXlqYmcI3Tnsl3iO3xIkiGsZhhs9PdrKibcNeAv4LUiRpPuGRnAM+mrlPrBbCuzguKSGg==",4228 "requires": {4363 "requires": {4229 "@babel/runtime": "^7.11.2",4364 "@babel/runtime": "^7.11.2",4230 "@polkadot/metadata": "1.31.2",4365 "@polkadot/metadata": "1.34.1",4231 "@polkadot/util": "^3.4.1",4366 "@polkadot/util": "^3.4.1",4232 "@polkadot/util-crypto": "^3.4.1",4367 "@polkadot/util-crypto": "^3.4.1",4233 "@types/bn.js": "^4.11.6",4368 "@types/bn.js": "^4.11.6",4234 "bn.js": "^5.1.3",4369 "bn.js": "^5.1.3",4235 "memoizee": "^0.4.14",4370 "memoizee": "^0.4.14",4236 "rxjs": "^6.6.2"4371 "rxjs": "^6.6.3"4237 }4372 }4238 },4373 },4239 "@polkadot/types-known": {4374 "@polkadot/types-known": {4240 "version": "1.31.2",4375 "version": "1.34.1",4241 "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-1.31.2.tgz",4376 "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-1.34.1.tgz",4242 "integrity": "sha512-sA9IEwYNCsN+Z4eZklxOluJA5OBN2eGNvLz0uUQ6TFvqbi9Z8Mba+h+RZU1iFO6+yq2U7ECvdWzET6RN7zv+oQ==",4377 "integrity": "sha512-H9V8u9cqbKjxU/dxEyLl7kJwoBImXpRskQ5+X0fq3BH7g1nQ6jrIg/buRPpbc3GxKivdFYUZWshPY9hbqE8y8A==",4243 "requires": {4378 "requires": {4244 "@babel/runtime": "^7.11.2",4379 "@babel/runtime": "^7.11.2",4245 "@polkadot/types": "1.31.2",4380 "@polkadot/types": "1.34.1",4246 "@polkadot/util": "^3.4.1",4381 "@polkadot/util": "^3.4.1",4247 "bn.js": "^5.1.3"4382 "bn.js": "^5.1.3"4248 }4383 }4263 }4398 }4264 },4399 },4265 "@polkadot/rpc-provider": {4400 "@polkadot/rpc-provider": {4266 "version": "1.31.2",4401 "version": "1.34.1",4267 "resolved": "https://registry.npmjs.org/@polkadot/rpc-provider/-/rpc-provider-1.31.2.tgz",4402 "resolved": "https://registry.npmjs.org/@polkadot/rpc-provider/-/rpc-provider-1.34.1.tgz",4268 "integrity": "sha512-vqS1lsk/BBGSuklGKJhJxduKXOyXjc/kZzPWmmH8B92Zh59LqlzoJ8a4gQIjDr0CFjeJZbaaL1yRhE6qwaEe2A==",4403 "integrity": "sha512-bebeis9mB4LS9Spk1WSHoadZHsyHmK4gyyC6uKSLZxHZmnopWna6zWnOBIrYHRz7qDHSZC5eNTseuU8NJXtscA==",4269 "requires": {4404 "requires": {4270 "@babel/runtime": "^7.11.2",4405 "@babel/runtime": "^7.11.2",4271 "@polkadot/metadata": "1.31.2",4406 "@polkadot/metadata": "1.34.1",4272 "@polkadot/types": "1.31.2",4407 "@polkadot/types": "1.34.1",4273 "@polkadot/util": "^3.4.1",4408 "@polkadot/util": "^3.4.1",4274 "@polkadot/util-crypto": "^3.4.1",4409 "@polkadot/util-crypto": "^3.4.1",4275 "bn.js": "^5.1.3",4410 "@polkadot/x-fetch": "^0.3.2",4276 "eventemitter3": "^4.0.6",4411 "@polkadot/x-ws": "^0.3.2",4277 "isomorphic-fetch": "^2.2.1",4412 "bn.js": "^5.1.3",4278 "websocket": "^1.0.31"4413 "eventemitter3": "^4.0.7"4279 },4414 },4280 "dependencies": {4415 "dependencies": {4281 "@polkadot/metadata": {4416 "@polkadot/metadata": {4282 "version": "1.31.2",4417 "version": "1.34.1",4283 "resolved": "https://registry.npmjs.org/@polkadot/metadata/-/metadata-1.31.2.tgz",4418 "resolved": "https://registry.npmjs.org/@polkadot/metadata/-/metadata-1.34.1.tgz",4284 "integrity": "sha512-UAcZLxh6QFwhF2Ccmax6LUYa99NntBZrAe8oUN92UJlHbtAutd5sq322P+liG2EHfyhUZs5T5v8jLD79pMTjdA==",4419 "integrity": "sha512-uoaOhNHjECDaLBYvGRaLvF0mhZBFmsV3oikYDP4sZx3a5oD0xYsyXtr5bFPQDImwPFASP8/ltrMVqcYTX42xFg==",4285 "requires": {4420 "requires": {4286 "@babel/runtime": "^7.11.2",4421 "@babel/runtime": "^7.11.2",4287 "@polkadot/types": "1.31.2",4422 "@polkadot/types": "1.34.1",4288 "@polkadot/types-known": "1.31.2",4423 "@polkadot/types-known": "1.34.1",4289 "@polkadot/util": "^3.4.1",4424 "@polkadot/util": "^3.4.1",4290 "@polkadot/util-crypto": "^3.4.1",4425 "@polkadot/util-crypto": "^3.4.1",4291 "bn.js": "^5.1.3"4426 "bn.js": "^5.1.3"4292 }4427 }4293 },4428 },4294 "@polkadot/types": {4429 "@polkadot/types": {4295 "version": "1.31.2",4430 "version": "1.34.1",4296 "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-1.31.2.tgz",4431 "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-1.34.1.tgz",4297 "integrity": "sha512-eJsWdMzBlkYYrowR7tl9LYvGW3Za05esDQPxPxc1z2kkwzU2IoX2qijhUb6J9ViESY/h0jWFyEbV/1mBn4uupg==",4432 "integrity": "sha512-jPwix2y+ZXKYB4ghODXlqYmcI3Tnsl3iO3xIkiGsZhhs9PdrKibcNeAv4LUiRpPuGRnAM+mrlPrBbCuzguKSGg==",4298 "requires": {4433 "requires": {4299 "@babel/runtime": "^7.11.2",4434 "@babel/runtime": "^7.11.2",4300 "@polkadot/metadata": "1.31.2",4435 "@polkadot/metadata": "1.34.1",4301 "@polkadot/util": "^3.4.1",4436 "@polkadot/util": "^3.4.1",4302 "@polkadot/util-crypto": "^3.4.1",4437 "@polkadot/util-crypto": "^3.4.1",4303 "@types/bn.js": "^4.11.6",4438 "@types/bn.js": "^4.11.6",4304 "bn.js": "^5.1.3",4439 "bn.js": "^5.1.3",4305 "memoizee": "^0.4.14",4440 "memoizee": "^0.4.14",4306 "rxjs": "^6.6.2"4441 "rxjs": "^6.6.3"4307 }4442 }4308 },4443 },4309 "@polkadot/types-known": {4444 "@polkadot/types-known": {4310 "version": "1.31.2",4445 "version": "1.34.1",4311 "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-1.31.2.tgz",4446 "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-1.34.1.tgz",4312 "integrity": "sha512-sA9IEwYNCsN+Z4eZklxOluJA5OBN2eGNvLz0uUQ6TFvqbi9Z8Mba+h+RZU1iFO6+yq2U7ECvdWzET6RN7zv+oQ==",4447 "integrity": "sha512-H9V8u9cqbKjxU/dxEyLl7kJwoBImXpRskQ5+X0fq3BH7g1nQ6jrIg/buRPpbc3GxKivdFYUZWshPY9hbqE8y8A==",4313 "requires": {4448 "requires": {4314 "@babel/runtime": "^7.11.2",4449 "@babel/runtime": "^7.11.2",4315 "@polkadot/types": "1.31.2",4450 "@polkadot/types": "1.34.1",4316 "@polkadot/util": "^3.4.1",4451 "@polkadot/util": "^3.4.1",4317 "bn.js": "^5.1.3"4452 "bn.js": "^5.1.3"4318 }4453 }4342 }4477 }4343 },4478 },4344 "@polkadot/types": {4479 "@polkadot/types": {4345 "version": "1.32.1",4480 "version": "1.34.1",4346 "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-1.32.1.tgz",4481 "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-1.34.1.tgz",4347 "integrity": "sha512-n+77dHE5J3RqmnbOwMdAeQg5yv68/2qZ7JeBw/KjYtSnJoA2pbW7yL01zSkIUCJcaTb/yuSQz9SK7Cz9QQ6MOw==",4482 "integrity": "sha512-jPwix2y+ZXKYB4ghODXlqYmcI3Tnsl3iO3xIkiGsZhhs9PdrKibcNeAv4LUiRpPuGRnAM+mrlPrBbCuzguKSGg==",4348 "requires": {4483 "requires": {4349 "@babel/runtime": "^7.11.2",4484 "@babel/runtime": "^7.11.2",4350 "@polkadot/metadata": "1.32.1",4485 "@polkadot/metadata": "1.34.1",4351 "@polkadot/util": "^3.4.1",4486 "@polkadot/util": "^3.4.1",4352 "@polkadot/util-crypto": "^3.4.1",4487 "@polkadot/util-crypto": "^3.4.1",4353 "@types/bn.js": "^4.11.6",4488 "@types/bn.js": "^4.11.6",4354 "bn.js": "^5.1.3",4489 "bn.js": "^5.1.3",4355 "memoizee": "^0.4.14",4490 "memoizee": "^0.4.14",4356 "rxjs": "^6.6.2"4491 "rxjs": "^6.6.3"4357 },4492 },4358 "dependencies": {4493 "dependencies": {4359 "@polkadot/util": {4494 "@polkadot/util": {4372 }4507 }4373 },4508 },4374 "@polkadot/types-known": {4509 "@polkadot/types-known": {4375 "version": "1.32.1",4510 "version": "1.34.1",4376 "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-1.32.1.tgz",4511 "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-1.34.1.tgz",4377 "integrity": "sha512-Vv8m5w+v2nKjYIWEvjohW2xZd+v98bgKwzyl+Y7ssbnxMAYZQYkuzR8IDfUXyzcL+p9VF+YFExVnzCakMm756Q==",4512 "integrity": "sha512-H9V8u9cqbKjxU/dxEyLl7kJwoBImXpRskQ5+X0fq3BH7g1nQ6jrIg/buRPpbc3GxKivdFYUZWshPY9hbqE8y8A==",4378 "requires": {4513 "requires": {4379 "@babel/runtime": "^7.11.2",4514 "@babel/runtime": "^7.11.2",4380 "@polkadot/types": "1.32.1",4515 "@polkadot/types": "1.34.1",4381 "@polkadot/util": "^3.4.1",4516 "@polkadot/util": "^3.4.1",4382 "bn.js": "^5.1.3"4517 "bn.js": "^5.1.3"4383 },4518 },4398 }4533 }4399 },4534 },4400 "@polkadot/util": {4535 "@polkadot/util": {4401 "version": "2.18.1",4536 "version": "3.4.1",4402 "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-2.18.1.tgz",4537 "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-3.4.1.tgz",4403 "integrity": "sha512-0KAojJMR5KDaaobIyvHVuW9vBP5LG3S0vpRSovB4UPlGDok3ETJSm5lMhA0t2KM8C4gXGBakCotFVGSOvWGgjA==",4538 "integrity": "sha512-CJo0wAzXR8vjAzs9mHDooZr5a3XRW8LlYWik8d/+bv1VDwCC/metSiBrYBOapFhYUjlS5IYIw5bhWS5dnpkXvQ==",4404 "requires": {4539 "requires": {4405 "@babel/runtime": "^7.10.4",4540 "@babel/runtime": "^7.11.2",4406 "@types/bn.js": "^4.11.6",4541 "@types/bn.js": "^4.11.6",4407 "bn.js": "^5.1.2",4542 "bn.js": "^5.1.3",4408 "camelcase": "^5.3.1",4543 "camelcase": "^5.3.1",4409 "chalk": "^4.1.0",4544 "chalk": "^4.1.0",4410 "ip-regex": "^4.1.0"4545 "ip-regex": "^4.1.0"4450 "resolved": "https://registry.npmjs.org/@polkadot/wasm-crypto/-/wasm-crypto-1.4.1.tgz",4585 "resolved": "https://registry.npmjs.org/@polkadot/wasm-crypto/-/wasm-crypto-1.4.1.tgz",4451 "integrity": "sha512-GPBCh8YvQmA5bobI4rqRkUhrEHkEWU1+lcJVPbZYsa7jiHFaZpzCLrGQfiqW/vtbU1aBS2wmJ0x1nlt33B9QqQ=="4586 "integrity": "sha512-GPBCh8YvQmA5bobI4rqRkUhrEHkEWU1+lcJVPbZYsa7jiHFaZpzCLrGQfiqW/vtbU1aBS2wmJ0x1nlt33B9QqQ=="4452 },4587 },4588 "@polkadot/x-fetch": {4589 "version": "0.3.2",4590 "resolved": "https://registry.npmjs.org/@polkadot/x-fetch/-/x-fetch-0.3.2.tgz",4591 "integrity": "sha512-lk9M8ql/kBBqiZ8KOWj7LFK7P9OxDgVn2fZPNELJzQbfFZwFF8umBPDIWlQIK7wTnlRsQlzOuf6MGEyMK5p42w==",4592 "requires": {4593 "@babel/runtime": "^7.11.2",4594 "@types/node-fetch": "^2.5.7",4595 "node-fetch": "^2.6.1"4596 },4597 "dependencies": {4598 "node-fetch": {4599 "version": "2.6.1",4600 "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",4601 "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw=="4602 }4603 }4604 },4605 "@polkadot/x-ws": {4606 "version": "0.3.2",4607 "resolved": "https://registry.npmjs.org/@polkadot/x-ws/-/x-ws-0.3.2.tgz",4608 "integrity": "sha512-1aiG11Py8sgzJsz19melMzvBOn5zeMmfjCPoMryX4//063E0mcfnkujg4O6pTMygxJdFGAV1INB9wvMU9Dg9Wg==",4609 "requires": {4610 "@babel/runtime": "^7.11.2",4611 "@types/websocket": "^1.0.1",4612 "websocket": "^1.0.32"4613 }4614 },4453 "@sindresorhus/is": {4615 "@sindresorhus/is": {4454 "version": "0.14.0",4616 "version": "0.14.0",4455 "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz",4617 "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz",4667 "resolved": "https://registry.npmjs.org/@types/node/-/node-14.6.4.tgz",4829 "resolved": "https://registry.npmjs.org/@types/node/-/node-14.6.4.tgz",4668 "integrity": "sha512-Wk7nG1JSaMfMpoMJDKUsWYugliB2Vy55pdjLpmLixeyMi7HizW2I/9QoxsPCkXl3dO+ZOVqPumKaDUv5zJu2uQ=="4830 "integrity": "sha512-Wk7nG1JSaMfMpoMJDKUsWYugliB2Vy55pdjLpmLixeyMi7HizW2I/9QoxsPCkXl3dO+ZOVqPumKaDUv5zJu2uQ=="4669 },4831 },4832 "@types/node-fetch": {4833 "version": "2.5.7",4834 "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.7.tgz",4835 "integrity": "sha512-o2WVNf5UhWRkxlf6eq+jMZDu7kjgpgJfl4xVNlvryc95O/6F2ld8ztKX+qu+Rjyet93WAWm5LjeX9H5FGkODvw==",4836 "requires": {4837 "@types/node": "*",4838 "form-data": "^3.0.0"4839 },4840 "dependencies": {4841 "form-data": {4842 "version": "3.0.0",4843 "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz",4844 "integrity": "sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==",4845 "requires": {4846 "asynckit": "^0.4.0",4847 "combined-stream": "^1.0.8",4848 "mime-types": "^2.1.12"4849 }4850 }4851 }4852 },4670 "@types/normalize-package-data": {4853 "@types/normalize-package-data": {4671 "version": "2.4.0",4854 "version": "2.4.0",4672 "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz",4855 "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz",4691 "integrity": "sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw==",4874 "integrity": "sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw==",4692 "dev": true4875 "dev": true4693 },4876 },4877 "@types/websocket": {4878 "version": "1.0.1",4879 "resolved": "https://registry.npmjs.org/@types/websocket/-/websocket-1.0.1.tgz",4880 "integrity": "sha512-f5WLMpezwVxCLm1xQe/kdPpQIOmL0TXYx2O15VYfYzc7hTIdxiOoOvez+McSIw3b7z/1zGovew9YSL7+h4h7/Q==",4881 "requires": {4882 "@types/node": "*"4883 }4884 },4694 "@types/yargs": {4885 "@types/yargs": {4695 "version": "15.0.5",4886 "version": "15.0.5",4696 "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.5.tgz",4887 "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.5.tgz",5951 "asynckit": {6142 "asynckit": {5952 "version": "0.4.0",6143 "version": "0.4.0",5953 "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",6144 "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",5954 "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=",6145 "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="5955 "dev": true5956 },6146 },5957 "at-least-node": {6147 "at-least-node": {5958 "version": "1.0.0",6148 "version": "1.0.0",7364 "version": "1.0.8",7554 "version": "1.0.8",7365 "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",7555 "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",7366 "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",7556 "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",7367 "dev": true,7368 "requires": {7557 "requires": {7369 "delayed-stream": "~1.0.0"7558 "delayed-stream": "~1.0.0"7370 }7559 }9081 "delayed-stream": {9270 "delayed-stream": {9082 "version": "1.0.0",9271 "version": "1.0.0",9083 "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",9272 "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",9084 "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",9273 "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="9085 "dev": true9086 },9274 },9087 "delegate": {9275 "delegate": {9088 "version": "3.2.0",9276 "version": "3.2.0",9700 "version": "0.1.13",9888 "version": "0.1.13",9701 "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz",9889 "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz",9702 "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==",9890 "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==",9891 "dev": true,9703 "requires": {9892 "requires": {9704 "iconv-lite": "^0.6.2"9893 "iconv-lite": "^0.6.2"9705 }9894 }12954 "version": "0.6.2",13143 "version": "0.6.2",12955 "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.2.tgz",13144 "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.2.tgz",12956 "integrity": "sha512-2y91h5OpQlolefMPmUlivelittSWy0rP+oYVpn6A7GwVHNE8AWzoYOBNmlwks3LobaJxgHCYZAnyNo2GgpNRNQ==",13145 "integrity": "sha512-2y91h5OpQlolefMPmUlivelittSWy0rP+oYVpn6A7GwVHNE8AWzoYOBNmlwks3LobaJxgHCYZAnyNo2GgpNRNQ==",13146 "dev": true,12957 "requires": {13147 "requires": {12958 "safer-buffer": ">= 2.1.2 < 3.0.0"13148 "safer-buffer": ">= 2.1.2 < 3.0.0"12959 }13149 }13717 "is-stream": {13907 "is-stream": {13718 "version": "1.1.0",13908 "version": "1.1.0",13719 "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",13909 "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",13720 "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ="13910 "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=",13911 "dev": true13721 },13912 },13722 "is-string": {13913 "is-string": {13723 "version": "1.0.5",13914 "version": "1.0.5",13809 "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=",14000 "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=",13810 "dev": true14001 "dev": true13811 },14002 },13812 "isomorphic-fetch": {13813 "version": "2.2.1",13814 "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz",13815 "integrity": "sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=",13816 "requires": {13817 "node-fetch": "^1.0.1",13818 "whatwg-fetch": ">=0.10.0"13819 }13820 },13821 "isstream": {14003 "isstream": {13822 "version": "0.1.2",14004 "version": "0.1.2",13823 "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",14005 "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",15870 "mime-db": {16052 "mime-db": {15871 "version": "1.44.0",16053 "version": "1.44.0",15872 "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz",16054 "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz",15873 "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==",16055 "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg=="15874 "dev": true15875 },16056 },15876 "mime-types": {16057 "mime-types": {15877 "version": "2.1.27",16058 "version": "2.1.27",15878 "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz",16059 "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz",15879 "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==",16060 "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==",15880 "dev": true,15881 "requires": {16061 "requires": {15882 "mime-db": "1.44.0"16062 "mime-db": "1.44.0"15883 }16063 }16660 "lower-case": "^1.1.1"16840 "lower-case": "^1.1.1"16661 }16841 }16662 },16842 },16663 "node-fetch": {16664 "version": "1.7.3",16665 "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz",16666 "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==",16667 "requires": {16668 "encoding": "^0.1.11",16669 "is-stream": "^1.0.1"16670 }16671 },16672 "node-fetch-npm": {16843 "node-fetch-npm": {16673 "version": "2.0.4",16844 "version": "2.0.4",16674 "resolved": "https://registry.npmjs.org/node-fetch-npm/-/node-fetch-npm-2.0.4.tgz",16845 "resolved": "https://registry.npmjs.org/node-fetch-npm/-/node-fetch-npm-2.0.4.tgz",19728 "safer-buffer": {19899 "safer-buffer": {19729 "version": "2.1.2",19900 "version": "2.1.2",19730 "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",19901 "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",19731 "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="19902 "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",19903 "dev": true19732 },19904 },19733 "sane": {19905 "sane": {19734 "version": "4.1.0",19906 "version": "4.1.0",23598 }23770 }23599 }23771 }23600 },23772 },23601 "whatwg-fetch": {23602 "version": "3.4.1",23603 "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.4.1.tgz",23604 "integrity": "sha512-sofZVzE1wKwO+EYPbWfiwzaKovWiZXf4coEzjGP9b2GBVgQRLQUZ2QcuPpQExGDAW5GItpEm6Tl4OU5mywnAoQ=="23605 },23606 "whatwg-mimetype": {23773 "whatwg-mimetype": {23607 "version": "2.3.0",23774 "version": "2.3.0",23608 "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz",23775 "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz",tests/package.jsondiffbeforeafterboth--- a/tests/package.json
+++ b/tests/package.json
@@ -23,9 +23,10 @@
"license": "Apache 2.0",
"homepage": "",
"dependencies": {
- "@polkadot/api": "^1.31.2",
- "@polkadot/types": "^1.31.2",
- "@polkadot/util": "^2.18.1",
+ "@polkadot/api": "^1.34.1",
+ "@polkadot/api-contract": "^1.34.1",
+ "@polkadot/types": "^1.34.1",
+ "@polkadot/util": "^3.4.1",
"@types/bn.js": "^4.11.6",
"chai-as-promised": "^7.1.1"
},
tests/src/accounts.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/accounts.ts
@@ -0,0 +1,2 @@
+export const bobsPublicKey = '5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty';
+export const alicesPublicKey = '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY';
tests/src/deploy-flipper.test.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/deploy-flipper.test.ts
@@ -0,0 +1,102 @@
+import { expect } from "chai";
+import usingApi from "./substrate/substrate-api";
+import promisifySubstrate from "./substrate/promisify-substrate";
+import fs from "fs";
+import privateKey from "./substrate/privateKey";
+import { compactAddLength, u8aToU8a } from '@polkadot/util';
+import { Hash, AccountId } from "@polkadot/types/interfaces";
+import { Abi, PromiseContract } from "@polkadot/api-contract";
+import { ISubmittableResult } from "@polkadot/types/types";
+import BN from "bn.js";
+import { alicesPublicKey } from "./accounts";
+
+describe('Flipper', () => {
+ it(`Can deploy smart contract Flipper, instantiate it and call it's get and flip messages.`, async () => {
+ await usingApi(async api => {
+ const wasm = fs.readFileSync('./src/flipper/flipper.wasm');
+ const contract = compactAddLength(u8aToU8a(wasm));
+
+ const metadata = JSON.parse(fs.readFileSync('./src/flipper/metadata.json').toString('utf-8'));
+ const abi = new Abi(api.registry as any, metadata);
+
+ const alicesPrivateKey = privateKey('//Alice');
+
+ const contractHash = await promisifySubstrate(api, () => {
+ return new Promise<Hash>(async (resolve, reject) => {
+ const unsubscribe = api.tx.contracts.putCode(contract).signAndSend(alicesPrivateKey, async result => {
+ if(!result.isInBlock){
+ return;
+ }
+
+ const record = result.findRecord('contracts', 'CodeStored');
+
+ if(record) {
+ (await unsubscribe)();
+ resolve(record.event.data[0] as unknown as Hash);
+ } else {
+ reject('Failed to find contract hash in putCode transaction result.');
+ }
+ });
+ })
+ })();
+
+
+ const instanceAccountId = await promisifySubstrate(api, () => {
+ return new Promise<AccountId>((resolve, reject) => {
+ const args = abi.constructors[0](true);
+ const unsubscribe = api.tx.contracts.instantiate(1000000000000000n, 1000000000000n, contractHash, args)
+ .signAndSend(alicesPrivateKey, async (result:ISubmittableResult) => {
+ if(!result.isInBlock) {
+ return;
+ }
+ const record = result.findRecord('contracts', 'Instantiated');
+ if(record) {
+ (await unsubscribe)();
+ expect(alicesPublicKey).to.be.equal(record.event.data[0].toString());
+ resolve(record.event.data[1] as AccountId);
+ } else {
+ reject('Failed to find instantiated event,');
+ }
+ });
+ });
+ })();
+
+ const contractInstance = new PromiseContract(api, abi, instanceAccountId);
+ const getFlipValue = async () => {
+ return await promisifySubstrate(api, async () => {
+ const result = await contractInstance.call('rpc', 'get', 0, new BN('1000000000000'))
+ .send(alicesPublicKey);
+ if(!result.isSuccess) {
+ throw 'Failed to get flipper value';
+ }
+ return result.output && result.output.valueOf && result.output.valueOf();
+ })();
+ }
+
+ const initialGetResponse = await getFlipValue();
+ expect(initialGetResponse).to.be.true;
+
+ await promisifySubstrate(api, async () => {
+ return new Promise<void>(async (resolve, reject) => {
+ api.tx.contracts.call(contractInstance.address.toString(), 0, 1000000000000n, contractInstance.getMessage('flip').fn())
+ .signAndSend(alicesPrivateKey, async result => {
+ if(!result.isInBlock) {
+ return;
+ }
+
+ if(result.findRecord('system', 'ExtrinsicSuccess')) {
+ resolve();
+ }
+ else {
+ reject('Failed to flip value.');
+ }
+ })
+ });
+ })();
+
+ const afterFlipGetResponse = await getFlipValue();
+
+ expect(afterFlipGetResponse).to.be.false;
+ });
+ });
+});
tests/src/flipper/flipper.wasmdiffbeforeafterbothbinary blob — no preview
tests/src/flipper/metadata.jsondiffbeforeafterboth--- /dev/null
+++ b/tests/src/flipper/metadata.json
@@ -0,0 +1,204 @@
+{
+ "registry": {
+ "strings": [
+ "Storage",
+ "flipper",
+ "__ink_private",
+ "__ink_storage",
+ "value",
+ "Value",
+ "ink_core",
+ "storage",
+ "cell",
+ "SyncCell",
+ "sync_cell",
+ "Key",
+ "ink_primitives",
+ "new",
+ "init_value",
+ "bool",
+ "default",
+ "flip",
+ "get"
+ ],
+ "types": [
+ {
+ "id": {
+ "custom.name": 1,
+ "custom.namespace": [
+ 2,
+ 2,
+ 3,
+ 4
+ ],
+ "custom.params": []
+ },
+ "def": {
+ "struct.fields": [
+ {
+ "name": 5,
+ "type": 2
+ }
+ ]
+ }
+ },
+ {
+ "id": {
+ "custom.name": 6,
+ "custom.namespace": [
+ 7,
+ 8,
+ 5
+ ],
+ "custom.params": [
+ 3
+ ]
+ },
+ "def": {
+ "struct.fields": [
+ {
+ "name": 9,
+ "type": 4
+ }
+ ]
+ }
+ },
+ {
+ "id": "bool",
+ "def": "builtin"
+ },
+ {
+ "id": {
+ "custom.name": 10,
+ "custom.namespace": [
+ 7,
+ 8,
+ 9,
+ 11
+ ],
+ "custom.params": [
+ 3
+ ]
+ },
+ "def": {
+ "struct.fields": [
+ {
+ "name": 9,
+ "type": 5
+ }
+ ]
+ }
+ },
+ {
+ "id": {
+ "custom.name": 12,
+ "custom.namespace": [
+ 13
+ ],
+ "custom.params": []
+ },
+ "def": {
+ "tuple_struct.types": [
+ 6
+ ]
+ }
+ },
+ {
+ "id": {
+ "array.len": 32,
+ "array.type": 7
+ },
+ "def": "builtin"
+ },
+ {
+ "id": "u8",
+ "def": "builtin"
+ }
+ ]
+ },
+ "storage": {
+ "struct.type": 1,
+ "struct.fields": [
+ {
+ "name": 5,
+ "layout": {
+ "struct.type": 2,
+ "struct.fields": [
+ {
+ "name": 9,
+ "layout": {
+ "range.offset": "0x0000000000000000000000000000000000000000000000000000000000000000",
+ "range.len": 1,
+ "range.elem_type": 3
+ }
+ }
+ ]
+ }
+ }
+ ]
+ },
+ "contract": {
+ "name": 2,
+ "constructors": [
+ {
+ "name": 14,
+ "selector": "[\"0x5E\",\"0xBD\",\"0x88\",\"0xD6\"]",
+ "args": [
+ {
+ "name": 15,
+ "type": {
+ "ty": 3,
+ "display_name": [
+ 16
+ ]
+ }
+ }
+ ],
+ "docs": [
+ "Constructor that initializes the `bool` value to the given `init_value`."
+ ]
+ },
+ {
+ "name": 17,
+ "selector": "[\"0x02\",\"0x22\",\"0xFF\",\"0x18\"]",
+ "args": [],
+ "docs": [
+ "Constructor that initializes the `bool` value to `false`.",
+ "",
+ "Constructors can delegate to other constructors."
+ ]
+ }
+ ],
+ "messages": [
+ {
+ "name": 18,
+ "selector": "[\"0x8C\",\"0x97\",\"0xDB\",\"0x39\"]",
+ "mutates": true,
+ "args": [],
+ "return_type": null,
+ "docs": [
+ "A message that can be called on instantiated contracts.",
+ "This one flips the value of the stored `bool` from `true`",
+ "to `false` and vice versa."
+ ]
+ },
+ {
+ "name": 19,
+ "selector": "[\"0x25\",\"0x44\",\"0x4A\",\"0xFE\"]",
+ "mutates": false,
+ "args": [],
+ "return_type": {
+ "ty": 3,
+ "display_name": [
+ 16
+ ]
+ },
+ "docs": [
+ "Simply returns the current value of our `bool`."
+ ]
+ }
+ ],
+ "events": [],
+ "docs": []
+ }
+}
\ No newline at end of file
tests/src/substrate/privateKey.tsdiffbeforeafterboth--- /dev/null
+++ b/tests/src/substrate/privateKey.ts
@@ -0,0 +1,7 @@
+import { Keyring } from "@polkadot/api";
+
+export default function privateKey(account: string) {
+ const keyring = new Keyring({ type: 'sr25519' });
+
+ return keyring.addFromUri(account);
+}
\ No newline at end of file
tests/src/transfer.test.tsdiffbeforeafterboth--- a/tests/src/transfer.test.ts
+++ b/tests/src/transfer.test.ts
@@ -5,6 +5,8 @@
import usingApi from "./substrate/substrate-api";
import promisifySubstrate from "./substrate/promisify-substrate";
import waitNewBlocks from "./substrate/wait-new-blocks";
+import { alicesPublicKey, bobsPublicKey } from "./accounts";
+import privateKey from "./substrate/privateKey";
async function getBalance(api: ApiPromise, accounts: string[]): Promise<bigint[]> {
const balance = promisifySubstrate(api, (accounts: string[]) => api.query.system.account.multi(accounts));
@@ -14,18 +16,14 @@
describe('Transfer', () => {
it('Balance transfers', async () => {
- const bobsPublicKey = '5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty';
- const alicesPublicKey = '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY';
await usingApi(async api => {
const [alicesBalanceBefore, bobsBalanceBefore] = await getBalance(api, [alicesPublicKey, bobsPublicKey]);
- const keyring = new Keyring({ type: 'sr25519' });
-
- const alicePrivateKey = keyring.addFromUri('//Alice');
+ const alicePrivateKey = privateKey('//Alice');
const transfer = api.tx.balances.transfer(bobsPublicKey, 1n);
- const hash = await transfer.signAndSend(alicePrivateKey);
+ await promisifySubstrate(api, () => transfer.signAndSend(alicePrivateKey))();
await waitNewBlocks(api);