-
Notifications
You must be signed in to change notification settings - Fork 123
/
update-bindings.sh
executable file
·97 lines (85 loc) · 5.69 KB
/
update-bindings.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/bin/bash
set -x
set -e
resim="cargo run --manifest-path $PWD/radix-clis/Cargo.toml --bin resim $@ --"
scrypto_bindgen="cargo run --manifest-path $PWD/radix-clis/Cargo.toml --bin scrypto-bindgen $@ --"
file_contents="
use radix_engine_interface::blueprints::access_controller::*;
use radix_engine_interface::blueprints::account::*;
use radix_engine_interface::blueprints::consensus_manager::*;
use crate::prelude::*;
//==================================================================================================
// This file has been autogenerated by the ./update-bindings.sh script and none of the contents here
// are hand-written. If you make any changes to the interface of native blueprints and need to regen
// the bindings then run the update-bindings.sh script at the root of the repo.
//==================================================================================================
"
list=(
# Faucet
"package_sim1pkgxxxxxxxxxfaucetxxxxxxxxx000034355863xxxxxxxxxhkrefh
--func-sig-change blueprint_name=Faucet;func_name=new;1=FungibleBucket
--func-sig-change blueprint_name=Faucet;func_name=free;r=FungibleBucket
"
# Consensus Manager & Validator
"package_sim1pkgxxxxxxxxxcnsmgrxxxxxxxxx000746305335xxxxxxxxxxc06cl
--func-sig-change blueprint_name=ConsensusManager;func_name=create_validator;2=FungibleBucket;r=(Global<Validator>,NonFungibleBucket,FungibleBucket)
--func-sig-change blueprint_name=Validator;func_name=stake_as_owner;0=FungibleBucket;r=FungibleBucket
--func-sig-change blueprint_name=Validator;func_name=stake;0=FungibleBucket;r=FungibleBucket
--func-sig-change blueprint_name=Validator;func_name=unstake;0=FungibleBucket;r=NonFungibleBucket
--func-sig-change blueprint_name=Validator;func_name=claim_xrd;0=NonFungibleBucket;r=FungibleBucket
--func-sig-change blueprint_name=Validator;func_name=lock_owner_stake_units;0=FungibleBucket
--func-sig-change blueprint_name=Validator;func_name=finish_unlock_owner_stake_units;r=FungibleBucket
--func-sig-change blueprint_name=Validator;func_name=apply_emission;0=FungibleBucket
--func-sig-change blueprint_name=Validator;func_name=apply_reward;0=FungibleBucket
"
# Identity
"package_sim1pkgxxxxxxxxxdntyxxxxxxxxxxx008560783089xxxxxxxxxnc59k6
--func-sig-change blueprint_name=Identity;func_name=create;r=(Global<Identity>,NonFungibleBucket)
--func-sig-change blueprint_name=Identity;func_name=securify;r=NonFungibleBucket
"
# Account
"package_sim1pkgxxxxxxxxxaccntxxxxxxxxxx000929625493xxxxxxxxxrn8jm6
--func-sig-change blueprint_name=Account;func_name=create;r=(Global<Account>,NonFungibleBucket)
--func-sig-change blueprint_name=Account;func_name=securify;r=NonFungibleBucket
--func-sig-change blueprint_name=Account;func_name=withdraw_non_fungibles;r=NonFungibleBucket
--func-sig-change blueprint_name=Account;func_name=lock_fee_and_withdraw_non_fungibles;r=NonFungibleBucket
--func-sig-change blueprint_name=Account;func_name=create_proof_of_amount;r=FungibleProof
--func-sig-change blueprint_name=Account;func_name=create_proof_of_non_fungibles;r=NonFungibleProof
"
# Pools
"package_sim1pkgxxxxxxxxxplxxxxxxxxxxxxx020379220524xxxxxxxxxl5e8k6
--func-sig-change blueprint_name=OneResourcePool;func_name=contribute;0=FungibleBucket;r=FungibleBucket
--func-sig-change blueprint_name=OneResourcePool;func_name=redeem;0=FungibleBucket;r=FungibleBucket
--func-sig-change blueprint_name=OneResourcePool;func_name=protected_deposit;0=FungibleBucket
--func-sig-change blueprint_name=OneResourcePool;func_name=protected_withdraw;r=FungibleBucket
--func-sig-change blueprint_name=TwoResourcePool;func_name=contribute;0=(FungibleBucket,FungibleBucket);r=(FungibleBucket,Option<FungibleBucket>)
--func-sig-change blueprint_name=TwoResourcePool;func_name=redeem;0=FungibleBucket;r=(FungibleBucket,FungibleBucket)
--func-sig-change blueprint_name=TwoResourcePool;func_name=protected_deposit;0=FungibleBucket
--func-sig-change blueprint_name=TwoResourcePool;func_name=protected_withdraw;r=FungibleBucket
--func-sig-change blueprint_name=MultiResourcePool;func_name=contribute;0=Vec<FungibleBucket>;r=(FungibleBucket,Vec<FungibleBucket>)
--func-sig-change blueprint_name=MultiResourcePool;func_name=redeem;0=FungibleBucket;r=Vec<FungibleBucket>
--func-sig-change blueprint_name=MultiResourcePool;func_name=protected_deposit;0=FungibleBucket
--func-sig-change blueprint_name=MultiResourcePool;func_name=protected_withdraw;r=FungibleBucket
"
# Access Controller
"package_sim1pkgxxxxxxxxxcntrlrxxxxxxxxx000648572295xxxxxxxxxxc5z0l
--func-sig-change blueprint_name=AccessController;func_name=mint_recovery_badges;r=NonFungibleBucket
--func-sig-change blueprint_name=AccessController;func_name=withdraw_recovery_fee;r=FungibleBucket
--func-sig-change blueprint_name=AccessController;func_name=contribute_recovery_fee;0=FungibleBucket
"
# Locker Package
"package_sim1pkgxxxxxxxxxlckerxxxxxxxxxx000208064247xxxxxxxxxpnfcn6
--func-sig-change blueprint_name=AccountLocker;func_name=instantiate_simple;r=(Global<AccountLocker>,FungibleBucket)
--func-sig-change blueprint_name=AccountLocker;func_name=recover_non_fungibles;r=NonFungibleBucket
--func-sig-change blueprint_name=AccountLocker;func_name=claim_non_fungibles;r=NonFungibleBucket
"
);
for entry in "${list[@]}";
do
read -r address replacement <<< $(echo $entry)
file_contents="$file_contents
$($scrypto_bindgen $address --reset-ledger $replacement)"
done
echo "$file_contents" > $PWD/scrypto/src/component/stubs.rs
rustfmt $PWD/scrypto/src/component/stubs.rs
python3 format-stubs.py