File tree Expand file tree Collapse file tree 2 files changed +4
-28
lines changed
examples/sol-anchor-contract
programs/sol-anchor-contract/src Expand file tree Collapse file tree 2 files changed +4
-28
lines changed Original file line number Diff line number Diff line change @@ -122,10 +122,6 @@ pub mod sol_anchor_contract {
122
122
123
123
#[ derive( Accounts ) ]
124
124
pub struct InitRequest < ' info > {
125
- #[ account(
126
- address = * program_id @ ErrorCode :: Unauthorized
127
- ) ]
128
- pub program : Signer < ' info > ,
129
125
#[ account( mut ) ]
130
126
pub payer : Signer < ' info > ,
131
127
#[ account(
@@ -148,4 +144,4 @@ pub struct QueryRequest<'info> {
148
144
address = config. collateral_price_feed_id @ ErrorCode :: InvalidArgument
149
145
) ]
150
146
pub pyth_collateral_account : Account < ' info , PriceFeed > ,
151
- }
147
+ }
Original file line number Diff line number Diff line change @@ -18,28 +18,8 @@ describe("sol-anchor-contract", () => {
18
18
. SolAnchorContract as anchor . Program < SolAnchorContract > ;
19
19
const payer = provider . wallet . publicKey ;
20
20
let programId = program . programId ;
21
- var programKey ;
22
-
23
- try {
24
- let data = fs . readFileSync (
25
- "./target/deploy/sol_anchor_contract-keypair.json"
26
- ) ;
27
- programKey = anchor . web3 . Keypair . fromSecretKey (
28
- new Uint8Array ( JSON . parse ( data ) )
29
- ) ;
30
- } catch ( error ) {
31
- throw new Error (
32
- "Please make sure the program key is program_address.json."
33
- ) ;
34
- }
35
-
36
- try {
37
- assert ( programId . equals ( programKey . publicKey ) ) ;
38
- } catch ( error ) {
39
- throw new Error (
40
- "Please make sure you have the same program address in Anchor.toml and program_address.json"
41
- ) ;
42
- }
21
+ const programKey = program . programId ;
22
+ console . log ( programKey )
43
23
44
24
it ( "Initialize the config." , async ( ) => {
45
25
const tx = await program . methods
@@ -53,7 +33,7 @@ describe("sol-anchor-contract", () => {
53
33
config : config . publicKey ,
54
34
systemProgram : anchor . web3 . SystemProgram . programId ,
55
35
} )
56
- . signers ( [ config , programKey ] )
36
+ . signers ( [ config ] )
57
37
. rpc ( ) ;
58
38
59
39
console . log ( "Config key: " + config . publicKey ) ;
You can’t perform that action at this time.
0 commit comments