I'm having problem with my MoodNftIntegrationTest!!! #3269
Unanswered
theblack2ke
asked this question in
Q&A
Replies: 1 comment
-
Hello @theblack2ke, Please set the below as your "data:application/json;base64,eyJuYW1lIjogIk1vb2QgTkZUIiwgImRlc2NyaXB0aW9uIjogIkFuIE5GVCB0aGF0IHJlZmxlY3RzIHRoZSBvd25lcnMgbW9vZC4iLCAiYXR0cmlidXRlcyI6IFt7InRyaXRfdHlwZSI6ICJtb29kaW5lc3MiLCAidmFsdWUiOiAiMTAwIn1dLCAiaW1hZ2UiOiAiZGF0YTppbWFnZS9zdmcreG1sO2Jhc2U2NCxQRDk0Yld3Z2RtVnljMmx2YmowaU1TNHdJaUJ6ZEdGdVpHRnNiMjVsUFNKdWJ5SS9QZ284YzNabklIZHBaSFJvUFNJeE1ESTBjSGdpSUdobGFXZG9kRDBpTVRBeU5IQjRJaUIyYVdWM1FtOTRQU0l3SURBZ01UQXlOQ0F4TURJMElpQjRiV3h1Y3owaWFIUjBjRG92TDNkM2R5NTNNeTV2Y21jdk1qQXdNQzl6ZG1jaVBnb2dJQ0FnUEhCaGRHZ2dabWxzYkQwaUl6TXpNeUlLSUNBZ0lDQWdJQ0JrUFNKTk5URXlJRFkwUXpJMk5DNDJJRFkwSURZMElESTJOQzQySURZMElEVXhNbk15TURBdU5pQTBORGdnTkRRNElEUTBPQ0EwTkRndE1qQXdMallnTkRRNExUUTBPRk0zTlRrdU5DQTJOQ0ExTVRJZ05qUjZiVEFnT0RJd1l5MHlNRFV1TkNBd0xUTTNNaTB4TmpZdU5pMHpOekl0TXpjeWN6RTJOaTQyTFRNM01pQXpOekl0TXpjeUlETTNNaUF4TmpZdU5pQXpOeklnTXpjeUxURTJOaTQySURNM01pMHpOeklnTXpjeWVpSWdMejRLSUNBZ0lEeHdZWFJvSUdacGJHdzlJaU5GTmtVMlJUWWlDaUFnSUNBZ0lDQWdaRDBpVFRVeE1pQXhOREJqTFRJd05TNDBJREF0TXpjeUlERTJOaTQyTFRNM01pQXpOekp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UXpZMk55NDJJRFl3TUM0eklEVTVOeTQxSURVek15QTFNVElnTlRNemVtMHhNamd0TVRFeVlUUTRJRFE0SURBZ01TQXdJRGsySURBZ05EZ2dORGdnTUNBeElEQXRPVFlnTUhvaUlDOCtDand2YzNablBnPT0ifQ==" |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
ok so here is my MoodNftIntegrationTest
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
import {Test, console} from "forge-std/Test.sol";
import {MoodNft} from "src/MoodNft.sol";
import {DeployMoodNft} from "../../script/DeployMoodNft.s.sol";
contract MoodNftIntegrationTest is Test {
MoodNft moodNft;
string public constant SAD_SVG_IMAGE_URI =
"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pgo8c3ZnIHdpZHRoPSIxMDI0cHgiIGhlaWdodD0iMTAyNHB4IiB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogICAgPHBhdGggZmlsbD0iIzMzMyIKICAgICAgICBkPSJNNTEyIDY0QzI2NC42IDY0IDY0IDI2NC42IDY0IDUxMnMyMDAuNiA0NDggNDQ4IDQ0OCA0NDgtMjAwLjYgNDQ4LTQ0OFM3NTkuNCA2NCA1MTIgNjR6bTAgODIwYy0yMDUuNCAwLTM3Mi0xNjYuNi0zNzItMzcyczE2Ni42LTM3MiAzNzItMzcyIDM3MiAxNjYuNiAzNzIgMzcyLTE2Ni42IDM3Mi0zNzIgMzcyeiIgLz4KICAgIDxwYXRoIGZpbGw9IiNFNkU2RTYiCiAgICAgICAgZD0iTTUxMiAxNDBjLTIwNS40IDAtMzcyIDE2Ni42LTM3MiAzNzJzMTY2LjYgMzcyIDM3MiAzNzIgMzcyLTE2Ni42IDM3Mi0zNzItMTY2LjYtMzcyLTM3Mi0zNzJ6TTI4OCA0MjFh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j0iNzgiIHN0cm9rZT0iYmxhY2siIHN0cm9rZS13aWR0aD0iMyIgLz4KICAgIDxnIGNsYXNzPSJleWVzIj4KICAgICAgICA8Y2lyY2xlIGN4PSI3MCIgY3k9IjgyIiByPSIxMiIgLz4KICAgICAgICA8Y2lyY2xlIGN4PSIxMjciIGN5PSI4MiIgcj0iMTIiIC8+CiAgICA8L2c+CiAgICA8cGF0aCBkPSJtMTM2LjgxIDExNi41M2MuNjkgMjYuMTctNjQuMTEgNDItODEuNTItLjczIiBzdHlsZT0iZmlsbDpub25lOyBzdHJva2U6IGJsYWNrOyBzdHJva2Utd2lkdGg6IDM7IiAvPgo8L3N2Zz4=";
}
but i'm get an error still don't why
the error :
forge test --mt testFlipTokenToSad -vvvv
[⠢] Compiling...
[⠃] Compiling 1 files with Solc 0.8.28
[⠊] Solc 0.8.28 finished in 3.67s
Compiler run successful!
Ran 1 test for test/integration/MoodNftIntegrationTest.t.sol:MoodNftIntegrationTest
[FAIL: assertion failed: 0x9d1b635e85d7c34b126d76fa9ddcc5a4401a391d4bfc19aab11f2324ddca3c76 != 0xfe40350ebfdea6067edc9712cc5f0efc7c62db199d168463c9702ecad8d7afae] testFlipTokenToSad() (gas: 356098)
Logs:
Traces:
[6514632] MoodNftIntegrationTest::setUp()
├─ [2855373] → new DeployMoodNft@0x5615dEB798BB3E4dFa0139dFa1b3D433Cc23b72f
│ └─ ← [Return] 14149 bytes of code
├─ [3595040] DeployMoodNft::run()
│ ├─ [0] VM::readFile("./img/sad.svg") [staticcall]
│ │ └─ ← [Return]
│ ├─ [0] VM::readFile("./img/happy.svg") [staticcall]
│ │ └─ ← [Return]
│ ├─ [0] console::log("\n<svg width="1024px" height="1024px" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg\">\n <path fill="#333"\n d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" />\n <path fill="#E6E6E6"\n d="M512 140c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372zM288 421a48.01 48.01 0 0 1 96 0 48.01 48.01 0 0 1-96 0zm376 272h-48.1c-4.2 0-7.8-3.2-8.1-7.4C604 636.1 562.5 597 512 597s-92.1 39.1-95.8 88.6c-.3 4.2-3.9 7.4-8.1 7.4H360a8 8 0 0 1-8-8.4c4.4-84.3 74.5-151.6 160-151.6s155.6 67.3 160 151.6a8 8 0 0 1-8 8.4zm24-224a48.01 48.01 0 0 1 0-96 48.01 48.01 0 0 1 0 96z" />\n <path fill="#333"\n d="M288 421a48 48 0 1 0 96 0 48 48 0 1 0-96 0zm224 112c-85.5 0-155.6 67.3-160 151.6a8 8 0 0 0 8 8.4h48.1c4.2 0 7.8-3.2 8.1-7.4 3.7-49.5 45.3-88.6 95.8-88.6s92 39.1 95.8 88.6c.3 4.2 3.9 7.4 8.1 7.4H664a8 8 0 0 0 8-8.4C667.6 600.3 597.5 533 512 533zm128-112a48 48 0 1 0 96 0 48 48 0 1 0-96 0z" />\n") [staticcall]
│ │ └─ ← [Stop]
│ ├─ [0] VM::startBroadcast()
│ │ └─ ← [Return]
│ ├─ [3425643] → new MoodNft@0x34A1D3fff3958843C43aD80F30b94c510645C316
│ │ └─ ← [Return] 9319 bytes of code
│ ├─ [0] VM::stopBroadcast()
│ │ └─ ← [Return]
│ └─ ← [Return] MoodNft: [0x34A1D3fff3958843C43aD80F30b94c510645C316]
└─ ← [Stop]
[356098] MoodNftIntegrationTest::testFlipTokenToSad()
├─ [0] VM::prank(user: [0x6CA6d1e2D5347Bfab1d91e883F1915560e09129D])
│ └─ ← [Return]
├─ [74740] MoodNft::mintNft()
│ ├─ emit Transfer(from: 0x0000000000000000000000000000000000000000, to: user: [0x6CA6d1e2D5347Bfab1d91e883F1915560e09129D], tokenId: 0)
│ └─ ← [Stop]
├─ [0] VM::prank(user: [0x6CA6d1e2D5347Bfab1d91e883F1915560e09129D])
│ └─ ← [Return]
├─ [21491] MoodNft::flipMood(0)
│ └─ ← [Stop]
├─ [241836] MoodNft::tokenURI(0) [staticcall]
│ └─ ← [Return] "data:application/json;base64,eyJuYW1lIjogIk1vb2QgTkZUIiwgImRlc2NyaXB0aW9uIjogIkFuIE5GVCB0aGF0IHJlZmxlY3RzIHRoZSBvd25lcnMgbW9vZC4iLCAiYXR0cmlidXRlcyI6IFt7InRyaXRfdHlwZSI6ICJtb29kaW5lc3MiLCAidmFsdWUiOiAiMTAwIn1dLCAiaW1hZ2UiOiAiZGF0YTppbWFnZS9zdmcreG1sO2Jhc2U2NCxQRDk0Yld3Z2RtVnljMmx2YmowaU1TNHdJaUJ6ZEdGdVpHRnNiMjVsUFNKdWJ5SS9QZ284YzNabklIZHBaSFJvUFNJeE1ESTBjSGdpSUdobGFXZG9kRDBpTVRBeU5IQjRJaUIyYVdWM1FtOTRQU0l3SURBZ01UQXlOQ0F4TURJMElpQjRiV3h1Y3owaWFIUjBjRG92TDNkM2R5NTNNeTV2Y21jdk1qQXdNQzl6ZG1jaVBnb2dJQ0FnUEhCaGRHZ2dabWxzYkQwaUl6TXpNeUlLSUNBZ0lDQWdJQ0JrUFNKTk5URXlJRFkwUXpJMk5DNDJJRFkwSURZMElESTJOQzQySURZMElEVXhNbk15TURBdU5pQTBORGdnTkRRNElEUTBPQ0EwTkRndE1qQXdMallnTkRRNExUUTBPRk0zTlRrdU5DQTJOQ0ExTVRJZ05qUjZiVEFnT0RJd1l5MHlNRFV1TkNBd0xUTTNNaTB4TmpZdU5pMHpOekl0TXpjeWN6RTJOaTQyTFRNM01pQXpOekl0TXpjeUlETTNNaUF4TmpZdU5pQXpOeklnTXpjeUxURTJOaTQySURNM01pMHpOeklnTXpjeWVpSWdMejRLSUNBZ0lEeHdZWFJvSUdacGJHdzlJaU5GTmtVMlJUWWlDaUFnSUNBZ0lDQWdaRDBpVFRVeE1pQXhOREJqTFRJd05TNDBJREF0TXpjeUlERTJOaTQ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Bd0lEZ3RPQzQwUXpZMk55NDJJRFl3TUM0eklEVTVOeTQxSURVek15QTFNVElnTlRNemVtMHhNamd0TVRFeVlUUTRJRFE0SURBZ01TQXdJRGsySURBZ05EZ2dORGdnTUNBeElEQXRPVFlnTUhvaUlDOCtDand2YzNablBnPT0ifQ=="
├─ [0] VM::assertEq(0x9d1b635e85d7c34b126d76fa9ddcc5a4401a391d4bfc19aab11f2324ddca3c76, 0xfe40350ebfdea6067edc9712cc5f0efc7c62db199d168463c9702ecad8d7afae) [staticcall]
│ └─ ← [Revert] assertion failed: 0x9d1b635e85d7c34b126d76fa9ddcc5a4401a391d4bfc19aab11f2324ddca3c76 != 0xfe40350ebfdea6067edc9712cc5f0efc7c62db199d168463c9702ecad8d7afae
└─ ← [Revert] assertion failed: 0x9d1b635e85d7c34b126d76fa9ddcc5a4401a391d4bfc19aab11f2324ddca3c76 != 0xfe40350ebfdea6067edc9712cc5f0efc7c62db199d168463c9702ecad8d7afae
Suite result: FAILED. 0 passed; 1 failed; 0 skipped; finished in 20.88ms (8.75ms CPU time)
Ran 1 test suite in 6.22s (20.88ms CPU time): 0 tests passed, 1 failed, 0 skipped (1 total tests)
Failing tests:
Encountered 1 failing test in test/integration/MoodNftIntegrationTest.t.sol:MoodNftIntegrationTest
[FAIL: assertion failed: 0x9d1b635e85d7c34b126d76fa9ddcc5a4401a391d4bfc19aab11f2324ddca3c76 != 0xfe40350ebfdea6067edc9712cc5f0efc7c62db199d168463c9702ecad8d7afae] testFlipTokenToSad() (gas: 356098)
Encountered a total of 1 failing tests, 0 tests succeeded
Beta Was this translation helpful? Give feedback.
All reactions