-
Notifications
You must be signed in to change notification settings - Fork 563
add more methods to remix-sim; fix accounts #1160
Conversation
…ctionByHash. fix accounts
f69ac83
to
5284d5c
Compare
throw new Error(err) | ||
} | ||
var balance = '0x56BC75E2D63100000' | ||
account.balance = balance || '0xf00000000000000001' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is that enough for adding balance here?
I think we might need to do something like https://github.com/ethereum/remix-ide/blob/swap_it/src/universal-dapp.js#L127
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The api changed afak
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but this call stateManager.putAccount
is still needed no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
turns out it's not needed anymore. getAccount will return the account object which can be modified. a way to verify this is to run a script like
const Web3 = require('web3')
const RemixSim = require('./')
provider = new RemixSim.Provider({})
web3 = new Web3(provider)
web3.eth.getAccounts((error, accounts) => {
let account = accounts[0]
web3.eth.getBalance(account).then((balance) => {
console.dir("=============")
console.dir(balance)
console.dir("=============")
})
});
balance
will have the value of var balance = '0x56BC75E2D63100000'
changing this will the balance returned above
No description provided.