Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "change marketplace_fee stake_key hash with the one we currently use" #4

Merged
merged 1 commit into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 24 additions & 27 deletions e2e/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const marketplacePkh =
"70e60f3b5ea7153e0acc7a803e4401d44b8ed1bae1c7baaad1a62a72";

const marketplaceStakePkh =
"1e78aae7c90cc36d624f7b3bb6d86b52696dc84e490f343eba89005f";
"81728e7ed4cf324e1323135e7e6d931f01e30792d9cdf17129cb806d";

export const BULK_PURCHASE_SIZE = 54;

Expand All @@ -59,14 +59,14 @@ export const bulkPurchaseAssets: Assets = new Array(BULK_PURCHASE_SIZE)
export const marketplaceAddr = C.BaseAddress.new(
0,
C.StakeCredential.from_keyhash(C.Ed25519KeyHash.from_hex(marketplacePkh)),
C.StakeCredential.from_keyhash(C.Ed25519KeyHash.from_hex(marketplaceStakePkh))
)
.to_address()
.to_bech32("addr_test");
C.StakeCredential.from_keyhash(
C.Ed25519KeyHash.from_hex(marketplaceStakePkh),
),
).to_address().to_bech32("addr_test");

export async function test(
name: string,
fn: (ctx: TestContext) => Promise<TxSigned>
fn: (ctx: TestContext) => Promise<TxSigned>,
) {
const sellerPk = generatePrivateKey();
const refPk = generatePrivateKey();
Expand All @@ -79,7 +79,9 @@ export async function test(
.selectWalletFromPrivateKey(sellerPk)
.wallet.address();

const refAddr = await l.selectWalletFromPrivateKey(refPk).wallet.address();
const refAddr = await l
.selectWalletFromPrivateKey(refPk)
.wallet.address();

const royaltyAddr = await l
.selectWalletFromPrivateKey(royaltyPk)
Expand All @@ -89,10 +91,12 @@ export async function test(
.selectWalletFromPrivateKey(buyerPk)
.wallet.address();

const { paymentCredential: sellerPaymentCredential } =
getAddressDetails(sellerAddr);
const { paymentCredential: royaltyPaymentCredential } =
getAddressDetails(royaltyAddr);
const { paymentCredential: sellerPaymentCredential } = getAddressDetails(
sellerAddr,
);
const { paymentCredential: royaltyPaymentCredential } = getAddressDetails(
royaltyAddr,
);

const emulator = new Emulator(
[
Expand All @@ -115,7 +119,7 @@ export async function test(
],
{
...PROTOCOL_PARAMETERS_DEFAULT,
}
},
);

const lucid = await Lucid.new(emulator);
Expand All @@ -126,13 +130,9 @@ export async function test(

const txRef = await lucid
.newTx()
.payToAddressWithData(
refAddr,
{ scriptRef: validator },
{
lovelace: 100000000n,
}
)
.payToAddressWithData(refAddr, { scriptRef: validator }, {
lovelace: 100000000n,
})
.complete();

const signedRef = await txRef.sign().complete();
Expand Down Expand Up @@ -161,7 +161,7 @@ export async function test(

export async function testFail(
name: string,
fn: (ctx: TestContext) => Promise<TxSigned>
fn: (ctx: TestContext) => Promise<TxSigned>,
) {
try {
await test(name, fn);
Expand All @@ -171,15 +171,12 @@ export async function testFail(

console.log(err);
} catch (e) {
const error = e
.split("\n")
.map((l: string) => `\n ${l}`)
.join("");
const error = e.split("\n").map((l: string) => `\n ${l}`).join("");

const message = `
${colors.bold(colors.brightMagenta(name))} - ${colors.green(
"passed"
)}\n${error}`;
${colors.bold(colors.brightMagenta(name))} - ${
colors.green("passed")
}\n${error}`;

console.log(message);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/jpg/constants.ak
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use aiken/transaction/credential.{Address, Inline, VerificationKeyCredential}
use jpg/types.{VerificationKeyHash}

pub const marketplace_stake_vkh: VerificationKeyHash =
#"1e78aae7c90cc36d624f7b3bb6d86b52696dc84e490f343eba89005f"
#"81728e7ed4cf324e1323135e7e6d931f01e30792d9cdf17129cb806d"

pub const marketplace_vkh: VerificationKeyHash =
#"70e60f3b5ea7153e0acc7a803e4401d44b8ed1bae1c7baaad1a62a72"
Expand Down
6 changes: 3 additions & 3 deletions plutus.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"$ref": "#/definitions/ask~1Redeemer"
}
},
"compiledCode": "59058301000032323232323232323232322223232533300a323232323232323232323232323232323232533301c3370e9000000899191919191919191919192999813801899b8848000ccc00401001401c4c8c8c8c8c8c8c8c8c8c8c8c8c94ccc0dcc0e80184c8c8c94ccc0e8c0f40084c8c8c8c94ccc0ed4ccc0ed4ccc0ec028402452808008a50100214a066e24040008cdc7802a44100375a60740046eb8c0e000458c0ec004dd5981b8011bae30350011630380053375e00c98150d8799fd8799f581c70e60f3b5ea7153e0acc7a803e4401d44b8ed1bae1c7baaad1a62a72ffd8799fd8799fd8799f581c1e78aae7c90cc36d624f7b3bb6d86b52696dc84e490f343eba89005fffffffff003375e002022606a002606a0046eacc0cc004c0cc008c0c4004c0a4010cdc199b83337040029032240c49032199801800803a6103d8798000302e005302c00430010012222323232323232323253330313375e0020122646464646464a66606e66ebc00c02c4c94ccc0ecc0f80284c8c8c94ccc0f8c1040084c8c94ccc0f4cdc7802a45001533303d533303d3371200e002266e21200000714a026466e000200054ccc10002c520001333301801801300b4c103d87980001616375a607c0046eb8c0f000458c0fc004dd5981d8011bae303900116303c00916375a60760026076004607200260620046070016606c0142c606a002606a0046eacc0cc004c0cc008c0c4004c0a4008c0c0010c0b800cccc8c0040048894ccc0a800852809919299981498018010a511333005005001003302e003375c605800497ae023300b00d001333232323001001222533302833712900a00089919980200200099b8100248050c8c8c8c8c8c8c8c8c8c0dc004c0d8004c0d4004c0d0004c0cc004c0c8004c0c4004c0c0004c0bc004c0b80084cc010008004c0040048894ccc098cdc3800a4000200426466600800800266e040092002302c0020120063758604e002603e030646466e95200433026375200297ae037280026ecc004c090004c0714ccc078cdc3a4004603a02220222c6eb4c088004c0680504cc008010dd71980c180d009a400460340266002002444a66603e00429404c8c94ccc078cdc78010018a5113330050050010033023003375c60420046eb0c074004c074004c070004c06c004c068004c064004c060008dd6180b000980b000980a800980600198090009809001180800098040018a4c2c6400a6646464464a66601c66e1d200000113232323253330153018002132498cc01c00c8c9263253330143370e9000000899191919299980d980f00109924c64a66603266e1d20000011323232325333020302300213232498c94ccc07ccdc3a400000226464a666048604e0042649319299981119b87480000044c8c94ccc09cc0a80084c926301b0011630280013020002153330223370e90010008991919191919299981598170010a4c2c6eb4c0b0004c0b0008dd6981500098150011bad30280013020002163020001163025001301d0031533301f3370e90010008a999811180e8018a4c2c2c603a00460280062c60420026042004603e002602e0082c602e0062c6eb4c070004c070008c068004c04800858c04800458dd7180b000980b0011bac3014001300c00216300c0013001001222533301000214984c8ccc010010c05000c008c004c0480088c94ccc02ccdc3a400000226464a66602060260042930b1bae301100130090021533300b3370e900100089919299980818098010a4c2c6eb8c044004c02400858c024004010c800cc94ccc024cdc3a400000226464a66601c60220042930b1bad300f0013007003153330093370e90010008a99980618038018a4c2c2c600e0046600200290001111199980399b8700100300c233330050053370000890011807000801001118029baa001230033754002ae6955ceaab9e5573eae815d0aba201",
"hash": "72d101ab30e212b89e8b2b51516ecbbf4d598ad65638dd854debe0c3"
"compiledCode": "59058301000032323232323232323232322223232533300a323232323232323232323232323232323232533301c3370e9000000899191919191919191919192999813801899b8848000ccc00401001401c4c8c8c8c8c8c8c8c8c8c8c8c8c94ccc0dcc0e80184c8c8c94ccc0e8c0f40084c8c8c8c94ccc0ed4ccc0ed4ccc0ec028402452808008a50100214a066e24040008cdc7802a44100375a60740046eb8c0e000458c0ec004dd5981b8011bae30350011630380053375e00c98150d8799fd8799f581c70e60f3b5ea7153e0acc7a803e4401d44b8ed1bae1c7baaad1a62a72ffd8799fd8799fd8799f581c81728e7ed4cf324e1323135e7e6d931f01e30792d9cdf17129cb806dffffffff003375e002022606a002606a0046eacc0cc004c0cc008c0c4004c0a4010cdc199b83337040029032240c49032199801800803a6103d8798000302e005302c00430010012222323232323232323253330313375e0020122646464646464a66606e66ebc00c02c4c94ccc0ecc0f80284c8c8c94ccc0f8c1040084c8c94ccc0f4cdc7802a45001533303d533303d3371200e002266e21200000714a026466e000200054ccc10002c520001333301801801300b4c103d87980001616375a607c0046eb8c0f000458c0fc004dd5981d8011bae303900116303c00916375a60760026076004607200260620046070016606c0142c606a002606a0046eacc0cc004c0cc008c0c4004c0a4008c0c0010c0b800cccc8c0040048894ccc0a800852809919299981498018010a511333005005001003302e003375c605800497ae023300b00d001333232323001001222533302833712900a00089919980200200099b8100248050c8c8c8c8c8c8c8c8c8c0dc004c0d8004c0d4004c0d0004c0cc004c0c8004c0c4004c0c0004c0bc004c0b80084cc010008004c0040048894ccc098cdc3800a4000200426466600800800266e040092002302c0020120063758604e002603e030646466e95200433026375200297ae037280026ecc004c090004c0714ccc078cdc3a4004603a02220222c6eb4c088004c0680504cc008010dd71980c180d009a400460340266002002444a66603e00429404c8c94ccc078cdc78010018a5113330050050010033023003375c60420046eb0c074004c074004c070004c06c004c068004c064004c060008dd6180b000980b000980a800980600198090009809001180800098040018a4c2c6400a6646464464a66601c66e1d200000113232323253330153018002132498cc01c00c8c9263253330143370e9000000899191919299980d980f00109924c64a66603266e1d20000011323232325333020302300213232498c94ccc07ccdc3a400000226464a666048604e0042649319299981119b87480000044c8c94ccc09cc0a80084c926301b0011630280013020002153330223370e90010008991919191919299981598170010a4c2c6eb4c0b0004c0b0008dd6981500098150011bad30280013020002163020001163025001301d0031533301f3370e90010008a999811180e8018a4c2c2c603a00460280062c60420026042004603e002602e0082c602e0062c6eb4c070004c070008c068004c04800858c04800458dd7180b000980b0011bac3014001300c00216300c0013001001222533301000214984c8ccc010010c05000c008c004c0480088c94ccc02ccdc3a400000226464a66602060260042930b1bae301100130090021533300b3370e900100089919299980818098010a4c2c6eb8c044004c02400858c024004010c800cc94ccc024cdc3a400000226464a66601c60220042930b1bad300f0013007003153330093370e90010008a99980618038018a4c2c2c600e0046600200290001111199980399b8700100300c233330050053370000890011807000801001118029baa001230033754002ae6955ceaab9e5573eae815d0aba201",
"hash": "d7a69b54c817c494fcbfbfbb9def5d5287fcc0e25f54bfe900a1a89e"
}
],
"definitions": {
Expand Down Expand Up @@ -145,7 +145,7 @@
},
"ask/Datum": {
"title": "Datum",
"description": "A listing requires a datum that has\n the owner's payment key and a list of payouts.\n The optional `reserver_for` allows for peer to peer\n trading where the buyer must match the\n private buyer payment key. Since the datum expects\n a marketplace fee, we do not need to specify the\n marketplace payout in `payouts` even though it will\n be in one of the outputs.",
"description": "A listing requires a datum that has\n the owner's payment key and a list of payouts.\n We do not need to specify the marketplace payout\n in `payouts` even though it will be in\n one of the outputs.",
"anyOf": [
{
"title": "Datum",
Expand Down