@layerzerolabs/oapp-solana-contracts 1.2.50 → 1.2.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cargo.toml +8 -0
- package/macros/src/composer.rs +2 -4
- package/macros/src/oapp.rs +4 -11
- package/package.json +8 -8
package/Cargo.toml
CHANGED
|
@@ -3,6 +3,14 @@ name = "oapp"
|
|
|
3
3
|
version = "0.1.0"
|
|
4
4
|
edition = "2021"
|
|
5
5
|
|
|
6
|
+
[workspace]
|
|
7
|
+
resolver = "2"
|
|
8
|
+
members = [
|
|
9
|
+
"macros",
|
|
10
|
+
"macros/examples/counter",
|
|
11
|
+
]
|
|
12
|
+
exclude = ["dependencies"]
|
|
13
|
+
|
|
6
14
|
[features]
|
|
7
15
|
default = []
|
|
8
16
|
idl-build = ["anchor-lang/idl-build", "anchor-spl/idl-build", "oapp-macros/idl-build"]
|
package/macros/src/composer.rs
CHANGED
|
@@ -8,10 +8,8 @@ use anchor_trait::{generate_instructions, Assembly, InstructionOverrides, Overri
|
|
|
8
8
|
use proc_macro2::TokenStream;
|
|
9
9
|
use syn::ItemMod;
|
|
10
10
|
|
|
11
|
-
const OVERRIDE_CONFIG: OverrideConfig =
|
|
12
|
-
attr_name: "composer_instruction",
|
|
13
|
-
domain: "Composer",
|
|
14
|
-
};
|
|
11
|
+
const OVERRIDE_CONFIG: OverrideConfig =
|
|
12
|
+
OverrideConfig { attr_name: "composer_instruction", domain: "Composer" };
|
|
15
13
|
|
|
16
14
|
// ---------------------------------------------------------------------------
|
|
17
15
|
// Entry point
|
package/macros/src/oapp.rs
CHANGED
|
@@ -22,10 +22,8 @@ struct OAppAttr {
|
|
|
22
22
|
role_type: syn::Path,
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
const OVERRIDE_CONFIG: OverrideConfig =
|
|
26
|
-
attr_name: "oapp_instruction",
|
|
27
|
-
domain: "OApp",
|
|
28
|
-
};
|
|
25
|
+
const OVERRIDE_CONFIG: OverrideConfig =
|
|
26
|
+
OverrideConfig { attr_name: "oapp_instruction", domain: "OApp" };
|
|
29
27
|
|
|
30
28
|
// ---------------------------------------------------------------------------
|
|
31
29
|
// Entry point
|
|
@@ -45,19 +43,14 @@ pub fn expand(attr: TokenStream, item: TokenStream) -> syn::Result<TokenStream>
|
|
|
45
43
|
let overrides = InstructionOverrides::collect(&module, OVERRIDE_CONFIG)?;
|
|
46
44
|
|
|
47
45
|
// 2. Generate instructions
|
|
48
|
-
let codegen_ctx = CodegenContext {
|
|
49
|
-
oapp_type: quote!(#state),
|
|
50
|
-
role_type: quote!(#role),
|
|
51
|
-
};
|
|
46
|
+
let codegen_ctx = CodegenContext { oapp_type: quote!(#state), role_type: quote!(#role) };
|
|
52
47
|
let mut instructions = generate_instructions::<OAppInstructionSet>(&codegen_ctx, &overrides)?;
|
|
53
48
|
|
|
54
49
|
// Always inject RBAC accept_default_admin_transfer handler override so the endpoint
|
|
55
50
|
// delegate is automatically synced with the new admin (EVM parity:
|
|
56
51
|
// OAppCoreRBACUpgradeable). Reuses RBAC's StdAcceptDefaultAdminTransfer accounts.
|
|
57
52
|
// This is unconditional — programs cannot override this instruction.
|
|
58
|
-
instructions
|
|
59
|
-
.entrypoints
|
|
60
|
-
.extend(accept_default_admin_transfer::generate());
|
|
53
|
+
instructions.entrypoints.extend(accept_default_admin_transfer::generate());
|
|
61
54
|
|
|
62
55
|
// 3. Assemble output
|
|
63
56
|
let peer_prelude = state_types::generate_peer();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@layerzerolabs/oapp-solana-contracts",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.51",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
"rustfmt.toml"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@layerzerolabs/framework-solana-anchor-trait": "1.2.
|
|
19
|
-
"@layerzerolabs/utils-solana-rbac": "1.2.
|
|
18
|
+
"@layerzerolabs/framework-solana-anchor-trait": "1.2.51",
|
|
19
|
+
"@layerzerolabs/utils-solana-rbac": "1.2.51"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@layerzerolabs/build-utils-rust": "1.2.
|
|
23
|
-
"@layerzerolabs/tsup-configuration": "1.2.
|
|
24
|
-
"@layerzerolabs/typescript-configuration": "1.2.
|
|
25
|
-
"@layerzerolabs/vm-tooling-solana": "1.2.
|
|
22
|
+
"@layerzerolabs/build-utils-rust": "1.2.51",
|
|
23
|
+
"@layerzerolabs/tsup-configuration": "1.2.51",
|
|
24
|
+
"@layerzerolabs/typescript-configuration": "1.2.51",
|
|
25
|
+
"@layerzerolabs/vm-tooling-solana": "1.2.51"
|
|
26
26
|
},
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"access": "restricted",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@layerzerolabs/utils-solana-rbac": "workspace:*"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
|
-
"allow-read-write": "[ -z \"$CI\" ] || sudo chmod -R a+rwx ./target
|
|
42
|
+
"allow-read-write": "[ -z \"$CI\" ] || sudo chmod -R a+rwx ./target",
|
|
43
43
|
"build": "pnpm resolve-dependencies && pnpm build:lib && pnpm build:example && pnpm allow-read-write",
|
|
44
44
|
"build:example": "pnpm exec lz-tool --script 'anchor build --no-idl --ignore-keys' anchor",
|
|
45
45
|
"build:example:native": "pnpm exec lz-tool --docker-platform native --script 'anchor build --no-idl --ignore-keys' anchor",
|