Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 05:07
    hrishikeshio commented #2257
  • 04:37
    Vasiliy-Bondarenko commented #2257
  • 03:56
    hrishikeshio commented #2257
  • Dec 15 22:24
    cgewecke edited #2688
  • Dec 15 21:36
    cgewecke opened #2688
  • Dec 15 16:18
    GregTheGreek commented #2080
  • Dec 14 18:37
    Leon-Africa commented #852
  • Dec 14 18:37
    Leon-Africa commented #852
  • Dec 14 18:36
    Leon-Africa commented #852
  • Dec 14 18:35
    Leon-Africa commented #852
  • Dec 14 18:35
    Leon-Africa commented #852
  • Dec 14 15:28
    Vasiliy-Bondarenko commented #2257
  • Dec 14 00:41

    CruzMolina on alphaTez

    Improve handling of inherited e… Manual "merge" of topics count … use workspace dependency lerna … and 17 more (compare)

  • Dec 14 00:12

    CruzMolina on next

    Improve handling of inherited e… Manual "merge" of topics count … use workspace dependency lerna … and 16 more (compare)

  • Dec 14 00:05

    CruzMolina on misc-things

    (compare)

  • Dec 14 00:04

    CruzMolina on alphaTez

    revert cf280da44d819c4599372137… rm deprectated config typings add tezos-contract dep to @truf… and 6 more (compare)

  • Dec 14 00:04
    CruzMolina closed #2687
  • Dec 13 23:44
    CruzMolina opened #2687
  • Dec 13 23:33

    CruzMolina on misc-things

    revert cf280da44d819c4599372137… rm deprectated config typings add tezos-contract dep to @truf… and 5 more (compare)

  • Dec 13 23:20

    CruzMolina on contract-webpack-bug

    (compare)

kohshiba
@kohshiba
yes. the expected returned value is address. I confirmed that some other tests use the same target function passed. so, I don't think its the matter of gas or the description of the test code.
Murat Çeliktepe
@CeliktepeMurat
just in case, can you share this function?
kohshiba
@kohshiba

Sure!
the code is a modified version of an ERC721 token function and ERC721 token that inferits the modified version.
Solidity code 1

  function ownerOf(uint256 itemId, uint256 id) public view returns (address) {
    address owner = _itemOwner[itemId][id];
    require(owner != address(0));
    return owner;
  }

Solidity code 2

  function ownerOf(uint256 itemId) public view returns (address) {
      return ownerOf(itemId, 1);
  }

Test code 1 for solidity code 1 => failed( show the above error)

      context(
        "when the given item ID was tracked by this item but id doesn't exist",
        function() {
          const itemId = firstItemId;
          it("returns the owner of the given id and item id", async function() {
            await expectRevert.unspecified(await item.ownerOf(itemId, 3));
          });
        }
      );

Test code 2 for solidity code 2 => passed

      context("when the given item ID was tracked by this item", function() {
        const itemId = firstItemId;
        it("returns the owner of the given item ID as ERC721", async function() {
          expect(await item.ownerOf(itemId)).to.be.equal(owner);
        });
      });

Test uses openzeppelin library and chai assertion library.

Murat Çeliktepe
@CeliktepeMurat
two functions with the same name? may you change the first function's name?
kohshiba
@kohshiba
Thanks, I'll try it.
Enrique Alcázar Garzás
@kikoncuo
Hey guys there seems to be a weird behaviour with the create2 opcode and ganache-cli
I can deterministically create the future address, and the deployment is done in the expected address
kohshiba
@kohshiba
@CeliktepeMurat
I successfully removed the error. Thanks a lot!
seems like truffle cannot deal with Function overloading sometimes
https://solidity.readthedocs.io/en/latest/contracts.html#function-overloading
Enrique Alcázar Garzás
@kikoncuo
but the expected address changes after deployment
in theory I should be able to redeploy a contract on the same address after the original is destroyed
I cannot with the current behaviour
Murat Çeliktepe
@CeliktepeMurat
@kohshiba you re welcome, yes truffle cannot deal with overloaded functions yet
Pranav Madhani
@pranavsuper_twitter
how can i access truffle hd wallet provider cause when i try to install i am getting error
as it is depreciated already and showing message that its available in truffle framework than how to use?
mandeep9888
@mandeep9888
Hi Guys,
Is truffle supports EthSigner developed by pegasys team ??
Kavya9294
@Kavya9294
Hi guys, I have a problem with deploying smart contract onto Quorum network. Can someone please help me out here?
Austin McElroy
@amcelroy
Can Ganache UI use WebsocketProviders? I would like to explore events and am unable to do so using HTTPProviders.
Amr Essam Shaker
@AmrEShaker
Hi Guys,
I am trying to use Truffle HDWallet Provider with Infura WebSocket Provider, but it fails.
anybody have an idea why is that ?
Murat Çeliktepe
@CeliktepeMurat
you need to send your code snippet
swkim109
@swkim109
@amcelroy I think this works: const web3 = new Web3(new Web3.providers.WebsocketProvider(GANACHE_WS));
GANACHE_WS is ws://localhost:7545
Austin McElroy
@amcelroy
@swkim109 Thanks!!!
Joseph Nicholas R. Alcantara
@josephnicholas
Hello just wanted to ask if it is possible to test a payable function using Solidity test?
Gagan H N
@gaganhn
Hey Guys, Can we use @drizzle/vue-plugin without vuex ????
Is there any docs regarding that
Adrian Li
@adrianmcli

