@@ -38,9 +38,7 @@ module pyth_lazer::pyth_lazer {
38
38
39
39
/// Initialize the Lazer contract with top authority and treasury. One-time operation.
40
40
public entry fun initialize (
41
- account: &signer ,
42
- top_authority: address ,
43
- treasury: address ,
41
+ account: &signer , top_authority: address , treasury: address
44
42
) {
45
43
// Initialize must be called by the contract account
46
44
assert !(signer ::address_of (account) == @pyth_lazer , ENO_PERMISSIONS );
@@ -77,7 +75,7 @@ module pyth_lazer::pyth_lazer {
77
75
let valid = false ;
78
76
while (i < storage.trusted_signers.length ()) {
79
77
let signer_info = vector ::borrow (&storage.trusted_signers, (i as u64 ));
80
- if (signer_info.pubkey == trusted_signer
78
+ if (& signer_info.pubkey == & trusted_signer
81
79
&& signer_info.expires_at > timestamp::now_seconds ()) {
82
80
valid = true ;
83
81
break
@@ -94,6 +92,7 @@ module pyth_lazer::pyth_lazer {
94
92
EINVALID_SIGNATURE
95
93
);
96
94
}
95
+
97
96
/// Upsert a trusted signer's information or remove them
98
97
public entry fun update_trusted_signer (
99
98
account: &signer , trusted_signer: vector <u8 >, expires_at: u64
@@ -111,7 +110,7 @@ module pyth_lazer::pyth_lazer {
111
110
112
111
while (i < num_signers) {
113
112
let signer_info = vector ::borrow (&storage.trusted_signers, (i as u64 ));
114
- if (signer_info.pubkey == trusted_signer) {
113
+ if (& signer_info.pubkey == & trusted_signer) {
115
114
found = true ;
116
115
break
117
116
};
@@ -140,6 +139,7 @@ module pyth_lazer::pyth_lazer {
140
139
let storage = borrow_global <Storage >(@pyth_lazer );
141
140
storage.trusted_signers
142
141
}
142
+
143
143
/// Signer pubkey getter
144
144
public fun get_signer_pubkey (info: &TrustedSignerInfo ): vector <u8> {
145
145
info.pubkey
@@ -149,6 +149,4 @@ module pyth_lazer::pyth_lazer {
149
149
public fun get_signer_expires_at (info: &TrustedSignerInfo ): u64 {
150
150
info.expires_at
151
151
}
152
-
153
-
154
152
}
0 commit comments