diff --git a/Anchor.toml b/Anchor.toml index 2ebd5af..5b26d40 100644 --- a/Anchor.toml +++ b/Anchor.toml @@ -1,2 +1,6 @@ +[provider] cluster = "localnet" wallet = "~/.config/solana/id.json" + +[scripts] +test = "mocha -t 1000000 tests/" diff --git a/programs/registry/src/lib.rs b/programs/registry/src/lib.rs index d1d7bda..d97a850 100644 --- a/programs/registry/src/lib.rs +++ b/programs/registry/src/lib.rs @@ -765,7 +765,7 @@ pub struct DepositLocked<'info> { // Program specific. registry: ProgramState<'info, Registry>, registrar: ProgramAccount<'info, Registrar>, - #[account(belongs_to = registrar, has_one = beneficiary)] + #[account(has_one = registrar, has_one = beneficiary)] member: ProgramAccount<'info, Member>, #[account(signer)] beneficiary: AccountInfo<'info>, @@ -781,7 +781,7 @@ pub struct Stake<'info> { pool_mint: CpiAccount<'info, Mint>, // Member. - #[account(mut, has_one = beneficiary, belongs_to = registrar)] + #[account(mut, has_one = beneficiary, has_one = registrar)] member: ProgramAccount<'info, Member>, #[account(signer)] beneficiary: AccountInfo<'info>, @@ -820,7 +820,7 @@ pub struct StartUnstake<'info> { // Member. #[account(init)] pending_withdrawal: ProgramAccount<'info, PendingWithdrawal>, - #[account(has_one = beneficiary, belongs_to = registrar)] + #[account(has_one = beneficiary, has_one = registrar)] member: ProgramAccount<'info, Member>, #[account(signer)] beneficiary: AccountInfo<'info>, @@ -850,11 +850,11 @@ pub struct StartUnstake<'info> { pub struct EndUnstake<'info> { registrar: ProgramAccount<'info, Registrar>, - #[account(belongs_to = registrar, has_one = beneficiary)] + #[account(has_one = registrar, has_one = beneficiary)] member: ProgramAccount<'info, Member>, #[account(signer)] beneficiary: AccountInfo<'info>, - #[account(mut, belongs_to = registrar, belongs_to = member, "!pending_withdrawal.burned")] + #[account(mut, has_one = registrar, has_one = member, "!pending_withdrawal.burned")] pending_withdrawal: ProgramAccount<'info, PendingWithdrawal>, // If we had ordered maps implementing Accounts we could do a constraint like @@ -885,7 +885,7 @@ pub struct Withdraw<'info> { // Stake instance. registrar: ProgramAccount<'info, Registrar>, // Member. - #[account(belongs_to = registrar, has_one = beneficiary)] + #[account(has_one = registrar, has_one = beneficiary)] member: ProgramAccount<'info, Member>, #[account(signer)] beneficiary: AccountInfo<'info>, @@ -938,7 +938,7 @@ pub struct WithdrawLocked<'info> { // Program specific. registry: ProgramState<'info, Registry>, registrar: ProgramAccount<'info, Registrar>, - #[account(belongs_to = registrar, has_one = beneficiary)] + #[account(has_one = registrar, has_one = beneficiary)] member: ProgramAccount<'info, Member>, #[account(signer)] beneficiary: AccountInfo<'info>, @@ -1010,7 +1010,7 @@ pub struct ClaimRewardCommon<'info> { // Stake instance. registrar: ProgramAccount<'info, Registrar>, // Member. - #[account(mut, belongs_to = registrar, has_one = beneficiary)] + #[account(mut, has_one = registrar, has_one = beneficiary)] member: ProgramAccount<'info, Member>, #[account(signer)] beneficiary: AccountInfo<'info>, @@ -1019,7 +1019,7 @@ pub struct ClaimRewardCommon<'info> { #[account("BalanceSandbox::from(&balances_locked) == member.balances_locked")] balances_locked: BalanceSandboxAccounts<'info>, // Vendor. - #[account(belongs_to = registrar, has_one = vault)] + #[account(has_one = registrar, has_one = vault)] vendor: ProgramAccount<'info, RewardVendor>, #[account(mut)] vault: AccountInfo<'info>, @@ -1042,7 +1042,7 @@ pub struct ExpireReward<'info> { // Staking instance globals. registrar: ProgramAccount<'info, Registrar>, // Vendor. - #[account(mut, belongs_to = registrar, has_one = vault, has_one = expiry_receiver)] + #[account(mut, has_one = registrar, has_one = vault, has_one = expiry_receiver)] vendor: ProgramAccount<'info, RewardVendor>, #[account(mut)] vault: CpiAccount<'info, TokenAccount>, diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000..b994454 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,8 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@project-serum/anchor-cli@^0.13.2": + version "0.13.2" + resolved "https://registry.yarnpkg.com/@project-serum/anchor-cli/-/anchor-cli-0.13.2.tgz#0dc0e4512a999b3908c3002379de37aa6c54887f" + integrity sha512-5wUkycPVyXTNZM7TleqF06owB1ALDecjBeMtHuBCDW5tGQQYVvU9SryjIgJmZjUChqgCQ38+kz+gi6IrJA+hjw==