Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
openzeppelin-contracts-upgradeable
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
俞永鹏
openzeppelin-contracts-upgradeable
Commits
d1c121b5
Unverified
Commit
d1c121b5
authored
Sep 18, 2020
by
Francisco Giordano
Committed by
GitHub
Sep 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test ERC165 support in ERC1155Holder (#2365)
parent
e98b187e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletions
+9
-1
SupportsInterface.behavior.js
test/introspection/SupportsInterface.behavior.js
+5
-1
ERC1155Holder.test.js
test/token/ERC1155/ERC1155Holder.test.js
+4
-0
No files found.
test/introspection/SupportsInterface.behavior.js
View file @
d1c121b5
...
@@ -35,6 +35,10 @@ const INTERFACES = {
...
@@ -35,6 +35,10 @@ const INTERFACES = {
'safeTransferFrom(address,address,uint256,uint256,bytes)'
,
'safeTransferFrom(address,address,uint256,uint256,bytes)'
,
'safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)'
,
'safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)'
,
],
],
ERC1155Receiver
:
[
'onERC1155Received(address,address,uint256,uint256,bytes)'
,
'onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)'
,
],
};
};
const
INTERFACE_IDS
=
{};
const
INTERFACE_IDS
=
{};
...
@@ -50,7 +54,7 @@ for (const k of Object.getOwnPropertyNames(INTERFACES)) {
...
@@ -50,7 +54,7 @@ for (const k of Object.getOwnPropertyNames(INTERFACES)) {
function
shouldSupportInterfaces
(
interfaces
=
[])
{
function
shouldSupportInterfaces
(
interfaces
=
[])
{
describe
(
'Contract interface'
,
function
()
{
describe
(
'Contract interface'
,
function
()
{
beforeEach
(
function
()
{
beforeEach
(
function
()
{
this
.
contractUnderTest
=
this
.
mock
||
this
.
token
;
this
.
contractUnderTest
=
this
.
mock
||
this
.
token
||
this
.
holder
;
});
});
for
(
const
k
of
interfaces
)
{
for
(
const
k
of
interfaces
)
{
...
...
test/token/ERC1155/ERC1155Holder.test.js
View file @
d1c121b5
...
@@ -6,6 +6,8 @@ const ERC1155Mock = contract.fromArtifact('ERC1155Mock');
...
@@ -6,6 +6,8 @@ const ERC1155Mock = contract.fromArtifact('ERC1155Mock');
const
{
expect
}
=
require
(
'chai'
);
const
{
expect
}
=
require
(
'chai'
);
const
{
shouldSupportInterfaces
}
=
require
(
'../../introspection/SupportsInterface.behavior'
);
describe
(
'ERC1155Holder'
,
function
()
{
describe
(
'ERC1155Holder'
,
function
()
{
const
[
creator
]
=
accounts
;
const
[
creator
]
=
accounts
;
const
uri
=
'https://token-cdn-domain/{id}.json'
;
const
uri
=
'https://token-cdn-domain/{id}.json'
;
...
@@ -19,6 +21,8 @@ describe('ERC1155Holder', function () {
...
@@ -19,6 +21,8 @@ describe('ERC1155Holder', function () {
await
this
.
multiToken
.
mintBatch
(
creator
,
multiTokenIds
,
multiTokenAmounts
,
'0x'
,
{
from
:
creator
});
await
this
.
multiToken
.
mintBatch
(
creator
,
multiTokenIds
,
multiTokenAmounts
,
'0x'
,
{
from
:
creator
});
});
});
shouldSupportInterfaces
([
'ERC165'
,
'ERC1155Receiver'
]);
it
(
'receives ERC1155 tokens from a single ID'
,
async
function
()
{
it
(
'receives ERC1155 tokens from a single ID'
,
async
function
()
{
await
this
.
multiToken
.
safeTransferFrom
(
await
this
.
multiToken
.
safeTransferFrom
(
creator
,
creator
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment