Fix solana integration tests & add test for account creation
Change-Id: I222744f194f952d03bfbd3ba4469bce59c310fc0
This commit is contained in:
parent
2b56fcc7da
commit
c04d25e704
|
@ -25,9 +25,9 @@ checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "arrayvec"
|
name = "arrayvec"
|
||||||
version = "0.5.2"
|
version = "0.7.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b"
|
checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "atty"
|
name = "atty"
|
||||||
|
@ -46,6 +46,12 @@ version = "1.0.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
|
checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "base64"
|
||||||
|
version = "0.12.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "base64"
|
name = "base64"
|
||||||
version = "0.13.0"
|
version = "0.13.0"
|
||||||
|
@ -62,18 +68,23 @@ dependencies = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "blake3"
|
name = "bitflags"
|
||||||
version = "0.3.8"
|
version = "1.3.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b64485778c4f16a6a5a9d335e80d449ac6c70cdd6a06d2af18a6f6f775a125b3"
|
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "blake3"
|
||||||
|
version = "1.3.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a08e53fc5a564bb15bfe6fae56bd71522205f1f91893f9c0116edad6496c183f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arrayref",
|
"arrayref",
|
||||||
"arrayvec",
|
"arrayvec",
|
||||||
"cc",
|
"cc",
|
||||||
"cfg-if 0.1.10",
|
"cfg-if",
|
||||||
"constant_time_eq",
|
"constant_time_eq",
|
||||||
"crypto-mac 0.8.0",
|
"digest 0.10.3",
|
||||||
"digest 0.9.0",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -83,7 +94,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4"
|
checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"block-padding",
|
"block-padding",
|
||||||
"generic-array 0.14.4",
|
"generic-array",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "block-buffer"
|
||||||
|
version = "0.10.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324"
|
||||||
|
dependencies = [
|
||||||
|
"generic-array",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -94,9 +114,9 @@ checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "borsh"
|
name = "borsh"
|
||||||
version = "0.8.2"
|
version = "0.9.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "09a7111f797cc721407885a323fb071636aee57f750b1a4ddc27397eba168a74"
|
checksum = "18dda7dc709193c0d86a1a51050a926dc3df1cf262ec46a23a25dba421ea1924"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"borsh-derive",
|
"borsh-derive",
|
||||||
"hashbrown",
|
"hashbrown",
|
||||||
|
@ -104,9 +124,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "borsh-derive"
|
name = "borsh-derive"
|
||||||
version = "0.8.2"
|
version = "0.9.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "307f3740906bac2c118a8122fe22681232b244f1369273e45f1156b45c43d2dd"
|
checksum = "684155372435f578c0fa1acd13ebbb182cc19d6b38b64ae7901da4393217d264"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"borsh-derive-internal",
|
"borsh-derive-internal",
|
||||||
"borsh-schema-derive-internal",
|
"borsh-schema-derive-internal",
|
||||||
|
@ -117,9 +137,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "borsh-derive-internal"
|
name = "borsh-derive-internal"
|
||||||
version = "0.8.2"
|
version = "0.9.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d2104c73179359431cc98e016998f2f23bc7a05bc53e79741bcba705f30047bc"
|
checksum = "2102f62f8b6d3edeab871830782285b64cc1830168094db05c8e458f209bc5c3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
@ -128,9 +148,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "borsh-schema-derive-internal"
|
name = "borsh-schema-derive-internal"
|
||||||
version = "0.8.2"
|
version = "0.9.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ae29eb8418fcd46f723f8691a2ac06857d31179d33d2f2d91eb13967de97c728"
|
checksum = "196c978c4c9b0b142d446ef3240690bf5a8a33497074a113ff9a337ccb750483"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
@ -139,9 +159,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bs58"
|
name = "bs58"
|
||||||
version = "0.3.1"
|
version = "0.4.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "476e9cd489f9e121e02ffa6014a8ef220ecb15c05ed23fc34cca13925dc283fb"
|
checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bstr"
|
name = "bstr"
|
||||||
|
@ -154,6 +174,12 @@ dependencies = [
|
||||||
"regex-automata",
|
"regex-automata",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "bumpalo"
|
||||||
|
version = "3.9.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bv"
|
name = "bv"
|
||||||
version = "0.11.1"
|
version = "0.11.1"
|
||||||
|
@ -164,6 +190,26 @@ dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "bytemuck"
|
||||||
|
version = "1.8.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0e851ca7c24871e7336801608a4797d7376545b6928a10d32d75685687141ead"
|
||||||
|
dependencies = [
|
||||||
|
"bytemuck_derive",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "bytemuck_derive"
|
||||||
|
version = "1.0.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8e215f8c2f9f79cb53c8335e687ffd07d5bfcb6fe5fc80723762d0be46e7cc54"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "byteorder"
|
name = "byteorder"
|
||||||
version = "1.4.3"
|
version = "1.4.3"
|
||||||
|
@ -176,18 +222,32 @@ version = "1.0.72"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee"
|
checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "cfg-if"
|
|
||||||
version = "0.1.10"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cfg-if"
|
name = "cfg-if"
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "console_error_panic_hook"
|
||||||
|
version = "0.1.7"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc"
|
||||||
|
dependencies = [
|
||||||
|
"cfg-if",
|
||||||
|
"wasm-bindgen",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "console_log"
|
||||||
|
version = "0.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "501a375961cef1a0d44767200e66e4a559283097e91d0730b1d75dfb2f8a1494"
|
||||||
|
dependencies = [
|
||||||
|
"log",
|
||||||
|
"web-sys",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "const-oid"
|
name = "const-oid"
|
||||||
version = "0.6.2"
|
version = "0.6.2"
|
||||||
|
@ -228,7 +288,7 @@ version = "0.16.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c80dbbb380c23a4f10ae6178dd411ed90c9f9931ddf4932156cc5e5ab78d1c19"
|
checksum = "c80dbbb380c23a4f10ae6178dd411ed90c9f9931ddf4932156cc5e5ab78d1c19"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64",
|
"base64 0.13.0",
|
||||||
"cosmwasm-crypto",
|
"cosmwasm-crypto",
|
||||||
"cosmwasm-derive",
|
"cosmwasm-derive",
|
||||||
"schemars",
|
"schemars",
|
||||||
|
@ -269,19 +329,29 @@ version = "0.2.11"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f83bd3bb4314701c568e340cd8cf78c975aa0ca79e03d3f6d1677d5b0c9c0c03"
|
checksum = "f83bd3bb4314701c568e340cd8cf78c975aa0ca79e03d3f6d1677d5b0c9c0c03"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"generic-array 0.14.4",
|
"generic-array",
|
||||||
"rand_core 0.6.3",
|
"rand_core 0.6.3",
|
||||||
"subtle",
|
"subtle",
|
||||||
"zeroize",
|
"zeroize",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "crypto-common"
|
||||||
|
version = "0.1.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "57952ca27b5e3606ff4dd79b0020231aaf9d6aa76dc05fd30137538c50bd3ce8"
|
||||||
|
dependencies = [
|
||||||
|
"generic-array",
|
||||||
|
"typenum",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "crypto-mac"
|
name = "crypto-mac"
|
||||||
version = "0.8.0"
|
version = "0.8.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab"
|
checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"generic-array 0.14.4",
|
"generic-array",
|
||||||
"subtle",
|
"subtle",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -291,23 +361,10 @@ version = "0.11.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714"
|
checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"generic-array 0.14.4",
|
"generic-array",
|
||||||
"subtle",
|
"subtle",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "curve25519-dalek"
|
|
||||||
version = "2.1.3"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "4a9b85542f99a2dfa2a1b8e192662741c9859a846b296bef1c92ef9b58b5a216"
|
|
||||||
dependencies = [
|
|
||||||
"byteorder",
|
|
||||||
"digest 0.8.1",
|
|
||||||
"rand_core 0.5.1",
|
|
||||||
"subtle",
|
|
||||||
"zeroize",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "curve25519-dalek"
|
name = "curve25519-dalek"
|
||||||
version = "3.2.0"
|
version = "3.2.0"
|
||||||
|
@ -426,22 +483,24 @@ dependencies = [
|
||||||
"const-oid",
|
"const-oid",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "digest"
|
|
||||||
version = "0.8.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5"
|
|
||||||
dependencies = [
|
|
||||||
"generic-array 0.12.4",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "digest"
|
name = "digest"
|
||||||
version = "0.9.0"
|
version = "0.9.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066"
|
checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"generic-array 0.14.4",
|
"generic-array",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "digest"
|
||||||
|
version = "0.10.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506"
|
||||||
|
dependencies = [
|
||||||
|
"block-buffer 0.10.2",
|
||||||
|
"crypto-common",
|
||||||
|
"subtle",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -458,7 +517,7 @@ checksum = "43ee23aa5b4f68c7a092b5c3beb25f50c406adc75e2363634f242f28ab255372"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"der",
|
"der",
|
||||||
"elliptic-curve",
|
"elliptic-curve",
|
||||||
"hmac",
|
"hmac 0.11.0",
|
||||||
"signature",
|
"signature",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -468,7 +527,7 @@ version = "2.2.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0a128b76af6dd4b427e34a6fd43dc78dbfe73672ec41ff615a2414c1a0ad0409"
|
checksum = "0a128b76af6dd4b427e34a6fd43dc78dbfe73672ec41ff615a2414c1a0ad0409"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"curve25519-dalek 3.2.0",
|
"curve25519-dalek",
|
||||||
"hex",
|
"hex",
|
||||||
"rand_core 0.5.1",
|
"rand_core 0.5.1",
|
||||||
"serde",
|
"serde",
|
||||||
|
@ -490,7 +549,7 @@ checksum = "beca177dcb8eb540133e7680baff45e7cc4d93bf22002676cec549f82343721b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"crypto-bigint",
|
"crypto-bigint",
|
||||||
"ff",
|
"ff",
|
||||||
"generic-array 0.14.4",
|
"generic-array",
|
||||||
"group",
|
"group",
|
||||||
"pkcs8",
|
"pkcs8",
|
||||||
"rand_core 0.6.3",
|
"rand_core 0.6.3",
|
||||||
|
@ -500,9 +559,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "env_logger"
|
name = "env_logger"
|
||||||
version = "0.8.4"
|
version = "0.9.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3"
|
checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atty",
|
"atty",
|
||||||
"humantime",
|
"humantime",
|
||||||
|
@ -536,15 +595,6 @@ dependencies = [
|
||||||
"static_assertions",
|
"static_assertions",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "generic-array"
|
|
||||||
version = "0.12.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd"
|
|
||||||
dependencies = [
|
|
||||||
"typenum",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "generic-array"
|
name = "generic-array"
|
||||||
version = "0.14.4"
|
version = "0.14.4"
|
||||||
|
@ -562,9 +612,11 @@ version = "0.1.16"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce"
|
checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if 1.0.0",
|
"cfg-if",
|
||||||
|
"js-sys",
|
||||||
"libc",
|
"libc",
|
||||||
"wasi 0.9.0+wasi-snapshot-preview1",
|
"wasi 0.9.0+wasi-snapshot-preview1",
|
||||||
|
"wasm-bindgen",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -573,7 +625,7 @@ version = "0.2.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753"
|
checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if 1.0.0",
|
"cfg-if",
|
||||||
"libc",
|
"libc",
|
||||||
"wasi 0.10.2+wasi-snapshot-preview1",
|
"wasi 0.10.2+wasi-snapshot-preview1",
|
||||||
]
|
]
|
||||||
|
@ -613,6 +665,16 @@ version = "0.4.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
|
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "hmac"
|
||||||
|
version = "0.8.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840"
|
||||||
|
dependencies = [
|
||||||
|
"crypto-mac 0.8.0",
|
||||||
|
"digest 0.9.0",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hmac"
|
name = "hmac"
|
||||||
version = "0.11.0"
|
version = "0.11.0"
|
||||||
|
@ -623,6 +685,17 @@ dependencies = [
|
||||||
"digest 0.9.0",
|
"digest 0.9.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "hmac-drbg"
|
||||||
|
version = "0.3.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1"
|
||||||
|
dependencies = [
|
||||||
|
"digest 0.9.0",
|
||||||
|
"generic-array",
|
||||||
|
"hmac 0.8.1",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "humantime"
|
name = "humantime"
|
||||||
version = "2.1.0"
|
version = "2.1.0"
|
||||||
|
@ -630,10 +703,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
|
checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "itertools"
|
name = "instant"
|
||||||
version = "0.9.0"
|
version = "0.1.12"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b"
|
checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c"
|
||||||
|
dependencies = [
|
||||||
|
"cfg-if",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "itertools"
|
||||||
|
version = "0.10.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"either",
|
"either",
|
||||||
]
|
]
|
||||||
|
@ -644,13 +726,22 @@ version = "1.0.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35"
|
checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "js-sys"
|
||||||
|
version = "0.3.56"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a38fc24e30fd564ce974c02bf1d337caddff65be6cc4735a1f7eab22a7440f04"
|
||||||
|
dependencies = [
|
||||||
|
"wasm-bindgen",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "k256"
|
name = "k256"
|
||||||
version = "0.9.6"
|
version = "0.9.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "903ae2481bcdfdb7b68e0a9baa4b7c9aff600b9ae2e8e5bb5833b8c91ab851ea"
|
checksum = "903ae2481bcdfdb7b68e0a9baa4b7c9aff600b9ae2e8e5bb5833b8c91ab851ea"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if 1.0.0",
|
"cfg-if",
|
||||||
"ecdsa",
|
"ecdsa",
|
||||||
"elliptic-curve",
|
"elliptic-curve",
|
||||||
"sha2",
|
"sha2",
|
||||||
|
@ -674,13 +765,70 @@ version = "0.2.112"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125"
|
checksum = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "libsecp256k1"
|
||||||
|
version = "0.6.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c9d220bc1feda2ac231cb78c3d26f27676b8cf82c96971f7aeef3d0cf2797c73"
|
||||||
|
dependencies = [
|
||||||
|
"arrayref",
|
||||||
|
"base64 0.12.3",
|
||||||
|
"digest 0.9.0",
|
||||||
|
"hmac-drbg",
|
||||||
|
"libsecp256k1-core",
|
||||||
|
"libsecp256k1-gen-ecmult",
|
||||||
|
"libsecp256k1-gen-genmult",
|
||||||
|
"rand",
|
||||||
|
"serde",
|
||||||
|
"sha2",
|
||||||
|
"typenum",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "libsecp256k1-core"
|
||||||
|
version = "0.2.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d0f6ab710cec28cef759c5f18671a27dae2a5f952cdaaee1d8e2908cb2478a80"
|
||||||
|
dependencies = [
|
||||||
|
"crunchy",
|
||||||
|
"digest 0.9.0",
|
||||||
|
"subtle",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "libsecp256k1-gen-ecmult"
|
||||||
|
version = "0.2.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ccab96b584d38fac86a83f07e659f0deafd0253dc096dab5a36d53efe653c5c3"
|
||||||
|
dependencies = [
|
||||||
|
"libsecp256k1-core",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "libsecp256k1-gen-genmult"
|
||||||
|
version = "0.2.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "67abfe149395e3aa1c48a2beb32b068e2334402df8181f818d3aee2b304c4f5d"
|
||||||
|
dependencies = [
|
||||||
|
"libsecp256k1-core",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "lock_api"
|
||||||
|
version = "0.4.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "88943dd7ef4a2e5a4bfa2753aaab3013e34ce2533d1996fb18ef591e315e2b3b"
|
||||||
|
dependencies = [
|
||||||
|
"scopeguard",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "log"
|
name = "log"
|
||||||
version = "0.4.14"
|
version = "0.4.14"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710"
|
checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if 1.0.0",
|
"cfg-if",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -691,9 +839,9 @@ checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "memmap2"
|
name = "memmap2"
|
||||||
version = "0.1.0"
|
version = "0.5.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d9b70ca2a6103ac8b665dc150b142ef0e4e89df640c9e6cf295d189c3caebe5a"
|
checksum = "057a3db23999c867821a7a59feb06a578fcb03685e983dff90daf9e7d24ac08f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
@ -741,6 +889,31 @@ version = "0.3.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
|
checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "parking_lot"
|
||||||
|
version = "0.11.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99"
|
||||||
|
dependencies = [
|
||||||
|
"instant",
|
||||||
|
"lock_api",
|
||||||
|
"parking_lot_core",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "parking_lot_core"
|
||||||
|
version = "0.8.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216"
|
||||||
|
dependencies = [
|
||||||
|
"cfg-if",
|
||||||
|
"instant",
|
||||||
|
"libc",
|
||||||
|
"redox_syscall",
|
||||||
|
"smallvec",
|
||||||
|
"winapi",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pkcs8"
|
name = "pkcs8"
|
||||||
version = "0.7.6"
|
version = "0.7.6"
|
||||||
|
@ -844,6 +1017,15 @@ dependencies = [
|
||||||
"rand_core 0.5.1",
|
"rand_core 0.5.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "redox_syscall"
|
||||||
|
version = "0.2.11"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8380fe0152551244f0747b1bf41737e0f8a74f97a14ccefd1148187271634f3c"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "regex"
|
name = "regex"
|
||||||
version = "1.5.4"
|
version = "1.5.4"
|
||||||
|
@ -881,9 +1063,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustc_version"
|
name = "rustc_version"
|
||||||
version = "0.2.3"
|
version = "0.4.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
|
checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"semver",
|
"semver",
|
||||||
]
|
]
|
||||||
|
@ -925,19 +1107,16 @@ dependencies = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "semver"
|
name = "scopeguard"
|
||||||
version = "0.9.0"
|
version = "1.1.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
|
checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
|
||||||
dependencies = [
|
|
||||||
"semver-parser",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "semver-parser"
|
name = "semver"
|
||||||
version = "0.7.0"
|
version = "1.0.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
|
checksum = "a4a3381e03edd24287172047536f20cabde766e2cd3e65e6b00fb3af51c4f38d"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
|
@ -1005,8 +1184,8 @@ version = "0.9.8"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b69f9a4c9740d74c5baa3fd2e547f9525fa8088a8a958e0ca2409a514e33f5fa"
|
checksum = "b69f9a4c9740d74c5baa3fd2e547f9525fa8088a8a958e0ca2409a514e33f5fa"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"block-buffer",
|
"block-buffer 0.9.0",
|
||||||
"cfg-if 1.0.0",
|
"cfg-if",
|
||||||
"cpufeatures",
|
"cpufeatures",
|
||||||
"digest 0.9.0",
|
"digest 0.9.0",
|
||||||
"opaque-debug",
|
"opaque-debug",
|
||||||
|
@ -1018,7 +1197,7 @@ version = "0.9.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809"
|
checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"block-buffer",
|
"block-buffer 0.9.0",
|
||||||
"digest 0.9.0",
|
"digest 0.9.0",
|
||||||
"keccak",
|
"keccak",
|
||||||
"opaque-debug",
|
"opaque-debug",
|
||||||
|
@ -1035,14 +1214,20 @@ dependencies = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "solana-frozen-abi"
|
name = "smallvec"
|
||||||
version = "1.7.0"
|
version = "1.8.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6b81e60d88b1fe0322bba6f3fe6b0d7299df2f2ededa8d95ec77b934fabb967b"
|
checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "solana-frozen-abi"
|
||||||
|
version = "1.9.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c89bcde59ac3e8d4dbf7c4d990b0627b8ca0d25394c4ce17896dde7a1452e40c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bs58",
|
"bs58",
|
||||||
"bv",
|
"bv",
|
||||||
"generic-array 0.14.4",
|
"generic-array",
|
||||||
"log",
|
"log",
|
||||||
"memmap2",
|
"memmap2",
|
||||||
"rustc_version",
|
"rustc_version",
|
||||||
|
@ -1056,9 +1241,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "solana-frozen-abi-macro"
|
name = "solana-frozen-abi-macro"
|
||||||
version = "1.7.0"
|
version = "1.9.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f617daa0187bcc4665d63fcf9454c998e9cdad6a33181f6214558d738230bfe2"
|
checksum = "56a7d630da35993631ecc4dd155f92d0d58000cdde3d5e2764fe9fd49d20a3a8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
@ -1068,9 +1253,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "solana-logger"
|
name = "solana-logger"
|
||||||
version = "1.7.0"
|
version = "1.9.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8b3e2b14bdcbb7b41de9ef5a541ac501ba3fbd07999cbcf7ea9006b3ae28b67b"
|
checksum = "6eaf925bb665de46f96fcea2c8a900d0d870a96fd1f50cf2bad16e22a1da71c4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"env_logger",
|
"env_logger",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
|
@ -1079,23 +1264,31 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "solana-program"
|
name = "solana-program"
|
||||||
version = "1.7.0"
|
version = "1.9.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9c5d59f9d358c09db6461fae1fde6075a456685d856c004ef21af092a830e4e7"
|
checksum = "2fc4d7a0baa649a3bda06d6a1cc30bd3d8ac692702a75fa8e76369cf7b3f6329"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"base64 0.13.0",
|
||||||
"bincode",
|
"bincode",
|
||||||
|
"bitflags",
|
||||||
"blake3",
|
"blake3",
|
||||||
"borsh",
|
"borsh",
|
||||||
"borsh-derive",
|
"borsh-derive",
|
||||||
"bs58",
|
"bs58",
|
||||||
"bv",
|
"bv",
|
||||||
"curve25519-dalek 2.1.3",
|
"bytemuck",
|
||||||
"hex",
|
"console_error_panic_hook",
|
||||||
|
"console_log",
|
||||||
|
"curve25519-dalek",
|
||||||
|
"getrandom 0.1.16",
|
||||||
"itertools",
|
"itertools",
|
||||||
|
"js-sys",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
|
"libsecp256k1",
|
||||||
"log",
|
"log",
|
||||||
"num-derive",
|
"num-derive",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
|
"parking_lot",
|
||||||
"rand",
|
"rand",
|
||||||
"rustc_version",
|
"rustc_version",
|
||||||
"rustversion",
|
"rustversion",
|
||||||
|
@ -1109,13 +1302,14 @@ dependencies = [
|
||||||
"solana-logger",
|
"solana-logger",
|
||||||
"solana-sdk-macro",
|
"solana-sdk-macro",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
|
"wasm-bindgen",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "solana-sdk-macro"
|
name = "solana-sdk-macro"
|
||||||
version = "1.7.0"
|
version = "1.9.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d27426b2a09676929c5e49df96967bbcffff003183c11a3c3ef11d78bac4aaaa"
|
checksum = "ec22a924c73abe3376a2046715a2f6a9ae4094095b8ea08e8e56e8de198264ad"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bs58",
|
"bs58",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
|
@ -1247,6 +1441,70 @@ version = "0.10.2+wasi-snapshot-preview1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
|
checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wasm-bindgen"
|
||||||
|
version = "0.2.79"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "25f1af7423d8588a3d840681122e72e6a24ddbcb3f0ec385cac0d12d24256c06"
|
||||||
|
dependencies = [
|
||||||
|
"cfg-if",
|
||||||
|
"wasm-bindgen-macro",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wasm-bindgen-backend"
|
||||||
|
version = "0.2.79"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8b21c0df030f5a177f3cba22e9bc4322695ec43e7257d865302900290bcdedca"
|
||||||
|
dependencies = [
|
||||||
|
"bumpalo",
|
||||||
|
"lazy_static",
|
||||||
|
"log",
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn",
|
||||||
|
"wasm-bindgen-shared",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wasm-bindgen-macro"
|
||||||
|
version = "0.2.79"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2f4203d69e40a52ee523b2529a773d5ffc1dc0071801c87b3d270b471b80ed01"
|
||||||
|
dependencies = [
|
||||||
|
"quote",
|
||||||
|
"wasm-bindgen-macro-support",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wasm-bindgen-macro-support"
|
||||||
|
version = "0.2.79"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "bfa8a30d46208db204854cadbb5d4baf5fcf8071ba5bf48190c3e59937962ebc"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn",
|
||||||
|
"wasm-bindgen-backend",
|
||||||
|
"wasm-bindgen-shared",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wasm-bindgen-shared"
|
||||||
|
version = "0.2.79"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3d958d035c4438e28c70e4321a2911302f10135ce78a9c7834c0cab4123d06a2"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "web-sys"
|
||||||
|
version = "0.3.56"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c060b319f29dd25724f09a2ba1418f142f539b2be99fbf4d2d5a8f7330afb8eb"
|
||||||
|
dependencies = [
|
||||||
|
"js-sys",
|
||||||
|
"wasm-bindgen",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "winapi"
|
name = "winapi"
|
||||||
version = "0.3.9"
|
version = "0.3.9"
|
||||||
|
@ -1300,7 +1558,7 @@ dependencies = [
|
||||||
"cw20",
|
"cw20",
|
||||||
"cw20-base",
|
"cw20-base",
|
||||||
"cw20-wrapped",
|
"cw20-wrapped",
|
||||||
"generic-array 0.14.4",
|
"generic-array",
|
||||||
"getrandom 0.2.3",
|
"getrandom 0.2.3",
|
||||||
"hex",
|
"hex",
|
||||||
"k256",
|
"k256",
|
||||||
|
|
|
@ -428,19 +428,6 @@ dependencies = [
|
||||||
"wormhole-bridge-solana",
|
"wormhole-bridge-solana",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "console"
|
|
||||||
version = "0.14.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "3993e6445baa160675931ec041a5e03ca84b9c6e32a056150d3aa2bdda0a1f45"
|
|
||||||
dependencies = [
|
|
||||||
"encode_unicode",
|
|
||||||
"lazy_static",
|
|
||||||
"libc",
|
|
||||||
"terminal_size",
|
|
||||||
"winapi",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "console"
|
name = "console"
|
||||||
version = "0.15.0"
|
version = "0.15.0"
|
||||||
|
@ -669,7 +656,7 @@ version = "0.9.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "61579ada4ec0c6031cfac3f86fdba0d195a7ebeb5e36693bd53cb5999a25beeb"
|
checksum = "61579ada4ec0c6031cfac3f86fdba0d195a7ebeb5e36693bd53cb5999a25beeb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"console 0.15.0",
|
"console",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"tempfile",
|
"tempfile",
|
||||||
"zeroize",
|
"zeroize",
|
||||||
|
@ -1324,7 +1311,7 @@ version = "0.16.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2d207dc617c7a380ab07ff572a6e52fa202a2a8f355860ac9c38e23f8196be1b"
|
checksum = "2d207dc617c7a380ab07ff572a6e52fa202a2a8f355860ac9c38e23f8196be1b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"console 0.14.1",
|
"console",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"number_prefix",
|
"number_prefix",
|
||||||
"regex",
|
"regex",
|
||||||
|
@ -2746,7 +2733,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a03587d5bf5f7bc9302385f9ada8412662cdb93b5e3d40fee2a02553a932277c"
|
checksum = "a03587d5bf5f7bc9302385f9ada8412662cdb93b5e3d40fee2a02553a932277c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base32",
|
"base32",
|
||||||
"console 0.15.0",
|
"console",
|
||||||
"dialoguer",
|
"dialoguer",
|
||||||
"hidapi",
|
"hidapi",
|
||||||
"log",
|
"log",
|
||||||
|
@ -3604,7 +3591,7 @@ dependencies = [
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"hex",
|
"hex",
|
||||||
"hex-literal",
|
"hex-literal",
|
||||||
"libsecp256k1 0.3.5",
|
"libsecp256k1 0.6.0",
|
||||||
"primitive-types",
|
"primitive-types",
|
||||||
"rand 0.7.3",
|
"rand 0.7.3",
|
||||||
"serde",
|
"serde",
|
||||||
|
|
|
@ -31,6 +31,6 @@ wasm-bindgen = { version = "0.2.74", features = ["serde-serialize"], optional =
|
||||||
hex = "*"
|
hex = "*"
|
||||||
rand = "0.7.3"
|
rand = "0.7.3"
|
||||||
hex-literal = "0.3.1"
|
hex-literal = "0.3.1"
|
||||||
libsecp256k1 = { version = "0.3.5", features = [] }
|
libsecp256k1 = { version = "0.6.0", features = [] }
|
||||||
solana-client = "=1.9.4"
|
solana-client = "=1.9.4"
|
||||||
solana-sdk = "=1.9.4"
|
solana-sdk = "=1.9.4"
|
||||||
|
|
|
@ -9,7 +9,7 @@ use byteorder::{
|
||||||
WriteBytesExt,
|
WriteBytesExt,
|
||||||
};
|
};
|
||||||
use hex_literal::hex;
|
use hex_literal::hex;
|
||||||
use secp256k1::{
|
use libsecp256k1::{
|
||||||
Message as Secp256k1Message,
|
Message as Secp256k1Message,
|
||||||
PublicKey,
|
PublicKey,
|
||||||
SecretKey,
|
SecretKey,
|
||||||
|
@ -109,6 +109,7 @@ pub fn execute(
|
||||||
skip_preflight: true,
|
skip_preflight: true,
|
||||||
preflight_commitment: None,
|
preflight_commitment: None,
|
||||||
encoding: None,
|
encoding: None,
|
||||||
|
max_retries: None,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -142,17 +143,31 @@ mod helpers {
|
||||||
&payer.pubkey(),
|
&payer.pubkey(),
|
||||||
1,
|
1,
|
||||||
)],
|
)],
|
||||||
CommitmentConfig::finalized(),
|
CommitmentConfig::confirmed(),
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Fetch account data, the loop is there to re-attempt until data is available.
|
/// Fetch account data, the loop is there to re-attempt until data is available.
|
||||||
pub fn get_account_data<T: BorshDeserialize>(client: &RpcClient, account: &Pubkey) -> T {
|
pub fn get_account_data<T: BorshDeserialize>(client: &RpcClient, account: &Pubkey) -> T {
|
||||||
let account = client.get_account(account).unwrap();
|
let account = client
|
||||||
|
.get_account_with_commitment(account, CommitmentConfig::confirmed())
|
||||||
|
.unwrap()
|
||||||
|
.value
|
||||||
|
.unwrap();
|
||||||
T::try_from_slice(&account.data).unwrap()
|
T::try_from_slice(&account.data).unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Fetch account balance
|
||||||
|
pub fn get_account_balance(client: &RpcClient, account: &Pubkey) -> u64 {
|
||||||
|
client
|
||||||
|
.get_account_with_commitment(account, CommitmentConfig::confirmed())
|
||||||
|
.unwrap()
|
||||||
|
.value
|
||||||
|
.unwrap()
|
||||||
|
.lamports
|
||||||
|
}
|
||||||
|
|
||||||
/// Generate `count` secp256k1 private keys, along with their ethereum-styled public key
|
/// Generate `count` secp256k1 private keys, along with their ethereum-styled public key
|
||||||
/// encoding: 0x0123456789ABCDEF01234
|
/// encoding: 0x0123456789ABCDEF01234
|
||||||
pub fn generate_keys(count: u8) -> (Vec<[u8; 20]>, Vec<SecretKey>) {
|
pub fn generate_keys(count: u8) -> (Vec<[u8; 20]>, Vec<SecretKey>) {
|
||||||
|
@ -188,6 +203,7 @@ mod helpers {
|
||||||
emitter: &Keypair,
|
emitter: &Keypair,
|
||||||
data: Vec<u8>,
|
data: Vec<u8>,
|
||||||
nonce: u32,
|
nonce: u32,
|
||||||
|
sequence: u64,
|
||||||
guardian_set_index: u32,
|
guardian_set_index: u32,
|
||||||
emitter_chain: u16,
|
emitter_chain: u16,
|
||||||
) -> (PostVAAData, [u8; 32], [u8; 32]) {
|
) -> (PostVAAData, [u8; 32], [u8; 32]) {
|
||||||
|
@ -198,7 +214,7 @@ mod helpers {
|
||||||
// Body part
|
// Body part
|
||||||
emitter_chain,
|
emitter_chain,
|
||||||
emitter_address: emitter.pubkey().to_bytes(),
|
emitter_address: emitter.pubkey().to_bytes(),
|
||||||
sequence: 0,
|
sequence,
|
||||||
payload: data,
|
payload: data,
|
||||||
timestamp: SystemTime::now()
|
timestamp: SystemTime::now()
|
||||||
.duration_since(SystemTime::UNIX_EPOCH)
|
.duration_since(SystemTime::UNIX_EPOCH)
|
||||||
|
@ -337,7 +353,7 @@ mod helpers {
|
||||||
payer,
|
payer,
|
||||||
tx_signers,
|
tx_signers,
|
||||||
&vec![
|
&vec![
|
||||||
new_secp256k1_instruction(&key, &body),
|
new_secp256k1_instruction(key, &body),
|
||||||
instructions::verify_signatures(
|
instructions::verify_signatures(
|
||||||
*program,
|
*program,
|
||||||
payer.pubkey(),
|
payer.pubkey(),
|
||||||
|
|
|
@ -6,12 +6,12 @@ use byteorder::{
|
||||||
WriteBytesExt,
|
WriteBytesExt,
|
||||||
};
|
};
|
||||||
use hex_literal::hex;
|
use hex_literal::hex;
|
||||||
use rand::Rng;
|
use libsecp256k1::{
|
||||||
use secp256k1::{
|
|
||||||
Message as Secp256k1Message,
|
Message as Secp256k1Message,
|
||||||
PublicKey,
|
PublicKey,
|
||||||
SecretKey,
|
SecretKey,
|
||||||
};
|
};
|
||||||
|
use rand::Rng;
|
||||||
use sha3::Digest;
|
use sha3::Digest;
|
||||||
use solana_client::rpc_client::RpcClient;
|
use solana_client::rpc_client::RpcClient;
|
||||||
use solana_program::{
|
use solana_program::{
|
||||||
|
@ -31,6 +31,7 @@ use solana_program::{
|
||||||
sysvar,
|
sysvar,
|
||||||
};
|
};
|
||||||
use solana_sdk::{
|
use solana_sdk::{
|
||||||
|
commitment_config::CommitmentConfig,
|
||||||
signature::{
|
signature::{
|
||||||
read_keypair_file,
|
read_keypair_file,
|
||||||
Keypair,
|
Keypair,
|
||||||
|
@ -72,6 +73,7 @@ use bridge::{
|
||||||
SignatureSetData,
|
SignatureSetData,
|
||||||
},
|
},
|
||||||
instruction,
|
instruction,
|
||||||
|
instructions,
|
||||||
instructions::hash_vaa,
|
instructions::hash_vaa,
|
||||||
types::{
|
types::{
|
||||||
ConsistencyLevel,
|
ConsistencyLevel,
|
||||||
|
@ -87,6 +89,7 @@ use bridge::{
|
||||||
Signature,
|
Signature,
|
||||||
};
|
};
|
||||||
use primitive_types::U256;
|
use primitive_types::U256;
|
||||||
|
use solana_program::rent::Rent;
|
||||||
use solana_sdk::hash::hashv;
|
use solana_sdk::hash::hashv;
|
||||||
|
|
||||||
mod common;
|
mod common;
|
||||||
|
@ -139,9 +142,9 @@ fn run_integration_tests() {
|
||||||
// Tests are currently unhygienic as It's difficult to wrap `solana-test-validator` within the
|
// Tests are currently unhygienic as It's difficult to wrap `solana-test-validator` within the
|
||||||
// integration tests so for now we work around it by simply chain-calling our tests.
|
// integration tests so for now we work around it by simply chain-calling our tests.
|
||||||
test_bridge_messages(&mut context);
|
test_bridge_messages(&mut context);
|
||||||
|
test_bridge_message_prefunded_account(&mut context);
|
||||||
test_foreign_bridge_messages(&mut context);
|
test_foreign_bridge_messages(&mut context);
|
||||||
test_invalid_emitter(&mut context);
|
test_invalid_emitter(&mut context);
|
||||||
test_duplicate_messages_fail(&mut context);
|
|
||||||
test_guardian_set_change(&mut context);
|
test_guardian_set_change(&mut context);
|
||||||
test_guardian_set_change_fails(&mut context);
|
test_guardian_set_change_fails(&mut context);
|
||||||
test_set_fees(&mut context);
|
test_set_fees(&mut context);
|
||||||
|
@ -212,18 +215,37 @@ fn test_bridge_messages(context: &mut Context) {
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
// Verify on chain Message
|
||||||
|
let posted_message: PostedVAAData = common::get_account_data(client, &message_key);
|
||||||
|
assert_eq!(posted_message.0.vaa_version, 0);
|
||||||
|
assert_eq!(posted_message.0.nonce, nonce);
|
||||||
|
assert_eq!(posted_message.0.sequence, sequence);
|
||||||
|
assert_eq!(posted_message.0.emitter_chain, 1);
|
||||||
|
assert_eq!(posted_message.0.payload, message);
|
||||||
|
assert_eq!(
|
||||||
|
posted_message.0.emitter_address,
|
||||||
|
emitter.pubkey().to_bytes()
|
||||||
|
);
|
||||||
|
|
||||||
// Emulate Guardian behaviour, verifying the data and publishing signatures/VAA.
|
// Emulate Guardian behaviour, verifying the data and publishing signatures/VAA.
|
||||||
let (vaa, body, body_hash) = common::generate_vaa(&emitter, message.clone(), nonce, 0, 1);
|
let (vaa, body, body_hash) =
|
||||||
|
common::generate_vaa(&emitter, message.clone(), nonce, sequence, 0, 1);
|
||||||
let signature_set =
|
let signature_set =
|
||||||
common::verify_signatures(client, program, payer, body, &context.secret, 0).unwrap();
|
common::verify_signatures(client, program, payer, body, &context.secret, 0).unwrap();
|
||||||
common::post_vaa(client, program, payer, signature_set, vaa).unwrap();
|
common::post_vaa(client, program, payer, signature_set, vaa).unwrap();
|
||||||
|
let message_key = PostedVAA::<'_, { AccountState::MaybeInitialized }>::key(
|
||||||
|
&PostedVAADerivationData {
|
||||||
|
payload_hash: body.to_vec(),
|
||||||
|
},
|
||||||
|
program,
|
||||||
|
);
|
||||||
common::sync(client, payer);
|
common::sync(client, payer);
|
||||||
|
|
||||||
// Fetch chain accounts to verify state.
|
// Fetch chain accounts to verify state.
|
||||||
let posted_message: PostedVAAData = common::get_account_data(client, &message_key);
|
let posted_message: PostedVAAData = common::get_account_data(client, &message_key);
|
||||||
let signatures: SignatureSetData = common::get_account_data(client, &signature_set);
|
let signatures: SignatureSetData = common::get_account_data(client, &signature_set);
|
||||||
|
|
||||||
// Verify on chain Message
|
// Verify on chain vaa
|
||||||
assert_eq!(posted_message.0.vaa_version, 0);
|
assert_eq!(posted_message.0.vaa_version, 0);
|
||||||
assert_eq!(posted_message.0.vaa_signature_account, signature_set);
|
assert_eq!(posted_message.0.vaa_signature_account, signature_set);
|
||||||
assert_eq!(posted_message.0.nonce, nonce);
|
assert_eq!(posted_message.0.nonce, nonce);
|
||||||
|
@ -262,10 +284,17 @@ fn test_bridge_messages(context: &mut Context) {
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
// Emulate Guardian behaviour, verifying the data and publishing signatures/VAA.
|
// Emulate Guardian behaviour, verifying the data and publishing signatures/VAA.
|
||||||
let (vaa, body, body_hash) = common::generate_vaa(&emitter, message.clone(), nonce, 0, 1);
|
let (vaa, body, body_hash) =
|
||||||
|
common::generate_vaa(&emitter, message.clone(), nonce, sequence, 0, 1);
|
||||||
let signature_set =
|
let signature_set =
|
||||||
common::verify_signatures(client, program, payer, body, &context.secret, 0).unwrap();
|
common::verify_signatures(client, program, payer, body, &context.secret, 0).unwrap();
|
||||||
common::post_vaa(client, program, payer, signature_set, vaa).unwrap();
|
common::post_vaa(client, program, payer, signature_set, vaa).unwrap();
|
||||||
|
let message_key = PostedVAA::<'_, { AccountState::MaybeInitialized }>::key(
|
||||||
|
&PostedVAADerivationData {
|
||||||
|
payload_hash: body.to_vec(),
|
||||||
|
},
|
||||||
|
program,
|
||||||
|
);
|
||||||
common::sync(client, payer);
|
common::sync(client, payer);
|
||||||
|
|
||||||
// Fetch chain accounts to verify state.
|
// Fetch chain accounts to verify state.
|
||||||
|
@ -293,6 +322,77 @@ fn test_bridge_messages(context: &mut Context) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make sure that solitaire can claim accounts that already hold lamports so the protocol can't be
|
||||||
|
// DoSd by someone funding derived accounts making CreateAccount fail.
|
||||||
|
fn test_bridge_message_prefunded_account(context: &mut Context) {
|
||||||
|
let (ref payer, ref client, ref program) = common::setup();
|
||||||
|
|
||||||
|
// Data/Nonce used for emitting a message we want to prove exists. Run this twice to make sure
|
||||||
|
// that duplicate data does not clash.
|
||||||
|
let payload = [0u8; 32].to_vec();
|
||||||
|
let emitter = Keypair::new();
|
||||||
|
|
||||||
|
let nonce = rand::thread_rng().gen();
|
||||||
|
let sequence = context.seq.next(emitter.pubkey().to_bytes());
|
||||||
|
|
||||||
|
// Post the message, publishing the data for guardian consumption.
|
||||||
|
// Transfer money into the fee collector as it needs a balance/must exist.
|
||||||
|
let fee_collector = FeeCollector::<'_>::key(None, program);
|
||||||
|
|
||||||
|
let message = Keypair::new();
|
||||||
|
|
||||||
|
// Fund the message account
|
||||||
|
common::execute(
|
||||||
|
client,
|
||||||
|
payer,
|
||||||
|
&[payer],
|
||||||
|
&[system_instruction::transfer(
|
||||||
|
&payer.pubkey(),
|
||||||
|
&message.pubkey(),
|
||||||
|
// This is enough to cover the base rent but not enough for account storage
|
||||||
|
Rent::default().minimum_balance(0),
|
||||||
|
)],
|
||||||
|
CommitmentConfig::processed(),
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
// Capture the resulting message, later functions will need this.
|
||||||
|
let instruction = instructions::post_message(
|
||||||
|
*program,
|
||||||
|
payer.pubkey(),
|
||||||
|
emitter.pubkey(),
|
||||||
|
message.pubkey(),
|
||||||
|
nonce,
|
||||||
|
payload.clone(),
|
||||||
|
ConsistencyLevel::Confirmed,
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
common::execute(
|
||||||
|
client,
|
||||||
|
payer,
|
||||||
|
&[payer, &emitter, &message],
|
||||||
|
&[
|
||||||
|
system_instruction::transfer(&payer.pubkey(), &fee_collector, 10_000),
|
||||||
|
instruction,
|
||||||
|
],
|
||||||
|
CommitmentConfig::processed(),
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
// Verify on chain Message
|
||||||
|
let posted_message: PostedVAAData = common::get_account_data(client, &message.pubkey());
|
||||||
|
assert_eq!(posted_message.0.vaa_version, 0);
|
||||||
|
assert_eq!(posted_message.0.nonce, nonce);
|
||||||
|
assert_eq!(posted_message.0.sequence, sequence);
|
||||||
|
assert_eq!(posted_message.0.emitter_chain, 1);
|
||||||
|
assert_eq!(posted_message.0.payload, payload);
|
||||||
|
assert_eq!(
|
||||||
|
posted_message.0.emitter_address,
|
||||||
|
emitter.pubkey().to_bytes()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
fn test_invalid_emitter(context: &mut Context) {
|
fn test_invalid_emitter(context: &mut Context) {
|
||||||
let (ref payer, ref client, ref program) = common::setup();
|
let (ref payer, ref client, ref program) = common::setup();
|
||||||
|
|
||||||
|
@ -325,7 +425,7 @@ fn test_invalid_emitter(context: &mut Context) {
|
||||||
assert!(common::execute(
|
assert!(common::execute(
|
||||||
client,
|
client,
|
||||||
payer,
|
payer,
|
||||||
&[payer],
|
&[payer, &msg_account],
|
||||||
&[
|
&[
|
||||||
system_instruction::transfer(&payer.pubkey(), &fee_collector, 10_000),
|
system_instruction::transfer(&payer.pubkey(), &fee_collector, 10_000),
|
||||||
instruction,
|
instruction,
|
||||||
|
@ -335,40 +435,6 @@ fn test_invalid_emitter(context: &mut Context) {
|
||||||
.is_err());
|
.is_err());
|
||||||
}
|
}
|
||||||
|
|
||||||
fn test_duplicate_messages_fail(context: &mut Context) {
|
|
||||||
let (ref payer, ref client, ref program) = common::setup();
|
|
||||||
|
|
||||||
// We'll use the following nonce/message/emitter/sequence twice.
|
|
||||||
let nonce = rand::thread_rng().gen();
|
|
||||||
let message = [0u8; 32].to_vec();
|
|
||||||
let emitter = Keypair::new();
|
|
||||||
let sequence = context.seq.next(emitter.pubkey().to_bytes());
|
|
||||||
|
|
||||||
// Post the message, publishing the data for guardian consumption.
|
|
||||||
let message_key = common::post_message(
|
|
||||||
client,
|
|
||||||
program,
|
|
||||||
payer,
|
|
||||||
&emitter,
|
|
||||||
nonce,
|
|
||||||
message.clone(),
|
|
||||||
10_000,
|
|
||||||
)
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
// Second should fail due to duplicate derivations.
|
|
||||||
assert!(common::post_message(
|
|
||||||
client,
|
|
||||||
program,
|
|
||||||
payer,
|
|
||||||
&emitter,
|
|
||||||
nonce,
|
|
||||||
message.clone(),
|
|
||||||
10_000,
|
|
||||||
)
|
|
||||||
.is_err());
|
|
||||||
}
|
|
||||||
|
|
||||||
fn test_guardian_set_change(context: &mut Context) {
|
fn test_guardian_set_change(context: &mut Context) {
|
||||||
// Initialize a wormhole bridge on Solana to test with.
|
// Initialize a wormhole bridge on Solana to test with.
|
||||||
let (ref payer, ref client, ref program) = common::setup();
|
let (ref payer, ref client, ref program) = common::setup();
|
||||||
|
@ -405,10 +471,23 @@ fn test_guardian_set_change(context: &mut Context) {
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let (vaa, body, body_hash) = common::generate_vaa(&emitter, message.clone(), nonce, 0, 1);
|
let (vaa, body, body_hash) =
|
||||||
|
common::generate_vaa(&emitter, message.clone(), nonce, sequence, 0, 1);
|
||||||
let signature_set =
|
let signature_set =
|
||||||
common::verify_signatures(client, program, payer, body, &context.secret, 0).unwrap();
|
common::verify_signatures(client, program, payer, body, &context.secret, 0).unwrap();
|
||||||
common::post_vaa(client, program, payer, signature_set, vaa).unwrap();
|
common::post_vaa(client, program, payer, signature_set, vaa).unwrap();
|
||||||
|
let message_key = PostedVAA::<'_, { AccountState::MaybeInitialized }>::key(
|
||||||
|
&PostedVAADerivationData {
|
||||||
|
payload_hash: body.to_vec(),
|
||||||
|
},
|
||||||
|
program,
|
||||||
|
);
|
||||||
|
let message_key = PostedVAA::<'_, { AccountState::MaybeInitialized }>::key(
|
||||||
|
&PostedVAADerivationData {
|
||||||
|
payload_hash: body.to_vec(),
|
||||||
|
},
|
||||||
|
program,
|
||||||
|
);
|
||||||
common::upgrade_guardian_set(
|
common::upgrade_guardian_set(
|
||||||
client,
|
client,
|
||||||
program,
|
program,
|
||||||
|
@ -461,10 +540,17 @@ fn test_guardian_set_change(context: &mut Context) {
|
||||||
|
|
||||||
// Emulate Guardian behaviour, verifying the data and publishing signatures/VAA.
|
// Emulate Guardian behaviour, verifying the data and publishing signatures/VAA.
|
||||||
let sequence = context.seq.next(emitter.pubkey().to_bytes());
|
let sequence = context.seq.next(emitter.pubkey().to_bytes());
|
||||||
let (vaa, body, body_hash) = common::generate_vaa(&emitter, message.clone(), nonce, 1, 1);
|
let (vaa, body, body_hash) =
|
||||||
|
common::generate_vaa(&emitter, message.clone(), nonce, sequence, 1, 1);
|
||||||
let signature_set =
|
let signature_set =
|
||||||
common::verify_signatures(client, program, payer, body, &context.secret, 1).unwrap();
|
common::verify_signatures(client, program, payer, body, &context.secret, 1).unwrap();
|
||||||
common::post_vaa(client, program, payer, signature_set, vaa).unwrap();
|
common::post_vaa(client, program, payer, signature_set, vaa).unwrap();
|
||||||
|
let message_key = PostedVAA::<'_, { AccountState::MaybeInitialized }>::key(
|
||||||
|
&PostedVAADerivationData {
|
||||||
|
payload_hash: body.to_vec(),
|
||||||
|
},
|
||||||
|
program,
|
||||||
|
);
|
||||||
common::sync(client, payer);
|
common::sync(client, payer);
|
||||||
|
|
||||||
// Fetch chain accounts to verify state.
|
// Fetch chain accounts to verify state.
|
||||||
|
@ -520,7 +606,8 @@ fn test_guardian_set_change_fails(context: &mut Context) {
|
||||||
10_000,
|
10_000,
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let (vaa, body, body_hash) = common::generate_vaa(&emitter, message.clone(), nonce, 1, 1);
|
let (vaa, body, body_hash) =
|
||||||
|
common::generate_vaa(&emitter, message.clone(), nonce, sequence, 1, 1);
|
||||||
|
|
||||||
assert!(common::upgrade_guardian_set(
|
assert!(common::upgrade_guardian_set(
|
||||||
client,
|
client,
|
||||||
|
@ -559,10 +646,17 @@ fn test_set_fees(context: &mut Context) {
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let (vaa, body, body_hash) = common::generate_vaa(&emitter, message.clone(), nonce, 1, 1);
|
let (vaa, body, body_hash) =
|
||||||
|
common::generate_vaa(&emitter, message.clone(), nonce, sequence, 1, 1);
|
||||||
let signature_set =
|
let signature_set =
|
||||||
common::verify_signatures(client, program, payer, body, &context.secret, 1).unwrap();
|
common::verify_signatures(client, program, payer, body, &context.secret, 1).unwrap();
|
||||||
common::post_vaa(client, program, payer, signature_set, vaa).unwrap();
|
common::post_vaa(client, program, payer, signature_set, vaa).unwrap();
|
||||||
|
let message_key = PostedVAA::<'_, { AccountState::MaybeInitialized }>::key(
|
||||||
|
&PostedVAADerivationData {
|
||||||
|
payload_hash: body.to_vec(),
|
||||||
|
},
|
||||||
|
program,
|
||||||
|
);
|
||||||
common::set_fees(
|
common::set_fees(
|
||||||
client,
|
client,
|
||||||
program,
|
program,
|
||||||
|
@ -581,7 +675,7 @@ fn test_set_fees(context: &mut Context) {
|
||||||
assert_eq!(bridge.config.fee, 100);
|
assert_eq!(bridge.config.fee, 100);
|
||||||
|
|
||||||
// Check that posting a new message fails with too small a fee.
|
// Check that posting a new message fails with too small a fee.
|
||||||
let account_balance = client.get_account(&fee_collector).unwrap().lamports;
|
let account_balance = common::get_account_balance(client, &fee_collector);
|
||||||
let emitter = Keypair::new();
|
let emitter = Keypair::new();
|
||||||
let nonce = rand::thread_rng().gen();
|
let nonce = rand::thread_rng().gen();
|
||||||
let message = [0u8; 32].to_vec();
|
let message = [0u8; 32].to_vec();
|
||||||
|
@ -591,7 +685,7 @@ fn test_set_fees(context: &mut Context) {
|
||||||
common::sync(client, payer);
|
common::sync(client, payer);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
client.get_account(&fee_collector).unwrap().lamports,
|
common::get_account_balance(client, &fee_collector),
|
||||||
account_balance,
|
account_balance,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -611,15 +705,22 @@ fn test_set_fees(context: &mut Context) {
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let (vaa, body, body_hash) = common::generate_vaa(&emitter, message.clone(), nonce, 1, 1);
|
let (vaa, body, body_hash) =
|
||||||
|
common::generate_vaa(&emitter, message.clone(), nonce, sequence, 1, 1);
|
||||||
let signature_set =
|
let signature_set =
|
||||||
common::verify_signatures(client, program, payer, body, &context.secret, 1).unwrap();
|
common::verify_signatures(client, program, payer, body, &context.secret, 1).unwrap();
|
||||||
common::post_vaa(client, program, payer, signature_set, vaa).unwrap();
|
common::post_vaa(client, program, payer, signature_set, vaa).unwrap();
|
||||||
|
let message_key = PostedVAA::<'_, { AccountState::MaybeInitialized }>::key(
|
||||||
|
&PostedVAADerivationData {
|
||||||
|
payload_hash: body.to_vec(),
|
||||||
|
},
|
||||||
|
program,
|
||||||
|
);
|
||||||
common::sync(client, payer);
|
common::sync(client, payer);
|
||||||
|
|
||||||
// Verify that the fee collector was paid.
|
// Verify that the fee collector was paid.
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
client.get_account(&fee_collector).unwrap().lamports,
|
common::get_account_balance(client, &fee_collector),
|
||||||
account_balance + 100,
|
account_balance + 100,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -674,10 +775,17 @@ fn test_set_fees_fails(context: &mut Context) {
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let (vaa, body, body_hash) = common::generate_vaa(&emitter, message.clone(), nonce, 1, 1);
|
let (vaa, body, body_hash) =
|
||||||
|
common::generate_vaa(&emitter, message.clone(), nonce, sequence, 1, 1);
|
||||||
let signature_set =
|
let signature_set =
|
||||||
common::verify_signatures(client, program, payer, body, &context.secret, 1).unwrap();
|
common::verify_signatures(client, program, payer, body, &context.secret, 1).unwrap();
|
||||||
common::post_vaa(client, program, payer, signature_set, vaa).unwrap();
|
common::post_vaa(client, program, payer, signature_set, vaa).unwrap();
|
||||||
|
let message_key = PostedVAA::<'_, { AccountState::MaybeInitialized }>::key(
|
||||||
|
&PostedVAADerivationData {
|
||||||
|
payload_hash: body.to_vec(),
|
||||||
|
},
|
||||||
|
program,
|
||||||
|
);
|
||||||
assert!(common::set_fees(
|
assert!(common::set_fees(
|
||||||
client,
|
client,
|
||||||
program,
|
program,
|
||||||
|
@ -713,10 +821,17 @@ fn test_free_fees(context: &mut Context) {
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let (vaa, body, body_hash) = common::generate_vaa(&emitter, message.clone(), nonce, 1, 1);
|
let (vaa, body, body_hash) =
|
||||||
|
common::generate_vaa(&emitter, message.clone(), nonce, sequence, 1, 1);
|
||||||
let signature_set =
|
let signature_set =
|
||||||
common::verify_signatures(client, program, payer, body, &context.secret, 1).unwrap();
|
common::verify_signatures(client, program, payer, body, &context.secret, 1).unwrap();
|
||||||
common::post_vaa(client, program, payer, signature_set, vaa).unwrap();
|
common::post_vaa(client, program, payer, signature_set, vaa).unwrap();
|
||||||
|
let message_key = PostedVAA::<'_, { AccountState::MaybeInitialized }>::key(
|
||||||
|
&PostedVAADerivationData {
|
||||||
|
payload_hash: body.to_vec(),
|
||||||
|
},
|
||||||
|
program,
|
||||||
|
);
|
||||||
common::set_fees(
|
common::set_fees(
|
||||||
client,
|
client,
|
||||||
program,
|
program,
|
||||||
|
@ -735,7 +850,7 @@ fn test_free_fees(context: &mut Context) {
|
||||||
assert_eq!(bridge.config.fee, 0);
|
assert_eq!(bridge.config.fee, 0);
|
||||||
|
|
||||||
// Check that posting a new message is free.
|
// Check that posting a new message is free.
|
||||||
let account_balance = client.get_account(&fee_collector).unwrap().lamports;
|
let account_balance = common::get_account_balance(client, &fee_collector);
|
||||||
let emitter = Keypair::new();
|
let emitter = Keypair::new();
|
||||||
let sequence = context.seq.next(emitter.pubkey().to_bytes());
|
let sequence = context.seq.next(emitter.pubkey().to_bytes());
|
||||||
let nonce = rand::thread_rng().gen();
|
let nonce = rand::thread_rng().gen();
|
||||||
|
@ -743,15 +858,22 @@ fn test_free_fees(context: &mut Context) {
|
||||||
let message_key =
|
let message_key =
|
||||||
common::post_message(client, program, payer, &emitter, nonce, message.clone(), 0).unwrap();
|
common::post_message(client, program, payer, &emitter, nonce, message.clone(), 0).unwrap();
|
||||||
|
|
||||||
let (vaa, body, body_hash) = common::generate_vaa(&emitter, message.clone(), nonce, 1, 1);
|
let (vaa, body, body_hash) =
|
||||||
|
common::generate_vaa(&emitter, message.clone(), nonce, sequence, 1, 1);
|
||||||
let signature_set =
|
let signature_set =
|
||||||
common::verify_signatures(client, program, payer, body, &context.secret, 1).unwrap();
|
common::verify_signatures(client, program, payer, body, &context.secret, 1).unwrap();
|
||||||
common::post_vaa(client, program, payer, signature_set, vaa).unwrap();
|
common::post_vaa(client, program, payer, signature_set, vaa).unwrap();
|
||||||
|
let message_key = PostedVAA::<'_, { AccountState::MaybeInitialized }>::key(
|
||||||
|
&PostedVAADerivationData {
|
||||||
|
payload_hash: body.to_vec(),
|
||||||
|
},
|
||||||
|
program,
|
||||||
|
);
|
||||||
common::sync(client, payer);
|
common::sync(client, payer);
|
||||||
|
|
||||||
// Verify that the fee collector was paid.
|
// Verify that the fee collector was paid.
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
client.get_account(&fee_collector).unwrap().lamports,
|
common::get_account_balance(client, &fee_collector),
|
||||||
account_balance,
|
account_balance,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -797,7 +919,7 @@ fn test_transfer_fees(context: &mut Context) {
|
||||||
|
|
||||||
// Fetch accounts for chain state checking.
|
// Fetch accounts for chain state checking.
|
||||||
let fee_collector = FeeCollector::key(None, &program);
|
let fee_collector = FeeCollector::key(None, &program);
|
||||||
let account_balance = client.get_account(&fee_collector).unwrap().lamports;
|
let account_balance = common::get_account_balance(client, &fee_collector);
|
||||||
|
|
||||||
let message_key = common::post_message(
|
let message_key = common::post_message(
|
||||||
client,
|
client,
|
||||||
|
@ -810,10 +932,17 @@ fn test_transfer_fees(context: &mut Context) {
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let (vaa, body, body_hash) = common::generate_vaa(&emitter, message.clone(), nonce, 1, 1);
|
let (vaa, body, body_hash) =
|
||||||
|
common::generate_vaa(&emitter, message.clone(), nonce, sequence, 1, 1);
|
||||||
let signature_set =
|
let signature_set =
|
||||||
common::verify_signatures(client, program, payer, body, &context.secret, 1).unwrap();
|
common::verify_signatures(client, program, payer, body, &context.secret, 1).unwrap();
|
||||||
common::post_vaa(client, program, payer, signature_set, vaa).unwrap();
|
common::post_vaa(client, program, payer, signature_set, vaa).unwrap();
|
||||||
|
let message_key = PostedVAA::<'_, { AccountState::MaybeInitialized }>::key(
|
||||||
|
&PostedVAADerivationData {
|
||||||
|
payload_hash: body.to_vec(),
|
||||||
|
},
|
||||||
|
program,
|
||||||
|
);
|
||||||
common::transfer_fees(
|
common::transfer_fees(
|
||||||
client,
|
client,
|
||||||
program,
|
program,
|
||||||
|
@ -846,7 +975,7 @@ fn test_transfer_fees_fails(context: &mut Context) {
|
||||||
|
|
||||||
// Fetch accounts for chain state checking.
|
// Fetch accounts for chain state checking.
|
||||||
let fee_collector = FeeCollector::key(None, &program);
|
let fee_collector = FeeCollector::key(None, &program);
|
||||||
let account_balance = client.get_account(&fee_collector).unwrap().lamports;
|
let account_balance = common::get_account_balance(client, &fee_collector);
|
||||||
|
|
||||||
let message_key = common::post_message(
|
let message_key = common::post_message(
|
||||||
client,
|
client,
|
||||||
|
@ -859,10 +988,17 @@ fn test_transfer_fees_fails(context: &mut Context) {
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let (vaa, body, body_hash) = common::generate_vaa(&emitter, message.clone(), nonce, 1, 1);
|
let (vaa, body, body_hash) =
|
||||||
|
common::generate_vaa(&emitter, message.clone(), nonce, sequence, 1, 1);
|
||||||
let signature_set =
|
let signature_set =
|
||||||
common::verify_signatures(client, program, payer, body, &context.secret, 1).unwrap();
|
common::verify_signatures(client, program, payer, body, &context.secret, 1).unwrap();
|
||||||
common::post_vaa(client, program, payer, signature_set, vaa).unwrap();
|
common::post_vaa(client, program, payer, signature_set, vaa).unwrap();
|
||||||
|
let message_key = PostedVAA::<'_, { AccountState::MaybeInitialized }>::key(
|
||||||
|
&PostedVAADerivationData {
|
||||||
|
payload_hash: body.to_vec(),
|
||||||
|
},
|
||||||
|
program,
|
||||||
|
);
|
||||||
|
|
||||||
assert!(common::transfer_fees(
|
assert!(common::transfer_fees(
|
||||||
client,
|
client,
|
||||||
|
@ -893,7 +1029,7 @@ fn test_transfer_too_much(context: &mut Context) {
|
||||||
|
|
||||||
// Fetch accounts for chain state checking.
|
// Fetch accounts for chain state checking.
|
||||||
let fee_collector = FeeCollector::key(None, &program);
|
let fee_collector = FeeCollector::key(None, &program);
|
||||||
let account_balance = client.get_account(&fee_collector).unwrap().lamports;
|
let account_balance = common::get_account_balance(client, &fee_collector);
|
||||||
|
|
||||||
let message_key = common::post_message(
|
let message_key = common::post_message(
|
||||||
client,
|
client,
|
||||||
|
@ -906,10 +1042,17 @@ fn test_transfer_too_much(context: &mut Context) {
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let (vaa, body, body_hash) = common::generate_vaa(&emitter, message.clone(), nonce, 1, 1);
|
let (vaa, body, body_hash) =
|
||||||
|
common::generate_vaa(&emitter, message.clone(), nonce, sequence, 1, 1);
|
||||||
let signature_set =
|
let signature_set =
|
||||||
common::verify_signatures(client, program, payer, body, &context.secret, 1).unwrap();
|
common::verify_signatures(client, program, payer, body, &context.secret, 1).unwrap();
|
||||||
common::post_vaa(client, program, payer, signature_set, vaa).unwrap();
|
common::post_vaa(client, program, payer, signature_set, vaa).unwrap();
|
||||||
|
let message_key = PostedVAA::<'_, { AccountState::MaybeInitialized }>::key(
|
||||||
|
&PostedVAADerivationData {
|
||||||
|
payload_hash: body.to_vec(),
|
||||||
|
},
|
||||||
|
program,
|
||||||
|
);
|
||||||
|
|
||||||
// Should fail to transfer.
|
// Should fail to transfer.
|
||||||
assert!(common::transfer_fees(
|
assert!(common::transfer_fees(
|
||||||
|
@ -933,7 +1076,8 @@ fn test_foreign_bridge_messages(context: &mut Context) {
|
||||||
let sequence = context.seq.next(emitter.pubkey().to_bytes());
|
let sequence = context.seq.next(emitter.pubkey().to_bytes());
|
||||||
|
|
||||||
// Verify the VAA generated on a foreign chain.
|
// Verify the VAA generated on a foreign chain.
|
||||||
let (vaa, body, body_hash) = common::generate_vaa(&emitter, message.clone(), nonce, 0, 2);
|
let (vaa, body, body_hash) =
|
||||||
|
common::generate_vaa(&emitter, message.clone(), nonce, sequence, 0, 2);
|
||||||
|
|
||||||
// Derive where we expect created accounts to be.
|
// Derive where we expect created accounts to be.
|
||||||
let message_key = PostedVAA::<'_, { AccountState::MaybeInitialized }>::key(
|
let message_key = PostedVAA::<'_, { AccountState::MaybeInitialized }>::key(
|
||||||
|
@ -946,6 +1090,12 @@ fn test_foreign_bridge_messages(context: &mut Context) {
|
||||||
let signature_set =
|
let signature_set =
|
||||||
common::verify_signatures(client, program, payer, body, &context.secret, 0).unwrap();
|
common::verify_signatures(client, program, payer, body, &context.secret, 0).unwrap();
|
||||||
common::post_vaa(client, program, payer, signature_set, vaa).unwrap();
|
common::post_vaa(client, program, payer, signature_set, vaa).unwrap();
|
||||||
|
let message_key = PostedVAA::<'_, { AccountState::MaybeInitialized }>::key(
|
||||||
|
&PostedVAADerivationData {
|
||||||
|
payload_hash: body.to_vec(),
|
||||||
|
},
|
||||||
|
program,
|
||||||
|
);
|
||||||
common::sync(client, payer);
|
common::sync(client, payer);
|
||||||
|
|
||||||
// Fetch chain accounts to verify state.
|
// Fetch chain accounts to verify state.
|
||||||
|
@ -982,7 +1132,7 @@ fn test_transfer_total_fails(context: &mut Context) {
|
||||||
common::sync(client, payer);
|
common::sync(client, payer);
|
||||||
|
|
||||||
let fee_collector = FeeCollector::key(None, &program);
|
let fee_collector = FeeCollector::key(None, &program);
|
||||||
let account_balance = client.get_account(&fee_collector).unwrap().lamports;
|
let account_balance = common::get_account_balance(client, &fee_collector);
|
||||||
|
|
||||||
// Prepare to remove total balance, adding 10_000 to include the fee we're about to pay.
|
// Prepare to remove total balance, adding 10_000 to include the fee we're about to pay.
|
||||||
let recipient = Keypair::new();
|
let recipient = Keypair::new();
|
||||||
|
@ -1005,10 +1155,17 @@ fn test_transfer_total_fails(context: &mut Context) {
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let (vaa, body, body_hash) = common::generate_vaa(&emitter, message.clone(), nonce, 1, 1);
|
let (vaa, body, body_hash) =
|
||||||
|
common::generate_vaa(&emitter, message.clone(), nonce, sequence, 1, 1);
|
||||||
let signature_set =
|
let signature_set =
|
||||||
common::verify_signatures(client, program, payer, body, &context.secret, 1).unwrap();
|
common::verify_signatures(client, program, payer, body, &context.secret, 1).unwrap();
|
||||||
common::post_vaa(client, program, payer, signature_set, vaa).unwrap();
|
common::post_vaa(client, program, payer, signature_set, vaa).unwrap();
|
||||||
|
let message_key = PostedVAA::<'_, { AccountState::MaybeInitialized }>::key(
|
||||||
|
&PostedVAADerivationData {
|
||||||
|
payload_hash: body.to_vec(),
|
||||||
|
},
|
||||||
|
program,
|
||||||
|
);
|
||||||
|
|
||||||
// Transferring total fees should fail, to prevent the account being de-allocated.
|
// Transferring total fees should fail, to prevent the account being de-allocated.
|
||||||
assert!(common::transfer_fees(
|
assert!(common::transfer_fees(
|
||||||
|
@ -1026,7 +1183,7 @@ fn test_transfer_total_fails(context: &mut Context) {
|
||||||
// The fee should have been paid, but other than that the balance should be exactly the same,
|
// The fee should have been paid, but other than that the balance should be exactly the same,
|
||||||
// I.E non-zero.
|
// I.E non-zero.
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
client.get_account(&fee_collector).unwrap().lamports,
|
common::get_account_balance(client, &fee_collector),
|
||||||
account_balance + 10_000
|
account_balance + 10_000
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1061,10 +1218,17 @@ fn test_upgrade_contract(context: &mut Context) {
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let (vaa, body, body_hash) = common::generate_vaa(&emitter, message.clone(), nonce, 0, 1);
|
let (vaa, body, body_hash) =
|
||||||
|
common::generate_vaa(&emitter, message.clone(), nonce, sequence, 0, 1);
|
||||||
let signature_set =
|
let signature_set =
|
||||||
common::verify_signatures(client, program, payer, body, &context.secret, 0).unwrap();
|
common::verify_signatures(client, program, payer, body, &context.secret, 0).unwrap();
|
||||||
common::post_vaa(client, program, payer, signature_set, vaa).unwrap();
|
common::post_vaa(client, program, payer, signature_set, vaa).unwrap();
|
||||||
|
let message_key = PostedVAA::<'_, { AccountState::MaybeInitialized }>::key(
|
||||||
|
&PostedVAADerivationData {
|
||||||
|
payload_hash: body.to_vec(),
|
||||||
|
},
|
||||||
|
program,
|
||||||
|
);
|
||||||
common::upgrade_contract(
|
common::upgrade_contract(
|
||||||
client,
|
client,
|
||||||
program,
|
program,
|
||||||
|
|
Loading…
Reference in New Issue