From 1d6f15843e192045584dbd61aebcc48946766a11 Mon Sep 17 00:00:00 2001 From: liyukun Date: Sat, 6 Jan 2024 10:26:23 +0800 Subject: [PATCH] chore: commit for suggestions --- Cargo.lock | 1454 ++++++++++++++++++++++++++--- Cargo.toml | 4 +- contracts/spore/src/entry.rs | 6 +- lib/types/schemas/action.mol | 6 +- lib/types/src/generated/action.rs | 68 +- lib/utils/src/lib.rs | 2 +- tests/src/utils/co_build.rs | 6 +- 7 files changed, 1385 insertions(+), 161 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 84cd821..fd57f26 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,56 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "ahash" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" +dependencies = [ + "getrandom 0.2.11", + "once_cell", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +dependencies = [ + "memchr", +] + +[[package]] +name = "anyhow" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + [[package]] name = "blake2b-ref" version = "0.3.1" @@ -9,211 +59,1192 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "294d17c72e0ba59fad763caa112368d0672083779cdebbb97164f4bb4c1e339a" [[package]] -name = "blake2b-rs" -version = "0.2.0" +name = "blake2b-rs" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89a8565807f21b913288968e391819e7f9b2f0f46c7b89549c051cccf3a2771" +dependencies = [ + "cc", + "cty", +] + +[[package]] +name = "buddy-alloc" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f0d2da64a6a895d5a7e0724882825d50f83c13396b1b9f1878e19a024bab395" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +dependencies = [ + "serde", +] + +[[package]] +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "ckb-always-success-script" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b3b72a38c9920a29990df12002c4d069a147c8782f0c211f8a01b2df8f42bfd" + +[[package]] +name = "ckb-chain-spec" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbd58081d4ac4f08d068b52c5a07f0b379d93aad0dfa8344c6890429a9b73c2b" +dependencies = [ + "ckb-constant", + "ckb-crypto", + "ckb-dao-utils", + "ckb-error", + "ckb-hash 0.111.0", + "ckb-jsonrpc-types", + "ckb-pow", + "ckb-rational", + "ckb-resource", + "ckb-traits", + "ckb-types", + "ckb-util", + "serde", + "toml 0.5.11", +] + +[[package]] +name = "ckb-channel" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "701e6829c3dcbae46dd2442de63d080046480a6c2bb4951dbf419ad092459402" +dependencies = [ + "crossbeam-channel", +] + +[[package]] +name = "ckb-constant" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d5c980d4724770f72a37bceffa26ea64dd914891e45e856e2a3792fdb4a5a18" + +[[package]] +name = "ckb-crypto" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df80db694e42b64a5774ae551daff3c8310cd99bb528643dbe0dd409abb298e7" +dependencies = [ + "ckb-fixed-hash", + "faster-hex 0.6.1", + "lazy_static", + "rand 0.7.3", + "secp256k1", + "thiserror", +] + +[[package]] +name = "ckb-dao" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76cb0dd4d284d6908595fa809668555ad36bc89538ea9440d11208090481c240" +dependencies = [ + "byteorder", + "ckb-chain-spec", + "ckb-dao-utils", + "ckb-traits", + "ckb-types", +] + +[[package]] +name = "ckb-dao-utils" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e158ce5a4e9d1fcd08d9dee87332474572c629c6273cca0aea80ba24892a403" +dependencies = [ + "byteorder", + "ckb-error", + "ckb-types", +] + +[[package]] +name = "ckb-error" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34cfd733cabcb4262ee679c02733864b13c8fa879e3aabc078fe0ec727cd95d6" +dependencies = [ + "anyhow", + "ckb-occupied-capacity", + "derive_more", + "thiserror", +] + +[[package]] +name = "ckb-fixed-hash" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b1dfab045fffa31cae9680d73e1f09833ca1abfb807dc4b9544739c94c23fd0" +dependencies = [ + "ckb-fixed-hash-core", + "ckb-fixed-hash-macros", +] + +[[package]] +name = "ckb-fixed-hash-core" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdd1727a6ecd4d0bcab604cb1ef707fe92e939fa6e9a438f9f25bf05208cb080" +dependencies = [ + "faster-hex 0.6.1", + "serde", + "thiserror", +] + +[[package]] +name = "ckb-fixed-hash-macros" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5da34c32585c35715fcde4e3a1dd3b0346d7af43506c5e51c613f01483e4f9" +dependencies = [ + "ckb-fixed-hash-core", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ckb-gen-types" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3bc54ca99b09e1eb5fc6c49bb1156644ce57fce9c6f52b5c13110b9a3143f7e" +dependencies = [ + "cfg-if", + "ckb-error", + "ckb-fixed-hash", + "ckb-hash 0.111.0", + "ckb-occupied-capacity", + "molecule", + "numext-fixed-uint", +] + +[[package]] +name = "ckb-hash" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c88e5e2d6454be488fa5cf8b49175879353c6af969ff210dd6416f315b53120" +dependencies = [ + "blake2b-ref", + "blake2b-rs", +] + +[[package]] +name = "ckb-hash" +version = "0.112.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25af660fc8746f7c756444e6aa47ede9a874206563b6a1ce1b230a5b86519392" +dependencies = [ + "blake2b-ref", + "blake2b-rs", +] + +[[package]] +name = "ckb-jsonrpc-types" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d789a71538da07871c11aecbd28d6c632bb426bdfeed5fc2fa1b455e31152468" +dependencies = [ + "ckb-types", + "faster-hex 0.6.1", + "serde", + "serde_json", +] + +[[package]] +name = "ckb-logger" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "939fa09ca3534248d3d452552546f016fc7e11346644fbc5b55d2ad38d3e80e7" +dependencies = [ + "log", +] + +[[package]] +name = "ckb-merkle-mountain-range" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56ccb671c5921be8a84686e6212ca184cb1d7c51cadcdbfcbd1cc3f042f5dfb8" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "ckb-mock-tx-types" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcd5b156c36f03ad6053e174e26a874088c8e9098c3a2e80ec93dc9831ecfac3" +dependencies = [ + "ckb-jsonrpc-types", + "ckb-traits", + "ckb-types", + "serde", +] + +[[package]] +name = "ckb-occupied-capacity" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "358ad364465a5a359575642c12952ba8735a148382789d65ddd5231cd21899fc" +dependencies = [ + "ckb-occupied-capacity-core", + "ckb-occupied-capacity-macros", +] + +[[package]] +name = "ckb-occupied-capacity-core" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de2dc06db98f8a995cb7145bc56dbd17bb0c8ab2e59a07aaa40f2c956c2451dd" +dependencies = [ + "serde", +] + +[[package]] +name = "ckb-occupied-capacity-macros" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1709e0f101026c4ef29b1593692e480b03cdb4e0dace1e348494c6554d50d35" +dependencies = [ + "ckb-occupied-capacity-core", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ckb-pow" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "481e76388993d7e6e0dd797e8532c60398901787e28d0638ca114254257b8813" +dependencies = [ + "byteorder", + "ckb-hash 0.111.0", + "ckb-types", + "eaglesong", + "log", + "serde", +] + +[[package]] +name = "ckb-rational" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd3959391a4fb05d6a2578aa8db75732ada1ce381fb34d6eeaf09d395702e63c" +dependencies = [ + "numext-fixed-uint", + "serde", +] + +[[package]] +name = "ckb-resource" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03222b0613cf3f55cb181471d7a84879b6fba5e920e2e1c7ba2c2315614bd387" +dependencies = [ + "ckb-system-scripts", + "ckb-types", + "includedir", + "includedir_codegen", + "phf", + "serde", + "walkdir", +] + +[[package]] +name = "ckb-script" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c9075ad901eae97925f491b6be675d7b19bf7b10eaa94a88f6e8070c0cd00ba" +dependencies = [ + "byteorder", + "ckb-chain-spec", + "ckb-error", + "ckb-hash 0.111.0", + "ckb-logger", + "ckb-traits", + "ckb-types", + "ckb-vm", + "faster-hex 0.6.1", + "serde", +] + +[[package]] +name = "ckb-standalone-types" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5c776d70eb4f60a22a3180857646d77b2da8d33c0c4a063ad9f6610fc94609f" +dependencies = [ + "blake2b-ref", + "cfg-if", + "molecule", +] + +[[package]] +name = "ckb-std" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a08518aa0fd4ce069d3ec80b63dcd3d6543ad3805ad1c0b4e1d8e4d38f8a9fc" +dependencies = [ + "buddy-alloc", + "cc", + "ckb-standalone-types", +] + +[[package]] +name = "ckb-system-scripts" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa5c59063142de7a68cfad4449c6b3863563856219a2925dfb8c5f019ec2aa47" +dependencies = [ + "blake2b-rs", + "faster-hex 0.6.1", + "includedir", + "includedir_codegen", + "phf", +] + +[[package]] +name = "ckb-systemtime" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5c03dd01263a66eaf171fb1bbadd12d80a0b54abe19aa55a2c53c5ae3300cda" + +[[package]] +name = "ckb-testtool" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed4e8a7369f0dfc0294f7e24927be7661af26c1e3dbe7e917d868d3f1010e86f" +dependencies = [ + "ckb-always-success-script", + "ckb-chain-spec", + "ckb-crypto", + "ckb-error", + "ckb-hash 0.111.0", + "ckb-jsonrpc-types", + "ckb-mock-tx-types", + "ckb-resource", + "ckb-script", + "ckb-traits", + "ckb-types", + "ckb-verification", + "lazy_static", + "rand 0.8.5", +] + +[[package]] +name = "ckb-traits" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca049aba2cb2d1208c6044accb497b17290ad56de629f6a4b95eded67a43fd40" +dependencies = [ + "ckb-types", +] + +[[package]] +name = "ckb-transaction-cobuild" +version = "0.1.0" +source = "git+https://github.com/cryptape/ckb-transaction-cobuild-poc?rev=bdb0c74#bdb0c745a76c1aa349a0e881ad4ccdd4af286723" +dependencies = [ + "blake2b-ref", + "ckb-gen-types", + "ckb-std", + "molecule", +] + +[[package]] +name = "ckb-types" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6ec737e4957418bbd0f4091e8565a89bbd8f6fc37a20360820e44d1f1e44e58" +dependencies = [ + "bit-vec", + "bytes", + "ckb-channel", + "ckb-constant", + "ckb-error", + "ckb-fixed-hash", + "ckb-gen-types", + "ckb-hash 0.111.0", + "ckb-merkle-mountain-range", + "ckb-occupied-capacity", + "ckb-rational", + "derive_more", + "golomb-coded-set", + "merkle-cbt", + "molecule", + "numext-fixed-uint", + "once_cell", + "paste", +] + +[[package]] +name = "ckb-util" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "011b907b18aa706fc224a1309f14eadd9cc14c42cf2258ca3010d1324bc20f10" +dependencies = [ + "linked-hash-map", + "once_cell", + "parking_lot", + "regex", +] + +[[package]] +name = "ckb-verification" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe3338bb8cf49c5a21de636eeb448deeba1e379491d34b67f2201fc77a08e215" +dependencies = [ + "ckb-chain-spec", + "ckb-dao", + "ckb-dao-utils", + "ckb-error", + "ckb-pow", + "ckb-script", + "ckb-systemtime", + "ckb-traits", + "ckb-types", + "ckb-verification-traits", + "derive_more", + "lru", +] + +[[package]] +name = "ckb-verification-traits" +version = "0.111.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba1bbfdeff1f930f26c60103b59442494dba83493254bb255f1ba318be2f27fe" +dependencies = [ + "bitflags", + "ckb-error", +] + +[[package]] +name = "ckb-vm" +version = "0.24.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cc004a826b9bc9319ffae0b8415690e1b5f1482266d55fbd43843aa40ddcd63" +dependencies = [ + "byteorder", + "bytes", + "cc", + "ckb-vm-definitions", + "derive_more", + "goblin 0.2.3", + "goblin 0.4.0", + "rand 0.7.3", + "scroll", + "serde", +] + +[[package]] +name = "ckb-vm-definitions" +version = "0.24.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4ced3ff9d79b53d93c106720f6c1f855694290e33581850e05c859500eee83f" +dependencies = [ + "paste", +] + +[[package]] +name = "cluster" +version = "0.1.0" +dependencies = [ + "ckb-hash 0.112.1", + "ckb-std", + "spore-build-tools", + "spore-errors", + "spore-types", + "spore-utils", +] + +[[package]] +name = "cluster_agent" +version = "0.1.0" +dependencies = [ + "ckb-hash 0.112.1", + "ckb-std", + "spore-build-tools", + "spore-errors", + "spore-types", + "spore-utils", +] + +[[package]] +name = "cluster_proxy" +version = "0.1.0" +dependencies = [ + "ckb-hash 0.112.1", + "ckb-std", + "hex", + "spore-build-tools", + "spore-errors", + "spore-types", + "spore-utils", +] + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82a9b73a36529d9c47029b9fb3a6f0ea3cc916a261195352ba19e770fc1748b2" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3a430a770ebd84726f584a90ee7f020d28db52c6d02138900f22341f866d39c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "cty" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn 1.0.109", +] + +[[package]] +name = "eaglesong" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d978bd5d343e8ab9b5c0fc8d93ff9c602fdc96616ffff9c05ac7a155419b824" + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "faster-hex" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51e2ce894d53b295cf97b05685aa077950ff3e8541af83217fc720a6437169f8" + +[[package]] +name = "faster-hex" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2a2b11eda1d40935b26cf18f6833c526845ae8c41e58d09af6adeb6f0269183" + +[[package]] +name = "flate2" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "goblin" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d20fd25aa456527ce4f544271ae4fea65d2eda4a6561ea56f39fb3ee4f7e3884" +dependencies = [ + "log", + "plain", + "scroll", +] + +[[package]] +name = "goblin" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "532a09cd3df2c6bbfc795fb0434bff8f22255d1d07328180e918a2e6ce122d4d" +dependencies = [ + "log", + "plain", + "scroll", +] + +[[package]] +name = "golomb-coded-set" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7076c0cd6257d84b785b0f22c36443dd47a5e86a1256d7ef82c8cb88ea9a7e" +dependencies = [ + "siphasher", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + +[[package]] +name = "heapsize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1679e6ea370dee694f91f1dc469bf94cf8f52051d147aec3e1f9497c6fc22461" +dependencies = [ + "winapi", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "includedir" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afd126bd778c00c43a9dc76d1609a0894bf4222088088b2217ccc0ce9e816db7" +dependencies = [ + "flate2", + "phf", +] + +[[package]] +name = "includedir_codegen" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ac1500c9780957c9808c4ec3b94002f35aab01483833f5a8bce7dfb243e3148" +dependencies = [ + "flate2", + "phf_codegen", + "walkdir", +] + +[[package]] +name = "indexmap" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +dependencies = [ + "equivalent", + "hashbrown 0.14.3", +] + +[[package]] +name = "itoa" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" + +[[package]] +name = "kmp" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "131bddab59a64213cc1e9f0c5be010d7eb485951358ab7e52017888dec482028" + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.151" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" + +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" +dependencies = [ + "serde", +] + +[[package]] +name = "lock_api" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "lru" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999beba7b6e8345721bd280141ed958096a2e4abdf74f67ff4ce49b4b54e47a" +dependencies = [ + "hashbrown 0.12.3", +] + +[[package]] +name = "memchr" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" + +[[package]] +name = "merkle-cbt" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "171d2f700835121c3b04ccf0880882987a050fd5c7ae88148abf537d33dd3a56" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + +[[package]] +name = "molecule" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fd9767ab5e5f2ea40f71ff4c8bdb633c50509052e093c2fdd0e390a749dfa3" +dependencies = [ + "bytes", + "cfg-if", + "faster-hex 0.6.1", +] + +[[package]] +name = "numext-constructor" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "621fe0f044729f810c6815cdd77e8f5e0cd803ce4f6a38380ebfc1322af98661" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "numext-fixed-uint" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c68c76f96d589d1009a666c5072f37f3114d682696505f2cf445f27766c7d70" +dependencies = [ + "numext-fixed-uint-core", + "numext-fixed-uint-hack", +] + +[[package]] +name = "numext-fixed-uint-core" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6aab1d6457b97b49482f22a92f0f58a2f39bdd7f3b2f977eae67e8bc206aa980" +dependencies = [ + "heapsize", + "numext-constructor", + "rand 0.7.3", + "serde", + "thiserror", +] + +[[package]] +name = "numext-fixed-uint-hack" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0200f8d55c36ec1b6a8cf810115be85d4814f045e0097dfd50033ba25adb4c9e" +dependencies = [ + "numext-fixed-uint-core", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets", +] + +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + +[[package]] +name = "phf" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12" +dependencies = [ + "phf_shared", +] + +[[package]] +name = "phf_codegen" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbffee61585b0411840d3ece935cce9cb6321f01c45477d30066498cd5e1a815" +dependencies = [ + "phf_generator", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17367f0cc86f2d25802b2c26ee58a7b23faeccf78a396094c13dced0d0182526" +dependencies = [ + "phf_shared", + "rand 0.7.3", +] + +[[package]] +name = "phf_shared" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a89a8565807f21b913288968e391819e7f9b2f0f46c7b89549c051cccf3a2771" +checksum = "c00cf8b9eafe68dde5e9eaa2cef8ee84a9336a47d566ec55ca16589633b65af7" dependencies = [ - "cc", - "cty", + "siphasher", ] [[package]] -name = "buddy-alloc" -version = "0.5.1" +name = "plain" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f0d2da64a6a895d5a7e0724882825d50f83c13396b1b9f1878e19a024bab395" +checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" [[package]] -name = "cc" -version = "1.0.83" +name = "ppv-lite86" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "libc", -] +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] -name = "cfg-if" -version = "1.0.0" +name = "proc-macro2" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" +dependencies = [ + "unicode-ident", +] [[package]] -name = "ckb-gen-types" -version = "0.111.0" +name = "quote" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3bc54ca99b09e1eb5fc6c49bb1156644ce57fce9c6f52b5c13110b9a3143f7e" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ - "cfg-if", - "molecule", + "proc-macro2", ] [[package]] -name = "ckb-hash" -version = "0.112.1" +name = "rand" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25af660fc8746f7c756444e6aa47ede9a874206563b6a1ce1b230a5b86519392" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ - "blake2b-ref", - "blake2b-rs", + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", + "rand_pcg", ] [[package]] -name = "ckb-standalone-types" -version = "0.1.5" +name = "rand" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5c776d70eb4f60a22a3180857646d77b2da8d33c0c4a063ad9f6610fc94609f" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ - "blake2b-ref", - "cfg-if", - "molecule", + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", ] [[package]] -name = "ckb-std" -version = "0.14.3" +name = "rand_chacha" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a08518aa0fd4ce069d3ec80b63dcd3d6543ad3805ad1c0b4e1d8e4d38f8a9fc" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" dependencies = [ - "buddy-alloc", - "cc", - "ckb-standalone-types", + "ppv-lite86", + "rand_core 0.5.1", ] [[package]] -name = "ckb-transaction-cobuild" -version = "0.1.0" -source = "git+https://github.com/cryptape/ckb-transaction-cobuild-poc?rev=bdb0c74#bdb0c745a76c1aa349a0e881ad4ccdd4af286723" +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ - "blake2b-ref", - "ckb-gen-types", - "ckb-std", - "molecule", + "ppv-lite86", + "rand_core 0.6.4", ] [[package]] -name = "cluster" -version = "0.1.0" +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" dependencies = [ - "ckb-hash", - "ckb-std", - "spore-build-tools", - "spore-errors", - "spore-types", - "spore-utils", + "getrandom 0.1.16", ] [[package]] -name = "cluster_agent" -version = "0.1.0" +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "ckb-hash", - "ckb-std", - "spore-build-tools", - "spore-errors", - "spore-types", - "spore-utils", + "getrandom 0.2.11", ] [[package]] -name = "cluster_proxy" -version = "0.1.0" +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" dependencies = [ - "ckb-hash", - "ckb-std", - "hex", - "spore-build-tools", - "spore-errors", - "spore-types", - "spore-utils", + "rand_core 0.5.1", ] [[package]] -name = "cty" -version = "0.2.2" +name = "rand_pcg" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" +checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" +dependencies = [ + "rand_core 0.5.1", +] [[package]] -name = "equivalent" -version = "1.0.1" +name = "redox_syscall" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags", +] [[package]] -name = "faster-hex" -version = "0.9.0" +name = "regex" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2a2b11eda1d40935b26cf18f6833c526845ae8c41e58d09af6adeb6f0269183" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] [[package]] -name = "hashbrown" -version = "0.14.3" +name = "regex-automata" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] [[package]] -name = "hex" -version = "0.4.3" +name = "regex-syntax" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] -name = "indexmap" -version = "2.1.0" +name = "rustc_version" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "equivalent", - "hashbrown", + "semver", ] [[package]] -name = "kmp" -version = "0.1.1" +name = "ryu" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "131bddab59a64213cc1e9f0c5be010d7eb485951358ab7e52017888dec482028" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] -name = "libc" -version = "0.2.151" +name = "same-file" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] [[package]] -name = "memchr" -version = "2.7.1" +name = "scopeguard" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] -name = "molecule" -version = "0.7.5" +name = "scroll" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd9767ab5e5f2ea40f71ff4c8bdb633c50509052e093c2fdd0e390a749dfa3" +checksum = "fda28d4b4830b807a8b43f7b0e6b5df875311b3e7621d84577188c175b6ec1ec" dependencies = [ - "cfg-if", + "scroll_derive", ] [[package]] -name = "proc-macro2" -version = "1.0.75" +name = "scroll_derive" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" +checksum = "aaaae8f38bb311444cfb7f1979af0bc9240d95795f75f9ceddf6a59b79ceffa0" dependencies = [ - "unicode-ident", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] -name = "quote" -version = "1.0.35" +name = "secp256k1" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "6b1629c9c557ef9b293568b338dddfc8208c98a18c59d722a9d53f859d9c9b62" dependencies = [ - "proc-macro2", + "secp256k1-sys", +] + +[[package]] +name = "secp256k1-sys" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83080e2c2fc1006e625be82e5d1eb6a43b7fd9578b617fcc55814daf286bba4b" +dependencies = [ + "cc", ] +[[package]] +name = "semver" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" + [[package]] name = "serde" version = "1.0.194" @@ -231,7 +1262,18 @@ checksum = "a3385e45322e8f9931410f01b3031ec534c3947d0e94c18049af4d9f9907d4e0" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.48", +] + +[[package]] +name = "serde_json" +version = "1.0.111" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" +dependencies = [ + "itoa", + "ryu", + "serde", ] [[package]] @@ -243,11 +1285,23 @@ dependencies = [ "serde", ] +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + [[package]] name = "spore" version = "0.1.0" dependencies = [ - "ckb-hash", + "ckb-hash 0.112.1", "ckb-std", "ckb-transaction-cobuild", "hex", @@ -263,9 +1317,9 @@ dependencies = [ name = "spore-build-tools" version = "0.1.0" dependencies = [ - "faster-hex", + "faster-hex 0.9.0", "serde", - "toml", + "toml 0.8.8", ] [[package]] @@ -296,12 +1350,23 @@ dependencies = [ name = "spore_extension_lua" version = "0.1.0" dependencies = [ - "ckb-hash", + "ckb-hash 0.112.1", "ckb-std", "spore-errors", "spore-utils", ] +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "syn" version = "2.0.48" @@ -313,6 +1378,45 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "tests" +version = "0.1.0" +dependencies = [ + "ckb-testtool", + "hex", + "spore-types", + "spore-utils", +] + +[[package]] +name = "thiserror" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + [[package]] name = "toml" version = "0.8.8" @@ -353,6 +1457,122 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "walkdir" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + [[package]] name = "winnow" version = "0.5.32" diff --git a/Cargo.toml b/Cargo.toml index 4d856b5..5c54e59 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,14 +3,16 @@ members = [ "lib/types", "lib/utils", "lib/errors", + "lib/build", "contracts/spore", "contracts/cluster", "contracts/cluster_proxy", "contracts/cluster_agent", "contracts/spore_extension_lua", + + "tests", ] -exclude = ["tests"] [profile.release] overflow-checks = true diff --git a/contracts/spore/src/entry.rs b/contracts/spore/src/entry.rs index a4112cb..e4d216b 100644 --- a/contracts/spore/src/entry.rs +++ b/contracts/spore/src/entry.rs @@ -141,7 +141,7 @@ fn process_creation(index: usize) -> Result<(), Error> { let action::SporeActionUnion::Mint(mint) = extract_spore_action()?.to_enum() else { return Err(Error::SporeActionMismatch); }; - if mint.nft_id().as_slice() != spore_id + if mint.spore_id().as_slice() != spore_id || mint.data_hash().as_slice() != blake2b_256(spore_data.as_slice()) { return Err(Error::SporeActionFieldMismatch); @@ -173,7 +173,7 @@ fn process_destruction() -> Result<(), Error> { let action::SporeActionUnion::Burn(burn) = extract_spore_action()?.to_enum() else { return Err(Error::SporeActionMismatch); }; - if burn.nft_id().as_slice() != load_type_args(0, GroupInput).as_ref() { + if burn.spore_id().as_slice() != load_type_args(0, GroupInput).as_ref() { return Err(Error::SporeActionFieldMismatch); } check_spore_address(GroupInput, burn.from())?; @@ -208,7 +208,7 @@ fn process_transfer() -> Result<(), Error> { let action::SporeActionUnion::Transfer(transfer) = extract_spore_action()?.to_enum() else { return Err(Error::SporeActionMismatch); }; - if transfer.nft_id().as_slice() != load_type_args(0, GroupInput).as_ref() { + if transfer.spore_id().as_slice() != load_type_args(0, GroupInput).as_ref() { return Err(Error::SporeActionFieldMismatch); } check_spore_address(GroupInput, transfer.from())?; diff --git a/lib/types/schemas/action.mol b/lib/types/schemas/action.mol index 636c8b5..a497554 100644 --- a/lib/types/schemas/action.mol +++ b/lib/types/schemas/action.mol @@ -14,19 +14,19 @@ union Address { /* Actions for Spore */ table Mint { - nft_id: Byte32, + spore_id: Byte32, to: Address, data_hash: Byte32, } table Transfer { - nft_id: Byte32, + spore_id: Byte32, from: Address, to: Address, } table Burn { - nft_id: Byte32, + spore_id: Byte32, from: Address, } diff --git a/lib/types/src/generated/action.rs b/lib/types/src/generated/action.rs index 445de2d..c73d740 100644 --- a/lib/types/src/generated/action.rs +++ b/lib/types/src/generated/action.rs @@ -1395,7 +1395,7 @@ impl ::core::fmt::Debug for Mint { impl ::core::fmt::Display for Mint { fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { write!(f, "{} {{ ", Self::NAME)?; - write!(f, "{}: {}", "nft_id", self.nft_id())?; + write!(f, "{}: {}", "spore_id", self.spore_id())?; write!(f, ", {}: {}", "to", self.to())?; write!(f, ", {}: {}", "data_hash", self.data_hash())?; let extra_count = self.count_extra_fields(); @@ -1436,7 +1436,7 @@ impl Mint { pub fn has_extra_fields(&self) -> bool { Self::FIELD_COUNT != self.field_count() } - pub fn nft_id(&self) -> Byte32 { + pub fn spore_id(&self) -> Byte32 { let slice = self.as_slice(); let start = molecule::unpack_number(&slice[4..]) as usize; let end = molecule::unpack_number(&slice[8..]) as usize; @@ -1485,7 +1485,7 @@ impl molecule::prelude::Entity for Mint { } fn as_builder(self) -> Self::Builder { Self::new_builder() - .nft_id(self.nft_id()) + .spore_id(self.spore_id()) .to(self.to()) .data_hash(self.data_hash()) } @@ -1509,7 +1509,7 @@ impl<'r> ::core::fmt::Debug for MintReader<'r> { impl<'r> ::core::fmt::Display for MintReader<'r> { fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { write!(f, "{} {{ ", Self::NAME)?; - write!(f, "{}: {}", "nft_id", self.nft_id())?; + write!(f, "{}: {}", "spore_id", self.spore_id())?; write!(f, ", {}: {}", "to", self.to())?; write!(f, ", {}: {}", "data_hash", self.data_hash())?; let extra_count = self.count_extra_fields(); @@ -1537,7 +1537,7 @@ impl<'r> MintReader<'r> { pub fn has_extra_fields(&self) -> bool { Self::FIELD_COUNT != self.field_count() } - pub fn nft_id(&self) -> Byte32Reader<'r> { + pub fn spore_id(&self) -> Byte32Reader<'r> { let slice = self.as_slice(); let start = molecule::unpack_number(&slice[4..]) as usize; let end = molecule::unpack_number(&slice[8..]) as usize; @@ -1614,14 +1614,14 @@ impl<'r> molecule::prelude::Reader<'r> for MintReader<'r> { } #[derive(Clone, Debug, Default)] pub struct MintBuilder { - pub(crate) nft_id: Byte32, + pub(crate) spore_id: Byte32, pub(crate) to: Address, pub(crate) data_hash: Byte32, } impl MintBuilder { pub const FIELD_COUNT: usize = 3; - pub fn nft_id(mut self, v: Byte32) -> Self { - self.nft_id = v; + pub fn spore_id(mut self, v: Byte32) -> Self { + self.spore_id = v; self } pub fn to(mut self, v: Address) -> Self { @@ -1638,7 +1638,7 @@ impl molecule::prelude::Builder for MintBuilder { const NAME: &'static str = "MintBuilder"; fn expected_length(&self) -> usize { molecule::NUMBER_SIZE * (Self::FIELD_COUNT + 1) - + self.nft_id.as_slice().len() + + self.spore_id.as_slice().len() + self.to.as_slice().len() + self.data_hash.as_slice().len() } @@ -1646,7 +1646,7 @@ impl molecule::prelude::Builder for MintBuilder { let mut total_size = molecule::NUMBER_SIZE * (Self::FIELD_COUNT + 1); let mut offsets = Vec::with_capacity(Self::FIELD_COUNT); offsets.push(total_size); - total_size += self.nft_id.as_slice().len(); + total_size += self.spore_id.as_slice().len(); offsets.push(total_size); total_size += self.to.as_slice().len(); offsets.push(total_size); @@ -1655,7 +1655,7 @@ impl molecule::prelude::Builder for MintBuilder { for offset in offsets.into_iter() { writer.write_all(&molecule::pack_number(offset as molecule::Number))?; } - writer.write_all(self.nft_id.as_slice())?; + writer.write_all(self.spore_id.as_slice())?; writer.write_all(self.to.as_slice())?; writer.write_all(self.data_hash.as_slice())?; Ok(()) @@ -1686,7 +1686,7 @@ impl ::core::fmt::Debug for Transfer { impl ::core::fmt::Display for Transfer { fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { write!(f, "{} {{ ", Self::NAME)?; - write!(f, "{}: {}", "nft_id", self.nft_id())?; + write!(f, "{}: {}", "spore_id", self.spore_id())?; write!(f, ", {}: {}", "from", self.from())?; write!(f, ", {}: {}", "to", self.to())?; let extra_count = self.count_extra_fields(); @@ -1728,7 +1728,7 @@ impl Transfer { pub fn has_extra_fields(&self) -> bool { Self::FIELD_COUNT != self.field_count() } - pub fn nft_id(&self) -> Byte32 { + pub fn spore_id(&self) -> Byte32 { let slice = self.as_slice(); let start = molecule::unpack_number(&slice[4..]) as usize; let end = molecule::unpack_number(&slice[8..]) as usize; @@ -1777,7 +1777,7 @@ impl molecule::prelude::Entity for Transfer { } fn as_builder(self) -> Self::Builder { Self::new_builder() - .nft_id(self.nft_id()) + .spore_id(self.spore_id()) .from(self.from()) .to(self.to()) } @@ -1801,7 +1801,7 @@ impl<'r> ::core::fmt::Debug for TransferReader<'r> { impl<'r> ::core::fmt::Display for TransferReader<'r> { fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { write!(f, "{} {{ ", Self::NAME)?; - write!(f, "{}: {}", "nft_id", self.nft_id())?; + write!(f, "{}: {}", "spore_id", self.spore_id())?; write!(f, ", {}: {}", "from", self.from())?; write!(f, ", {}: {}", "to", self.to())?; let extra_count = self.count_extra_fields(); @@ -1829,7 +1829,7 @@ impl<'r> TransferReader<'r> { pub fn has_extra_fields(&self) -> bool { Self::FIELD_COUNT != self.field_count() } - pub fn nft_id(&self) -> Byte32Reader<'r> { + pub fn spore_id(&self) -> Byte32Reader<'r> { let slice = self.as_slice(); let start = molecule::unpack_number(&slice[4..]) as usize; let end = molecule::unpack_number(&slice[8..]) as usize; @@ -1906,14 +1906,14 @@ impl<'r> molecule::prelude::Reader<'r> for TransferReader<'r> { } #[derive(Clone, Debug, Default)] pub struct TransferBuilder { - pub(crate) nft_id: Byte32, + pub(crate) spore_id: Byte32, pub(crate) from: Address, pub(crate) to: Address, } impl TransferBuilder { pub const FIELD_COUNT: usize = 3; - pub fn nft_id(mut self, v: Byte32) -> Self { - self.nft_id = v; + pub fn spore_id(mut self, v: Byte32) -> Self { + self.spore_id = v; self } pub fn from(mut self, v: Address) -> Self { @@ -1930,7 +1930,7 @@ impl molecule::prelude::Builder for TransferBuilder { const NAME: &'static str = "TransferBuilder"; fn expected_length(&self) -> usize { molecule::NUMBER_SIZE * (Self::FIELD_COUNT + 1) - + self.nft_id.as_slice().len() + + self.spore_id.as_slice().len() + self.from.as_slice().len() + self.to.as_slice().len() } @@ -1938,7 +1938,7 @@ impl molecule::prelude::Builder for TransferBuilder { let mut total_size = molecule::NUMBER_SIZE * (Self::FIELD_COUNT + 1); let mut offsets = Vec::with_capacity(Self::FIELD_COUNT); offsets.push(total_size); - total_size += self.nft_id.as_slice().len(); + total_size += self.spore_id.as_slice().len(); offsets.push(total_size); total_size += self.from.as_slice().len(); offsets.push(total_size); @@ -1947,7 +1947,7 @@ impl molecule::prelude::Builder for TransferBuilder { for offset in offsets.into_iter() { writer.write_all(&molecule::pack_number(offset as molecule::Number))?; } - writer.write_all(self.nft_id.as_slice())?; + writer.write_all(self.spore_id.as_slice())?; writer.write_all(self.from.as_slice())?; writer.write_all(self.to.as_slice())?; Ok(()) @@ -1978,7 +1978,7 @@ impl ::core::fmt::Debug for Burn { impl ::core::fmt::Display for Burn { fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { write!(f, "{} {{ ", Self::NAME)?; - write!(f, "{}: {}", "nft_id", self.nft_id())?; + write!(f, "{}: {}", "spore_id", self.spore_id())?; write!(f, ", {}: {}", "from", self.from())?; let extra_count = self.count_extra_fields(); if extra_count != 0 { @@ -2017,7 +2017,7 @@ impl Burn { pub fn has_extra_fields(&self) -> bool { Self::FIELD_COUNT != self.field_count() } - pub fn nft_id(&self) -> Byte32 { + pub fn spore_id(&self) -> Byte32 { let slice = self.as_slice(); let start = molecule::unpack_number(&slice[4..]) as usize; let end = molecule::unpack_number(&slice[8..]) as usize; @@ -2059,7 +2059,9 @@ impl molecule::prelude::Entity for Burn { ::core::default::Default::default() } fn as_builder(self) -> Self::Builder { - Self::new_builder().nft_id(self.nft_id()).from(self.from()) + Self::new_builder() + .spore_id(self.spore_id()) + .from(self.from()) } } #[derive(Clone, Copy)] @@ -2081,7 +2083,7 @@ impl<'r> ::core::fmt::Debug for BurnReader<'r> { impl<'r> ::core::fmt::Display for BurnReader<'r> { fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { write!(f, "{} {{ ", Self::NAME)?; - write!(f, "{}: {}", "nft_id", self.nft_id())?; + write!(f, "{}: {}", "spore_id", self.spore_id())?; write!(f, ", {}: {}", "from", self.from())?; let extra_count = self.count_extra_fields(); if extra_count != 0 { @@ -2108,7 +2110,7 @@ impl<'r> BurnReader<'r> { pub fn has_extra_fields(&self) -> bool { Self::FIELD_COUNT != self.field_count() } - pub fn nft_id(&self) -> Byte32Reader<'r> { + pub fn spore_id(&self) -> Byte32Reader<'r> { let slice = self.as_slice(); let start = molecule::unpack_number(&slice[4..]) as usize; let end = molecule::unpack_number(&slice[8..]) as usize; @@ -2178,13 +2180,13 @@ impl<'r> molecule::prelude::Reader<'r> for BurnReader<'r> { } #[derive(Clone, Debug, Default)] pub struct BurnBuilder { - pub(crate) nft_id: Byte32, + pub(crate) spore_id: Byte32, pub(crate) from: Address, } impl BurnBuilder { pub const FIELD_COUNT: usize = 2; - pub fn nft_id(mut self, v: Byte32) -> Self { - self.nft_id = v; + pub fn spore_id(mut self, v: Byte32) -> Self { + self.spore_id = v; self } pub fn from(mut self, v: Address) -> Self { @@ -2197,21 +2199,21 @@ impl molecule::prelude::Builder for BurnBuilder { const NAME: &'static str = "BurnBuilder"; fn expected_length(&self) -> usize { molecule::NUMBER_SIZE * (Self::FIELD_COUNT + 1) - + self.nft_id.as_slice().len() + + self.spore_id.as_slice().len() + self.from.as_slice().len() } fn write(&self, writer: &mut W) -> molecule::io::Result<()> { let mut total_size = molecule::NUMBER_SIZE * (Self::FIELD_COUNT + 1); let mut offsets = Vec::with_capacity(Self::FIELD_COUNT); offsets.push(total_size); - total_size += self.nft_id.as_slice().len(); + total_size += self.spore_id.as_slice().len(); offsets.push(total_size); total_size += self.from.as_slice().len(); writer.write_all(&molecule::pack_number(total_size as molecule::Number))?; for offset in offsets.into_iter() { writer.write_all(&molecule::pack_number(offset as molecule::Number))?; } - writer.write_all(self.nft_id.as_slice())?; + writer.write_all(self.spore_id.as_slice())?; writer.write_all(self.from.as_slice())?; Ok(()) } diff --git a/lib/utils/src/lib.rs b/lib/utils/src/lib.rs index e8cfae8..3e788dc 100644 --- a/lib/utils/src/lib.rs +++ b/lib/utils/src/lib.rs @@ -172,6 +172,6 @@ pub fn extract_spore_action() -> Result { match (iter.next(), iter.next()) { (Some(action), None) => action::SporeAction::from_slice(&action.data().raw_data()) .map_err(|_| Error::InvliadCoBuildMessage), - _ => Err(Error::InvliadCoBuildMessage), + _ => Err(Error::SporeActionDuplicated), } } diff --git a/tests/src/utils/co_build.rs b/tests/src/utils/co_build.rs index 32b5c4c..3480258 100644 --- a/tests/src/utils/co_build.rs +++ b/tests/src/utils/co_build.rs @@ -85,7 +85,7 @@ pub fn build_mint_action( ) -> SporeActionUnion { let to = internal::build_always_success_script(context); let mint = Mint::new_builder() - .nft_id(h256_to_byte32(nft_id)) + .spore_id(h256_to_byte32(nft_id)) .data_hash(h256_to_byte32(blake2b_256(content))) .to(script_to_address(to)) .build(); @@ -96,7 +96,7 @@ pub fn build_transfer_action(context: &mut Context, nft_id: [u8; 32]) -> SporeAc let script = internal::build_always_success_script(context); let address = script_to_address(script); let transfer = Transfer::new_builder() - .nft_id(h256_to_byte32(nft_id)) + .spore_id(h256_to_byte32(nft_id)) .from(address.clone()) .to(address) .build(); @@ -106,7 +106,7 @@ pub fn build_transfer_action(context: &mut Context, nft_id: [u8; 32]) -> SporeAc pub fn build_burn_action(context: &mut Context, nft_id: [u8; 32]) -> SporeActionUnion { let from = internal::build_always_success_script(context); let burn = Burn::new_builder() - .nft_id(h256_to_byte32(nft_id)) + .spore_id(h256_to_byte32(nft_id)) .from(script_to_address(from)) .build(); SporeActionUnion::Burn(burn)