@kohshiba you re welcome, yes truffle cannot deal with overloaded functions yet

@CeliktepeMurat Actually this is not true. It's just really weird because of the fact that Web3.js is used internally. We had an internal discussion about this and we will be trying to better document it soon: trufflesuite/truffle#2679

mandeep9888
@mandeep9888
truffle migrate --reset --network development it shows migrations. Then when starting migrations 1_initial_migration.js has transaction hash and blocks still be loaded and not finished. what could be the problem ? I have started mining also.
Murat Çeliktepe
@CeliktepeMurat
@adrianmcli thank you for warning
ktimam
@ktimam
How do i render the structs1 map in complexstorage using drizzle react-context example?
us3r01
@us3r01
hi guys
I need some help...I was running the react-box with ganache-cli but I have this error...some one know why?
image.png
ktimam
@ktimam
@us3r01 seems contracts are not deployed or deployed to different network (did you make sure contracts folder from build directory are copied correctly to react app folder after deploying)?
ktimam
@ktimam
Is this drizzle code still working or is it legacy cause i don't seem to be able to get it to work:
const { drizzle } = this.props;
const contract = drizzle.contracts.SimpleStorage;
// get and save the key for the variable we are interested in
const dataKey = contract.methods["storedData"].cacheCall();
this.setState({ dataKey });
swkim109
@swkim109
@ktimam As far as I know, Both legacy context API and new context API works fine in drizzle 1.5(latest version I guess)
If you want to use legacy context API, here is the example:
    // legacy Context API
    constructor(props, context) {
        super(props);
        this.drizzle = context.drizzle;
        this.contracts = context.drizzle.contracts;

        this.state = {
             val: 0,
             storedData: 0,
        }
    }
...

// legacy Context API
MyComponent.contextTypes = {
    drizzle: PropTypes.object
}
Abir Hasan Mubin
@abirhasanmubin
image.png
Abir Hasan Mubin
@abirhasanmubin

I have issues with truffle test in metacoin box
my system:
Truffle v5.1.2 (core: 5.1.2)
Solidity v0.5.12 (solc-js)
Node v13.3.0
Web3.js v1.2.2

When I run test in truffle develop TypeError [ERR_INVALID_REPL_INPUT]: Listeners for uncaughtException cannot be used in the REPL
Imgur

ktimam
@ktimam
Annotation 2019-12-15 004750.png
console.log(drizzle.contracts);    
console.log(drizzle.contracts.DecentracraftWorld);
Any ideas why would the first log statement display the contracts then second log doesn't find the contract object when it tries to access it?
Anton Bukov
@k06a
Hi, need pro help)
Trying to run tests in ganache-cli fork of mainnet
And see truffle test did bunch of same queries: eth_getBlockByNumber
Bunch of the same queries, repeating every second until die a few minutes later
eth_getBlockByNumber
   > {
   >   "jsonrpc": "2.0",
   >   "id": 177,
   >   "method": "eth_getBlockByNumber",
   >   "params": [
   >     "0x8b049c",
   >     false
   >   ]
   > }
eth_getBlockByNumber
   > {
   >   "jsonrpc": "2.0",
   >   "id": 177,
   >   "method": "eth_getBlockByNumber",
   >   "params": [
   >     "0x8b049d",
   >     false
   >   ]
   > }
A lot of requests of 2 blocks: 0x8b049c and 0x8b049d
Anton Bukov
@k06a
Oh, it seems problem was fixed in 5.1.4, thanks!
ktimam
@ktimam

How do i get drizzleContext from inside the componentDidMount function? I am currently getting it from render using the following code which seems to be working fine:

render() {
return (
<DrizzleContext.Consumer>

  {drizzleContext => {
    const { drizzle, drizzleState, initialized } = drizzleContext
    if (!initialized) {
      return "Loading..."
      }

.........

swkim109
@swkim109

@ktimam I hope this snippet is helpful:

<DrizzleContext.Provider drizzle={drizzle}>
    <Main />                    
</DrizzleContext.Provider>

Main is

const Main = () => {

        return (
                <DrizzleContext.Consumer>
                    {
                        (drizzleContext) => {
                            const { drizzle, drizzleState, initialized } = drizzleContext;

                            return (
                                <MyComponent drizzle={drizzle} drizzleState={drizzleState} />
                            );
                        }
                    }
                </DrizzleContext.Consumer>
            )

}

MyComponent is

const MyComponent = (props) => {              

    const contracts = props.drizzle.contracts;
    const web3 = props.drizzle.web3;          

    ...
}