From 2223c4881b5ee213c19f805067eb27fa164f8d2d Mon Sep 17 00:00:00 2001 From: jakehemmerle Date: Sat, 10 Feb 2024 17:18:48 -0700 Subject: [PATCH 1/7] renameProgramInfo.config_interface to interface_description --- crates/test-cli/src/main.rs | 16 +++++------ crates/testing-utils/src/test_client/mod.rs | 4 +-- .../entropy_metadata.scale | Bin 193497 -> 193654 bytes pallets/programs/src/benchmarking.rs | 14 +++++----- pallets/programs/src/lib.rs | 22 +++++++-------- pallets/programs/src/tests.rs | 26 +++++++++--------- pallets/propagation/src/tests.rs | 2 +- pallets/relayer/src/benchmarking.rs | 20 +++++++------- pallets/relayer/src/tests.rs | 22 +++++++-------- pallets/transaction-pause/src/tests.rs | 2 +- 10 files changed, 64 insertions(+), 64 deletions(-) diff --git a/crates/test-cli/src/main.rs b/crates/test-cli/src/main.rs index 04e394c42..15afd3af5 100644 --- a/crates/test-cli/src/main.rs +++ b/crates/test-cli/src/main.rs @@ -388,7 +388,7 @@ async fn run_command() -> anyhow::Result { program_info.deployer, program_info.ref_counter, program_info.bytecode.len(), - !program_info.configuration_interface.is_empty(), + !program_info.interface_description.is_empty(), ); } } @@ -481,10 +481,10 @@ impl Program { let program_bytecode = fs::read(&filename)?; // If there is a file with the same name with the '.config-interface' extension, read it - let configuration_interface = { - let mut configuration_interface_file = PathBuf::from(&filename); - configuration_interface_file.set_extension("config-interface"); - fs::read(&configuration_interface_file).unwrap_or_default() + let interface_description = { + let mut interface_description_file = PathBuf::from(&filename); + interface_description_file.set_extension("config-interface"); + fs::read(&interface_description_file).unwrap_or_default() }; // If there is a file with the same name with the '.json' extension, read it @@ -495,12 +495,12 @@ impl Program { }; ensure!( - (configuration_interface.is_empty() && configuration.is_empty()) - || (!configuration_interface.is_empty() && !configuration.is_empty()), + (interface_description.is_empty() && configuration.is_empty()) + || (!interface_description.is_empty() && !configuration.is_empty()), "If giving a configuration interface you must also give a configuration" ); - match store_program(api, keypair, program_bytecode.clone(), configuration_interface).await { + match store_program(api, keypair, program_bytecode.clone(), interface_description).await { Ok(hash) => Ok(Self::new(hash, configuration)), Err(error) => { if error.to_string().ends_with("ProgramAlreadySet") { diff --git a/crates/testing-utils/src/test_client/mod.rs b/crates/testing-utils/src/test_client/mod.rs index 012aed3ac..aafb2687a 100644 --- a/crates/testing-utils/src/test_client/mod.rs +++ b/crates/testing-utils/src/test_client/mod.rs @@ -260,9 +260,9 @@ pub async fn store_program( api: &OnlineClient, deployerpair: &sr25519::Pair, program: Vec, - configuration_interface: Vec, + interface_description: Vec, ) -> anyhow::Result<::Hash> { - let update_program_tx = entropy::tx().programs().set_program(program, configuration_interface); + let update_program_tx = entropy::tx().programs().set_program(program, interface_description); let deployer = PairSigner::::new(deployerpair.clone()); let in_block = api diff --git a/crates/threshold-signature-server/entropy_metadata.scale b/crates/threshold-signature-server/entropy_metadata.scale index 273ba958dc736cd1c886431211de5c296377a88c..620df74aecdbd36a1e0f4dec08a0174ec89bf49c 100644 GIT binary patch delta 16229 zcmbVze_T{m`u}~-+?l!jQc%zVK?Vf`1qB2Jg%TBw6crU)Eu;|!oCJoSD%+Cs-Keav z@GhRHu&Au8r6SVFO3U4~vQne8a?_OkNQr4lrRkRWd7pa+!QB1h^L@SU+&Ry=&wb8w zp7WgNJkN8^J@Sp$g;QRp5_^?xu&v$nwSl_SvxX4r?(mY&5q+WlYK)|#>S)sh!#Vm@ z?KBNlSDI!Te!5y7tDZ6W(M9z)(@bV0b%uE!d8nJrkrbltG{;bw`Zewm>QE(~GSv)a z3}ve&N*v{=Ta*d3R6T%lu6hMe9csKsES0EvxYwu+9&uEs?)HeGdi7h6N%97w=XvkV zG?c$>C9`^?=SXT$mwV>OjYN<0_SrOCJ>VHaTh%k36KJOz>=j45)GV)Lwuksb7r@Lj zUV*e%-R+e?`#O5P+9Jr(@kIP8Hl|>St=Lgut8!K>s$Nl4;jAvJT0|nM zi9J76{L~i{#ty#W2I=>8v8Xf3k6$HHX|3!dW3ABXSZ{R}7sOag?Q3$??D=8pxWq@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<(hKR|IEP>!kS5>8kKsn z?J@QS^x?+GS*rYC#Nqzi;mq2K?32Aq;c2~etY=^seAFCo0zEW9-Sm5R7*mm*w^DvM3qNaiU0>ax~z$ZVQ zUhbwBAO;jf;sKUoKB-cL9DlLy0Hoq8{(b<%<0l+$wlbhurH!P<<6F{&T}j=N0Qc8! z=Ijg8Gy6?;+=#&+_%3?_=KGa*VQbUf6C2rJ7(KD*J-plDo_&H{l)XxAVl%DyNM;k6 zyC(^`A8BG=G7RXNk67gNA~Qz7XU3`(kTJ71VlFEq^&^Auv+yyC%9L`6LY*q@1k3Bp zRI&xMmD0Jj3!Y%?**>z@XqE@$Xji;vG zY>m}wW;zNSCC-xl=2#sg16fkLTsse$V@GNjT8v;lYTgj7f%-yxOxQoc7#tVtK7pBO z6gxg)!2_Gj8%~;|t<$j+>=S&4{%R#eG=9R8VTt;jV&k!@rk=tKJuOb0f=O)^{-3h1 zVP}8-l)YnUHn)j4K4Tn6H+{|~89L1^;^EKP?R`#}tuhSkH2aD^&8*Ge&tfiJ(`+7j zn{*78uEgNP2DrVyU{e{I&i)FkkkNhQD>w)NM-9oV9OX;#VXUKgX`$Sn4Y7o|r=DYj znb`FW8)xuEM#A@dcD;M>X@;+Xqr^+Cm^qo^=T{GU;)Ps;BmjA?VhpIRI#6qR2|8#-fjbrKa7F(461s`W-CIA2c diff --git a/pallets/programs/src/benchmarking.rs b/pallets/programs/src/benchmarking.rs index 89bee7e99..26a619996 100644 --- a/pallets/programs/src/benchmarking.rs +++ b/pallets/programs/src/benchmarking.rs @@ -42,10 +42,10 @@ benchmarks! { set_program { let program = vec![10]; - let configuration_interface = vec![11]; + let interface_description = vec![11]; let mut hash_input: Vec = vec![]; hash_input.extend(&program); - hash_input.extend(&configuration_interface); + hash_input.extend(&interface_description); let program_hash = T::Hashing::hash(&hash_input); let deployer: T::AccountId = whitelisted_caller(); @@ -54,13 +54,13 @@ benchmarks! { let value = CurrencyOf::::minimum_balance().saturating_mul(1_000_000_000u32.into()); let _ = CurrencyOf::::make_free_balance_be(&deployer, value); - }: _(RawOrigin::Signed(deployer.clone()), program.clone(), configuration_interface.clone()) + }: _(RawOrigin::Signed(deployer.clone()), program.clone(), interface_description.clone()) verify { assert_last_event::( Event::::ProgramCreated { deployer, program_hash, - configuration_interface + interface_description }.into() ); } @@ -68,10 +68,10 @@ benchmarks! { remove_program { let p in 0..T::MaxOwnedPrograms::get(); let program = vec![10]; - let configuration_interface = vec![11]; + let interface_description = vec![11]; let mut hash_input: Vec = vec![]; hash_input.extend(&program); - hash_input.extend(&configuration_interface); + hash_input.extend(&interface_description); let program_hash = T::Hashing::hash(&hash_input); let random_program = vec![11]; @@ -80,7 +80,7 @@ benchmarks! { let value = CurrencyOf::::minimum_balance().saturating_mul(1_000_000_000u32.into()); let _ = CurrencyOf::::make_free_balance_be(&deployer, value); - >::insert(program_hash.clone(), ProgramInfo {bytecode: program, configuration_interface, deployer: deployer.clone(), ref_counter: 0u128}); + >::insert(program_hash.clone(), ProgramInfo {bytecode: program, interface_description, deployer: deployer.clone(), ref_counter: 0u128}); let mut program_hashes = vec![random_hash.clone(); p as usize]; // remove one to make room for the targetted removal program hash program_hashes.pop(); diff --git a/pallets/programs/src/lib.rs b/pallets/programs/src/lib.rs index 4ff648dae..d769e425c 100644 --- a/pallets/programs/src/lib.rs +++ b/pallets/programs/src/lib.rs @@ -94,8 +94,8 @@ pub mod pallet { pub struct ProgramInfo { /// The bytecode of the program. pub bytecode: Vec, - /// The type definition of the program - pub configuration_interface: Vec, + /// An interface description for the program (config, auxilary data, etc) + pub interface_description: Vec, /// Deployer of the program pub deployer: AccountId, /// Accounts that use this program @@ -103,7 +103,7 @@ pub mod pallet { } /// Stores the program info for a given program hash. - /// A program hash is a combination of the bytecode and configuration_interface + /// A program hash is a combination of the bytecode and interface_description #[pallet::storage] #[pallet::getter(fn programs)] pub type Programs = @@ -132,7 +132,7 @@ pub mod pallet { program_hash: T::Hash, /// The new program type definition - configuration_interface: Vec, + interface_description: Vec, }, /// The bytecode of a program was removed. ProgramRemoved { @@ -162,7 +162,7 @@ pub mod pallet { #[pallet::call] impl Pallet { - /// Sets the program and uses hash of program and configuration_interface as key. + /// Sets the program and uses hash of program and interface_description as key. /// /// Note that the caller becomes the deployer account. #[pallet::call_index(0)] @@ -170,14 +170,14 @@ pub mod pallet { pub fn set_program( origin: OriginFor, new_program: Vec, - configuration_interface: Vec, + interface_description: Vec, ) -> DispatchResult { let deployer = ensure_signed(origin)?; let mut hash_input = vec![]; hash_input.extend(&new_program); - hash_input.extend(&configuration_interface); + hash_input.extend(&interface_description); let program_hash = T::Hashing::hash(&hash_input); - let new_program_length = new_program.len() + configuration_interface.len(); + let new_program_length = new_program.len() + interface_description.len(); ensure!( new_program_length as u32 <= T::MaxBytecodeLength::get(), Error::::ProgramLengthExceeded @@ -190,7 +190,7 @@ pub mod pallet { program_hash, &ProgramInfo { bytecode: new_program.clone(), - configuration_interface: configuration_interface.clone(), + interface_description: interface_description.clone(), deployer: deployer.clone(), ref_counter: 0u128, }, @@ -207,7 +207,7 @@ pub mod pallet { Self::deposit_event(Event::ProgramCreated { deployer, program_hash, - configuration_interface, + interface_description, }); Ok(()) } @@ -228,7 +228,7 @@ pub mod pallet { ensure!(old_program_info.ref_counter == 0, Error::::ProgramInUse); Self::unreserve_program_deposit( &old_program_info.deployer, - old_program_info.bytecode.len() + old_program_info.configuration_interface.len(), + old_program_info.bytecode.len() + old_program_info.interface_description.len(), ); let mut owned_programs_length = 0; OwnedPrograms::::try_mutate( diff --git a/pallets/programs/src/tests.rs b/pallets/programs/src/tests.rs index 1bd959a54..994451c3f 100644 --- a/pallets/programs/src/tests.rs +++ b/pallets/programs/src/tests.rs @@ -27,11 +27,11 @@ fn set_program() { new_test_ext().execute_with(|| { let program = vec![10u8, 11u8]; let program_2 = vec![12u8, 13u8]; - let configuration_interface = vec![14u8]; + let interface_description = vec![14u8]; let too_long = vec![1u8, 2u8, 3u8, 4u8, 5u8]; let mut hash_input: Vec = vec![]; hash_input.extend(&program); - hash_input.extend(&configuration_interface); + hash_input.extend(&interface_description); let program_hash = ::Hashing::hash(&hash_input); // can't pay deposit @@ -39,7 +39,7 @@ fn set_program() { ProgramsPallet::set_program( RuntimeOrigin::signed(PROGRAM_MODIFICATION_ACCOUNT), program.clone(), - configuration_interface.clone() + interface_description.clone() ), BalancesError::::InsufficientBalance ); @@ -49,11 +49,11 @@ fn set_program() { assert_ok!(ProgramsPallet::set_program( RuntimeOrigin::signed(PROGRAM_MODIFICATION_ACCOUNT), program.clone(), - configuration_interface.clone() + interface_description.clone() )); let program_result = ProgramInfo { bytecode: program.clone(), - configuration_interface: configuration_interface.clone(), + interface_description: interface_description.clone(), deployer: PROGRAM_MODIFICATION_ACCOUNT, ref_counter: 0u128, }; @@ -75,7 +75,7 @@ fn set_program() { ProgramsPallet::set_program( RuntimeOrigin::signed(PROGRAM_MODIFICATION_ACCOUNT), program.clone(), - configuration_interface.clone() + interface_description.clone() ), Error::::ProgramAlreadySet ); @@ -85,7 +85,7 @@ fn set_program() { ProgramsPallet::set_program( RuntimeOrigin::signed(PROGRAM_MODIFICATION_ACCOUNT), program_2.clone(), - configuration_interface.clone() + interface_description.clone() ), Error::::TooManyProgramsOwned ); @@ -94,7 +94,7 @@ fn set_program() { ProgramsPallet::set_program( RuntimeOrigin::signed(PROGRAM_MODIFICATION_ACCOUNT), too_long, - configuration_interface + interface_description ), Error::::ProgramLengthExceeded ); @@ -105,10 +105,10 @@ fn set_program() { fn remove_program() { new_test_ext().execute_with(|| { let program = vec![10u8, 11u8]; - let configuration_interface = vec![14u8]; + let interface_description = vec![14u8]; let mut hash_input: Vec = vec![]; hash_input.extend(&program); - hash_input.extend(&configuration_interface); + hash_input.extend(&interface_description); let program_hash = ::Hashing::hash(&hash_input); // no program @@ -125,7 +125,7 @@ fn remove_program() { assert_ok!(ProgramsPallet::set_program( RuntimeOrigin::signed(PROGRAM_MODIFICATION_ACCOUNT), program.clone(), - configuration_interface.clone() + interface_description.clone() )); assert_eq!( ProgramsPallet::owned_programs(PROGRAM_MODIFICATION_ACCOUNT), @@ -171,13 +171,13 @@ fn remove_program_fails_ref_count() { new_test_ext().execute_with(|| { let program = vec![10u8, 11u8]; let program_hash = ::Hashing::hash(&program); - let configuration_interface = vec![14u8]; + let interface_description = vec![14u8]; Programs::::insert( program_hash, ProgramInfo { bytecode: program, - configuration_interface, + interface_description, deployer: PROGRAM_MODIFICATION_ACCOUNT, ref_counter: 1u128, }, diff --git a/pallets/propagation/src/tests.rs b/pallets/propagation/src/tests.rs index 27dc03781..982cd475c 100644 --- a/pallets/propagation/src/tests.rs +++ b/pallets/propagation/src/tests.rs @@ -81,7 +81,7 @@ fn knows_how_to_mock_several_http_calls() { ::Hash::default(), ProgramInfo { bytecode: vec![], - configuration_interface: vec![], + interface_description: vec![], deployer: 1, ref_counter: 0, }, diff --git a/pallets/relayer/src/benchmarking.rs b/pallets/relayer/src/benchmarking.rs index bdbb9c8b1..90b0548c6 100644 --- a/pallets/relayer/src/benchmarking.rs +++ b/pallets/relayer/src/benchmarking.rs @@ -72,7 +72,7 @@ benchmarks! { register { let p in 1 .. T::MaxProgramHashes::get(); let program = vec![0u8]; - let configuration_interface = vec![1u8]; + let interface_description = vec![1u8]; let program_hash = T::Hashing::hash(&program); let programs_info = BoundedVec::try_from(vec![ProgramInstance { program_pointer: program_hash, @@ -81,7 +81,7 @@ benchmarks! { .unwrap(); let program_modification_account: T::AccountId = whitelisted_caller(); - Programs::::insert(program_hash, ProgramInfo {bytecode: program, configuration_interface, deployer: program_modification_account.clone(), ref_counter: 0}); + Programs::::insert(program_hash, ProgramInfo {bytecode: program, interface_description, deployer: program_modification_account.clone(), ref_counter: 0}); let sig_req_account: T::AccountId = whitelisted_caller(); let balance = ::Currency::minimum_balance() * 100u32.into(); let _ = ::Currency::make_free_balance_be(&sig_req_account, balance); @@ -95,13 +95,13 @@ benchmarks! { let p in 1 .. T::MaxProgramHashes::get(); let program_modification_account: T::AccountId = whitelisted_caller(); let program = vec![0u8]; - let configuration_interface = vec![1u8]; + let interface_description = vec![1u8]; let program_hash = T::Hashing::hash(&program); let programs_info = BoundedVec::try_from(vec![ProgramInstance { program_pointer: program_hash, program_config: vec![], }]).unwrap(); - Programs::::insert(program_hash, ProgramInfo {bytecode: program, configuration_interface, deployer: program_modification_account.clone(), ref_counter: 1}); + Programs::::insert(program_hash, ProgramInfo {bytecode: program, interface_description, deployer: program_modification_account.clone(), ref_counter: 1}); let sig_req_account: T::AccountId = whitelisted_caller(); let balance = ::Currency::minimum_balance() * 100u32.into(); let _ = ::Currency::make_free_balance_be(&sig_req_account, balance); @@ -123,7 +123,7 @@ benchmarks! { let program_modification_account: T::AccountId = whitelisted_caller(); let program = vec![0u8]; - let configuration_interface = vec![1u8]; + let interface_description = vec![1u8]; let program_hash = T::Hashing::hash(&program); let programs_info = BoundedVec::try_from(vec![ProgramInstance { program_pointer: program_hash, @@ -138,8 +138,8 @@ benchmarks! { }; n as usize]) .unwrap(); let sig_req_account: T::AccountId = whitelisted_caller(); - Programs::::insert(program_hash, ProgramInfo {bytecode: program, configuration_interface: configuration_interface.clone(), deployer: program_modification_account.clone(), ref_counter: 0}); - Programs::::insert(new_program_hash, ProgramInfo {bytecode: new_program, configuration_interface, deployer: program_modification_account.clone(), ref_counter: o as u128}); + Programs::::insert(program_hash, ProgramInfo {bytecode: program, interface_description: interface_description.clone(), deployer: program_modification_account.clone(), ref_counter: 0}); + Programs::::insert(new_program_hash, ProgramInfo {bytecode: new_program, interface_description, deployer: program_modification_account.clone(), ref_counter: o as u128}); let balance = ::Currency::minimum_balance() * 100u32.into(); let _ = ::Currency::make_free_balance_be(&sig_req_account, balance); >::insert( @@ -159,7 +159,7 @@ benchmarks! { confirm_register_registering { let c in 0 .. SIG_PARTIES as u32; let program = vec![0u8]; - let configuration_interface = vec![1u8]; + let interface_description = vec![1u8]; let program_hash = T::Hashing::hash(&program); let programs_info = BoundedVec::try_from(vec![ProgramInstance { @@ -193,7 +193,7 @@ benchmarks! { confirm_register_failed_registering { let c in 0 .. SIG_PARTIES as u32; let program = vec![0u8]; - let configuration_interface = vec![1u8]; + let interface_description = vec![1u8]; let program_hash = T::Hashing::hash(&program); let programs_info = BoundedVec::try_from(vec![ProgramInstance { @@ -230,7 +230,7 @@ benchmarks! { confirm_register_registered { let c in 0 .. SIG_PARTIES as u32; let program = vec![0u8]; - let configuration_interface = vec![1u8]; + let interface_description = vec![1u8]; let program_hash = T::Hashing::hash(&program); let programs_info = BoundedVec::try_from(vec![ProgramInstance { program_pointer: program_hash, diff --git a/pallets/relayer/src/tests.rs b/pallets/relayer/src/tests.rs index 6e9906d2a..2958ba0ae 100644 --- a/pallets/relayer/src/tests.rs +++ b/pallets/relayer/src/tests.rs @@ -82,7 +82,7 @@ fn it_registers_a_user() { program_hash, ProgramInfo { bytecode: empty_program.clone(), - configuration_interface: empty_program.clone(), + interface_description: empty_program.clone(), deployer: 1, ref_counter: 0, }, @@ -130,7 +130,7 @@ fn it_confirms_registers_a_user() { program_hash, ProgramInfo { bytecode: empty_program.clone(), - configuration_interface: empty_program.clone(), + interface_description: empty_program.clone(), deployer: 1, ref_counter: 0, }, @@ -219,7 +219,7 @@ fn it_changes_a_program_pointer() { program_hash, ProgramInfo { bytecode: empty_program.clone(), - configuration_interface: empty_program.clone(), + interface_description: empty_program.clone(), deployer: 1, ref_counter: 1, }, @@ -237,7 +237,7 @@ fn it_changes_a_program_pointer() { new_program_hash, ProgramInfo { bytecode: new_program, - configuration_interface: empty_program.clone(), + interface_description: empty_program.clone(), deployer: 1, ref_counter: 1, }, @@ -316,7 +316,7 @@ fn it_fails_on_non_matching_verifying_keys() { program_hash, ProgramInfo { bytecode: empty_program.clone(), - configuration_interface: empty_program.clone(), + interface_description: empty_program.clone(), deployer: 1, ref_counter: 0, }, @@ -369,7 +369,7 @@ fn it_doesnt_allow_double_registering() { program_hash, ProgramInfo { bytecode: empty_program.clone(), - configuration_interface: empty_program.clone(), + interface_description: empty_program.clone(), deployer: 1, ref_counter: 0, }, @@ -449,7 +449,7 @@ fn it_tests_prune_registration() { program_hash, ProgramInfo { bytecode: inital_program.clone(), - configuration_interface: inital_program.clone(), + interface_description: inital_program.clone(), deployer: 1, ref_counter: 1, }, @@ -493,7 +493,7 @@ fn it_provides_free_txs_confirm_done() { program_hash, ProgramInfo { bytecode: empty_program.clone(), - configuration_interface: empty_program.clone(), + interface_description: empty_program.clone(), deployer: 1, ref_counter: 0, }, @@ -572,7 +572,7 @@ fn it_provides_free_txs_confirm_done_fails_3() { program_hash, ProgramInfo { bytecode: empty_program.clone(), - configuration_interface: empty_program.clone(), + interface_description: empty_program.clone(), deployer: 1, ref_counter: 0, }, @@ -621,7 +621,7 @@ fn it_provides_free_txs_confirm_done_fails_4() { program_hash, ProgramInfo { bytecode: empty_program.clone(), - configuration_interface: empty_program.clone(), + interface_description: empty_program.clone(), deployer: 1, ref_counter: 0, }, @@ -663,7 +663,7 @@ fn it_provides_free_txs_confirm_done_fails_5() { program_hash, ProgramInfo { bytecode: empty_program.clone(), - configuration_interface: empty_program.clone(), + interface_description: empty_program.clone(), deployer: 1, ref_counter: 0, }, diff --git a/pallets/transaction-pause/src/tests.rs b/pallets/transaction-pause/src/tests.rs index fe8f23894..6b7104a8b 100644 --- a/pallets/transaction-pause/src/tests.rs +++ b/pallets/transaction-pause/src/tests.rs @@ -150,7 +150,7 @@ fn paused_transaction_filter_work() { let whitelist_address_call = &mock::RuntimeCall::ProgramsPallet(pallet_programs::Call::set_program { new_program: vec![], - configuration_interface: vec![], + interface_description: vec![], }); assert!(!PausedTransactionFilter::::contains(BALANCE_TRANSFER)); assert!(!PausedTransactionFilter::::contains(whitelist_address_call)); From 610ef581740006916a1692cedbe5c5aade2cc67f Mon Sep 17 00:00:00 2001 From: jake hemmerle Date: Mon, 12 Feb 2024 09:16:08 -0800 Subject: [PATCH 2/7] Update crates/test-cli/src/main.rs Co-authored-by: peg --- crates/test-cli/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/test-cli/src/main.rs b/crates/test-cli/src/main.rs index 15afd3af5..0eac68079 100644 --- a/crates/test-cli/src/main.rs +++ b/crates/test-cli/src/main.rs @@ -480,7 +480,7 @@ impl Program { ) -> anyhow::Result { let program_bytecode = fs::read(&filename)?; - // If there is a file with the same name with the '.config-interface' extension, read it + // If there is a file with the same name with the '.interface-description' extension, read it let interface_description = { let mut interface_description_file = PathBuf::from(&filename); interface_description_file.set_extension("config-interface"); From 196bcd06826e23417525cae7b165a744d7a6a918 Mon Sep 17 00:00:00 2001 From: jake hemmerle Date: Mon, 12 Feb 2024 09:16:13 -0800 Subject: [PATCH 3/7] Update crates/test-cli/src/main.rs Co-authored-by: peg --- crates/test-cli/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/test-cli/src/main.rs b/crates/test-cli/src/main.rs index 0eac68079..3bcf3f430 100644 --- a/crates/test-cli/src/main.rs +++ b/crates/test-cli/src/main.rs @@ -497,7 +497,7 @@ impl Program { ensure!( (interface_description.is_empty() && configuration.is_empty()) || (!interface_description.is_empty() && !configuration.is_empty()), - "If giving a configuration interface you must also give a configuration" + "If giving an interface description you must also give a configuration" ); match store_program(api, keypair, program_bytecode.clone(), interface_description).await { From 8db172f4229fa7491cca4ffa0b3ba30882432bff Mon Sep 17 00:00:00 2001 From: jake hemmerle Date: Mon, 12 Feb 2024 09:16:20 -0800 Subject: [PATCH 4/7] Update crates/test-cli/src/main.rs Co-authored-by: peg --- crates/test-cli/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/test-cli/src/main.rs b/crates/test-cli/src/main.rs index 3bcf3f430..33f467c81 100644 --- a/crates/test-cli/src/main.rs +++ b/crates/test-cli/src/main.rs @@ -483,7 +483,7 @@ impl Program { // If there is a file with the same name with the '.interface-description' extension, read it let interface_description = { let mut interface_description_file = PathBuf::from(&filename); - interface_description_file.set_extension("config-interface"); + interface_description_file.set_extension("interface-description"); fs::read(&interface_description_file).unwrap_or_default() }; From 9f877720c03b38f5e9ff5b006c09cecffab0dc78 Mon Sep 17 00:00:00 2001 From: jakehemmerle Date: Mon, 12 Feb 2024 09:23:28 -0800 Subject: [PATCH 5/7] extra name changes --- crates/test-cli/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/test-cli/src/main.rs b/crates/test-cli/src/main.rs index 33f467c81..8232313b5 100644 --- a/crates/test-cli/src/main.rs +++ b/crates/test-cli/src/main.rs @@ -87,7 +87,7 @@ enum CliCommand { /// a '.json' extension, it will be read and used as the configuration for that program. /// /// If the path to a wasm file is given, and there is a file with the same name with a - /// '.config-interface' extension, it will be stored as that program's configuration + /// '.interface-description' extension, it will be stored as that program's configuration /// interface. If no such file exists, it is assumed the program has no configuration /// interface. programs: Vec, @@ -128,7 +128,7 @@ enum CliCommand { /// a '.json' extension, it will be read and used as the configuration for that program. /// /// If the path to a wasm file is given, and there is a file with the same name with a - /// '.config-interface' extension, it will be stored as that program's configuration + /// '.interface-description' extension, it will be stored as that program's configuration /// interface. If no such file exists, it is assumed the program has no configuration /// interface. programs: Vec, From 68174473f3f9a7f687830e6bcbc1ae19edc97757 Mon Sep 17 00:00:00 2001 From: jakehemmerle Date: Wed, 14 Feb 2024 13:49:14 -0800 Subject: [PATCH 6/7] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee334f5c3..576b9a0d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ At the moment this project **does not** adhere to `StakingExtensionConfig::proactive_refresh_validators` field used by the chain spec is now `StakingExtensionConfigproactive_refresh_data` and takes a tuple of `Vec`. Both should be empty at genesis for production. +- In [#631](https://github.com/entropyxyz/entropy-core/pull/631), the `ProgramInfo.config_interface` field was renamed to `interface_description` to be more semantically accurate. This field will now be used to describe the interface for both the auxilary and configuration data of the program. ### Added - Add ValidatorSubgroupRotated event ([#618](https://github.com/entropyxyz/entropy-core/pull/618)) From 9b3a747bc397d2f909dbcb768530d28c28f02b3f Mon Sep 17 00:00:00 2001 From: jakehemmerle Date: Wed, 14 Feb 2024 15:04:51 -0800 Subject: [PATCH 7/7] updated metadata --- .../entropy_metadata.scale | Bin 193654 -> 193687 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/crates/threshold-signature-server/entropy_metadata.scale b/crates/threshold-signature-server/entropy_metadata.scale index 620df74aecdbd36a1e0f4dec08a0174ec89bf49c..2bebe8e367a3ea3ccfbd230e65552d931bda4082 100644 GIT binary patch delta 108 zcmezNf_wT)?hO@F)FTRt@)MIwGRsoqi&E2yQj0U