File tree Expand file tree Collapse file tree 6 files changed +29
-37
lines changed
utils/questions/lesson-4/1-intro Expand file tree Collapse file tree 6 files changed +29
-37
lines changed Original file line number Diff line number Diff line change @@ -817,6 +817,7 @@ Ok, here are some tests for these helpers!
817
817
it (' should error if token does not exist' , async function () {
818
818
await expect (contract .tokenURI (0 )).to .be .revertedWith (' Nonexistent token' )
819
819
})
820
+ })
820
821
821
822
describe (' tierNameOf' , async function () {
822
823
it (' should return proper tier name for Tier 0' , async function () {
Original file line number Diff line number Diff line change 1
1
{
2
- "question" : " " ,
2
+ "question" : " Choose the reasons for using automated tests: " ,
3
3
"options" : [
4
4
{
5
- "answer" : " " ,
5
+ "answer" : " Give us insurance if we upgrade code later " ,
6
6
"correct" : true
7
7
},
8
8
{
9
- "answer" : " "
9
+ "answer" : " So we don’t have to use manual tests "
10
10
},
11
11
{
12
- "answer" : " " ,
12
+ "answer" : " Give us the chance to utilise code modularly " ,
13
13
"correct" : true
14
14
},
15
15
{
16
- "answer" : " "
17
- },
18
- {
19
- "answer" : " "
16
+ "answer" : " All of the above"
20
17
}
21
18
]
22
19
}
Original file line number Diff line number Diff line change 1
1
{
2
- "question" : " Choose reasons for using automated tests: " ,
2
+ "question" : " What is the role of a Testnet in smart contract development? " ,
3
3
"options" : [
4
4
{
5
- "answer" : " Give us insurance if we upgrade code later " ,
6
- "correct" : true
5
+ "answer" : " It helps to deploy smart contracts to the Ethereum mainnet."
6
+ },
7
+ {
8
+ "answer" : " To airdrop free Ether to devs because testing gets the eco-system a good name."
7
9
},
8
10
{
9
- "answer" : " So we don’t have to use manual tests "
11
+ "answer" : " It's used to interact with smart contracts using that real Ether. "
10
12
},
11
13
{
12
- "answer" : " Give us the chance to utilise code modularly " ,
14
+ "answer" : " It's a network that is used for testing smart contracts. " ,
13
15
"correct" : true
14
16
}
15
17
]
Original file line number Diff line number Diff line change 1
1
{
2
- "question" : " What do you imagine one of the first steps is in this lesson ?" ,
2
+ "question" : " What is the purpose of the 'require' statement in Solidity ?" ,
3
3
"options" : [
4
4
{
5
- "answer" : " Add your private key to the .gitignore file! "
5
+ "answer" : " For specifying the visibility of a variable or function. "
6
6
},
7
7
{
8
- "answer" : " Harmonise Solidity versions across the project" ,
9
- "correct" : true
8
+ "answer" : " To be able to easily define a new modifier in the contract whenever we need it."
10
9
},
11
10
{
12
- "answer" : " Add a new line of code to the contract to signal we can test it "
11
+ "answer" : " For declaring a new function in the contract. "
13
12
},
14
13
{
15
- "answer" : " Add a console.log line to the contract code so we can see the output of the tests"
14
+ "answer" : " To perform a conditional check, and revert the transaction if it fails." ,
15
+ "correct" : true
16
16
}
17
17
]
18
18
}
Original file line number Diff line number Diff line change 1
1
{
2
- "question" : " " ,
2
+ "question" : " When writing unit tests for a smart contract, what should we be testing? " ,
3
3
"options" : [
4
4
{
5
- "answer" : " " ,
6
- "correct" : true
5
+ "answer" : " Functionality that only involves external contracts."
7
6
},
8
7
{
9
- "answer" : " "
8
+ "answer" : " Only private functions that aren't externally accessible. "
10
9
},
11
10
{
12
- "answer" : " " ,
11
+ "answer" : " All functions and possible edge cases that the contract may encounter. " ,
13
12
"correct" : true
14
13
},
15
14
{
16
- "answer" : " "
17
- },
18
- {
19
- "answer" : " "
15
+ "answer" : " Just the constructor function to ensure the contract gets deployed properly."
20
16
}
21
17
]
22
18
}
Original file line number Diff line number Diff line change 1
1
{
2
- "question" : " " ,
2
+ "question" : " What do you imagine one of the first steps is in this lesson? " ,
3
3
"options" : [
4
4
{
5
- "answer" : " " ,
6
- "correct" : true
7
- },
8
- {
9
- "answer" : " "
5
+ "answer" : " To add your private key to the .gitignore file!"
10
6
},
11
7
{
12
- "answer" : " " ,
8
+ "answer" : " To harmonise Solidity versions across the project " ,
13
9
"correct" : true
14
10
},
15
11
{
16
- "answer" : " "
12
+ "answer" : " To make sure to add an extra line of code to the contract to signal to Hardhat that we can test it "
17
13
},
18
14
{
19
- "answer" : " "
15
+ "answer" : " To create a console.log line to the contract code so we can see the output of the tests "
20
16
}
21
17
]
22
18
}
You can’t perform that action at this time.
0 commit comments