From 503f9f3d50dcde7dca4e1ae572ac7b0d31e0581a Mon Sep 17 00:00:00 2001 From: Austin Abell Date: Tue, 3 Aug 2021 11:23:52 -0400 Subject: [PATCH] refactor(env)!: remove public key generics from promise API (#495) * refactor(env)!: remove public key generics from promise API * update changelog * update wasm blobs --- CHANGELOG.md | 1 + .../res/cross_contract_high_level.wasm | Bin 266537 -> 266537 bytes .../res/cross_contract_low_level.wasm | Bin 289956 -> 289956 bytes examples/fungible-token/res/defi.wasm | Bin 120433 -> 120433 bytes .../fungible-token/res/fungible_token.wasm | Bin 204285 -> 204285 bytes .../res/lockable_fungible_token.wasm | Bin 154774 -> 154774 bytes .../mission-control/res/mission_control.wasm | Bin 151218 -> 151218 bytes .../res/approval_receiver.wasm | Bin 117856 -> 117856 bytes .../res/non_fungible_token.wasm | Bin 297058 -> 297058 bytes .../res/token_receiver.wasm | Bin 117101 -> 117101 bytes .../res/status_message_collections.wasm | Bin 100207 -> 100207 bytes .../status-message/res/status_message.wasm | Bin 135791 -> 135791 bytes examples/test-contract/res/test_contract.wasm | Bin 31158 -> 31158 bytes near-sdk/src/environment/env.rs | 22 ++++++------------ 14 files changed, 8 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf7d549d8..c72d8684b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## [unreleased] +- Removes `PublicKey` generic on `env` promise batch calls. Functions now just take a reference to the `PublicKey`. ## `4.0.0-pre.1` [07-23-2021] * Implements new `LazyOption` type under `unstable` feature. Similar to `Lazy` but is optional to set a value. [PR 444](https://github.com/near/near-sdk-rs/pull/444). diff --git a/examples/cross-contract-high-level/res/cross_contract_high_level.wasm b/examples/cross-contract-high-level/res/cross_contract_high_level.wasm index 98d52eda17723ac3ca7221fb259328fc1c09657d..9b200987b472e5d092aa180d6e74ab534f0c1846 100755 GIT binary patch delta 306 zcmZ3vNMPk6frc%N%l0tZPG7!<(U{S({q`Ql?YH+Z&A0>+(w;uQpP7Tvar=sX=3rLF zy6JzWFq<1rWME*B0pcy(0t~7^T8xQ-fe(o+(w;uQpP7TvbNh;Z=3rLF z`sshBFq<1rVqjp90pcy(0t~7^T8@cIov_90;on7h&yD2!20UY_|4O` zm|4sNn}Nb%NXk0Vl)Iov_95~xNNh&yD2!20UZ_$|}5 zm|4sNTY$o0NXojz`%*5UK_}lN8%ryzKNN|-tZt$SO`fN=4zNRFjvF) Ls@s)VSeh~bv+pt{ diff --git a/examples/fungible-token/res/defi.wasm b/examples/fungible-token/res/defi.wasm index f965df02242b5ab192747f81d6f3cfba8e516e40..8c1364ac7b4a7be8e9a77ada0675bea66634121a 100755 GIT binary patch delta 190 zcmeykhW+Cj_J%Et-?|xXr+@EeG-h<%uHC~J%*|Lay?#2Qd3`4X1A{CO3-Adrr~>JU zKrDmAS7&5kkVE2Y0{MJsd|fm?ClX%^s9qk4FUEwTf4b@nMnOSYpr9#|BIE7hGZ>}p E0HjG5DF6Tf delta 180 zcmeykhW+Cj_J%Et-?|xHr+@EeG-mYNuHC~J%*|Liy?#2Qd1@B}1A{CO3-Adrr~>Ip zKrDmA*I;B|kVE2Y0r`Ard|fm?ClX&9s9t`$_6$a8MKvZ=t*Su2DUwp_?cp;RrR)Iv C)E5*0 diff --git a/examples/fungible-token/res/fungible_token.wasm b/examples/fungible-token/res/fungible_token.wasm index 32f7c5b051fcf18d46fc8e7d30c3b772ca78da49..e7f69a75af15a399bb5a1737a7a2de8a6d492a3d 100755 GIT binary patch delta 239 zcmeyno9FLto`x32ElmHmGulr7zn#gL(Q&)+4yN;BtQ8Cl46@VDzhly_pP(ebpbF%6 zf`ot=#-9je%OLU985tPlkocNFJ|7xi7md$}#Mc6p>t#X!`&2 cOwxvGOsM9n0{Ny$`t;G{t+!iWU^?Ur0Nn*ASpWb4 diff --git a/examples/lockable-fungible-token/res/lockable_fungible_token.wasm b/examples/lockable-fungible-token/res/lockable_fungible_token.wasm index 959b5d179581aca4bf3b29e926a99f69a1bdd00f..b663cc333af7109304c1769340e1c0f99fab2dd5 100755 GIT binary patch delta 95 zcmbQXlXKcm&W0AoElkaljJDHTB$BrPZlWSSyL8E^li$TZ6e05Sd(i~s-t delta 95 zcmbQXlXKcm&W0AoElkaljIPsLB$JU zKrDmAS7&5kkVE2Y0{MJsd|fm?ClX%^s9qk4FUEwTUx`5uRe(Vj$TvmOV7$GkpYfdy E0Q5%~=Kufz delta 202 zcmaDbgZ;q__J%Etf14Ryr~hkaG-mYNZq&k<&c#?ceO4c%d3_fH1A{COJMaoHr~>Ip zKrDmA*I;B|kVE2Y0r`Ard|fm?ClX&9s9qk4FUN$UUx`5tRe(Vi$TvmOV7OV diff --git a/examples/non-fungible-token/res/non_fungible_token.wasm b/examples/non-fungible-token/res/non_fungible_token.wasm index 53ad15e9a746cef216a44908d54b1e62abaa408f..387749f19de1cc00e0ed1e54450331c90c1f0332 100755 GIT binary patch delta 278 zcmaDfLFmy0p@tU57N!>FEiAW18EvQE5oIxEblff=#&TVrqk@5fK^BOo2Xe7!)E8(A zFsK4~olsF2e@?BOqHHiLcJcz#xaj*97wU(D=G&d`=|37ErxB0|OV_g1yrh mn6cOg?gWYpA*mB%LN!+ojV}x2nFEiAW18C|E}5oIxE^xQ5W#&TVrqmqGvK^BOo2Xe7!)E8(A zFsK4~T~JXNe-e-{1H>@?V<1}{iLb%Pz#xaj*8=kS(D=G&d`=|3Hc-7h0|OV_f}_(H mn6cOg9t4UDA*qvNLN!+njjsyinr>|~cG-h<%e!qcnI~PX<0|SFB5KpUP)Tl4u6<|;Wayp@c zF#bd!Uj~R_e04?!200|YCXmmE#@9vTb0YDzfa>Lu_+m_8{aSDf|~cG-mYNe!qcnI~PYK0|SFB5KpUP)Tl4u6<|;Wa=M^` zF#aSUUj~R_d<{kh200|Y7Ld<}#@9vTb0YDzf$HUv_;O5O{aSDf)F1+IzABJ!ilo7M Kdwvh&KN|q4^&5x) diff --git a/examples/status-message-collections/res/status_message_collections.wasm b/examples/status-message-collections/res/status_message_collections.wasm index cdc3b6538b1f44028da0a4254ba0754f2c347280..d4a9dffd6502fc5e5c53975120556e85e0cbe4e7 100755 GIT binary patch delta 77 zcmaFg$M(LDtzipeh%c)x69a?Z^gB-7^5FQg(Z30OKz+02d1p>( +pub fn promise_batch_action_stake( promise_index: PromiseIndex, amount: Balance, - public_key: P, + public_key: &PublicKey, ) { - let public_key = public_key.borrow(); unsafe { sys::promise_batch_action_stake( promise_index, @@ -366,12 +364,11 @@ pub fn promise_batch_action_stake>( ) } } -pub fn promise_batch_action_add_key_with_full_access>( +pub fn promise_batch_action_add_key_with_full_access( promise_index: PromiseIndex, - public_key: P, + public_key: &PublicKey, nonce: u64, ) { - let public_key = public_key.borrow(); unsafe { sys::promise_batch_action_add_key_with_full_access( promise_index, @@ -381,15 +378,14 @@ pub fn promise_batch_action_add_key_with_full_access>( ) } } -pub fn promise_batch_action_add_key_with_function_call>( +pub fn promise_batch_action_add_key_with_function_call( promise_index: PromiseIndex, - public_key: P, + public_key: &PublicKey, nonce: u64, allowance: Balance, receiver_id: &AccountId, method_names: &[u8], ) { - let public_key = public_key.borrow(); let receiver_id: &str = receiver_id.as_ref(); unsafe { sys::promise_batch_action_add_key_with_function_call( @@ -405,11 +401,7 @@ pub fn promise_batch_action_add_key_with_function_call>( ) } } -pub fn promise_batch_action_delete_key>( - promise_index: PromiseIndex, - public_key: P, -) { - let public_key = public_key.borrow(); +pub fn promise_batch_action_delete_key(promise_index: PromiseIndex, public_key: &PublicKey) { unsafe { sys::promise_batch_action_delete_key( promise_index,