Skip to content

Commit

Permalink
clean up unused parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyLi28 committed Nov 20, 2024
1 parent 1f7ca41 commit 42864c2
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 43 deletions.
5 changes: 0 additions & 5 deletions programs/mmm/src/instructions/cnft/sol_cnft_fulfill_buy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ pub struct SolCnftFulfillBuyArgs {
// === cNFT transfer args === //
// The Merkle root for the tree. Can be retrieved from off-chain data store.
root: [u8; 32],
// The Keccak256 hash of the NFTs existing metadata (without the verified flag for the creator changed).
// The metadata is retrieved from off-chain data store.
metadata_hash: [u8; 32],
// The Keccak256 hash of the NFTs existing creators array (without the verified flag for the creator changed).
// The creators array is retrieved from off-chain data store.
creator_hash: [u8; 32],
Expand All @@ -38,8 +35,6 @@ pub struct SolCnftFulfillBuyArgs {
index: u32,

// === Contract args === //
// Price of the NFT in the payment_mint.
buyer_price: u64,
pub min_payment_amount: u64,
pub maker_fee_bp: i16, // will be checked by cosigner
pub taker_fee_bp: i16, // will be checked by cosigner
Expand Down
7 changes: 1 addition & 6 deletions programs/mmm/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,7 @@ pub fn check_allowlists_for_mint(
}

pub fn check_allowlists_for_cnft(allowlists: &[Allowlist], collection: Collection) -> Result<()> {
// We need to check the following validation rules
// 1. make sure the metadata is correctly derived from the metadata pda with the mint
// 2. make sure mint+metadata(e.g. first verified creator address) can match one of the allowlist
// 3. note that the allowlist is unioned together, not intersection
// 4. skip if the allowlist.is_empty()
// 5. verify that nft either does not have master edition or is master edition
// Check mcc for cnft.
for allowlist_val in allowlists.iter() {
match allowlist_val.kind {
ALLOWLIST_KIND_EMPTY => {}
Expand Down
26 changes: 0 additions & 26 deletions sdk/src/idl/mmm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2684,15 +2684,6 @@ export type Mmm = {
]
}
},
{
"name": "metadataHash",
"type": {
"array": [
"u8",
32
]
}
},
{
"name": "creatorHash",
"type": {
Expand All @@ -2710,10 +2701,6 @@ export type Mmm = {
"name": "index",
"type": "u32"
},
{
"name": "buyerPrice",
"type": "u64"
},
{
"name": "minPaymentAmount",
"type": "u64"
Expand Down Expand Up @@ -5969,15 +5956,6 @@ export const IDL: Mmm = {
]
}
},
{
"name": "metadataHash",
"type": {
"array": [
"u8",
32
]
}
},
{
"name": "creatorHash",
"type": {
Expand All @@ -5995,10 +5973,6 @@ export const IDL: Mmm = {
"name": "index",
"type": "u32"
},
{
"name": "buyerPrice",
"type": "u64"
},
{
"name": "minPaymentAmount",
"type": "u64"
Expand Down
6 changes: 0 additions & 6 deletions tests/mmm-cnft.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,9 @@ describe('cnft tests', () => {
const fulfillBuyTxnSig = await program.methods
.cnftFulfillBuy({
root: getByteArray(nft.tree.root),
metadataHash: getByteArray(nft.tree.dataHash),
creatorHash: getByteArray(nft.tree.creatorHash),
nonce: new BN(nft.tree.nonce),
index: nft.nft.nftIndex,
buyerPrice: new BN(spotPrice * LAMPORTS_PER_SOL),
minPaymentAmount: new BN(expectedBuyPrices.sellerReceives),
makerFeeBp: 0,
takerFeeBp: 100,
Expand Down Expand Up @@ -469,11 +467,9 @@ describe('cnft tests', () => {
const fulfillBuyTxnSig = await program.methods
.cnftFulfillBuy({
root: getByteArray(nft.tree.root),
metadataHash: getByteArray(nft.tree.dataHash),
creatorHash: getByteArray(nft.tree.creatorHash),
nonce: new BN(nft.tree.nonce),
index: nft.nft.nftIndex,
buyerPrice: new BN(spotPrice * LAMPORTS_PER_SOL),
minPaymentAmount: new BN(expectedBuyPrices.sellerReceives),
makerFeeBp: 0,
takerFeeBp: 100,
Expand Down Expand Up @@ -687,11 +683,9 @@ describe('cnft tests', () => {
const fulfillBuyTxnSig = await program.methods
.cnftFulfillBuy({
root: getByteArray(nft.tree.root),
metadataHash: getByteArray(nft.tree.dataHash),
creatorHash: getByteArray(nft.tree.creatorHash),
nonce: new BN(nft.tree.nonce),
index: nft.nft.nftIndex,
buyerPrice: new BN(spotPrice * LAMPORTS_PER_SOL),
minPaymentAmount: new BN(expectedBuyPrices.sellerReceives),
makerFeeBp: 0,
takerFeeBp: 100,
Expand Down

0 comments on commit 42864c2

Please sign in to comment.