ADD more text

pull/1/head
pubkey 7 years ago
parent 0088326e6c
commit 536fe0fe70
  1. 19
      test/tutorials.test.js
  2. 4
      tutorials/signed-data.md
  3. 2
      typings/index.d.ts

@ -75,12 +75,27 @@ describe('tutorials.test.js', () => {
// check owner
const owner = await contractInstance.methods.owner().call();
assert.equal(owner, creatorIdentity.address);
console.dir(owner);
// send value
const rawTx2 = {
from: creatorIdentity.address,
to: contractAddress,
nonce: 1,
value: parseInt(web3.utils.toWei('1', 'ether')),
gas: 421000,
gasPrice: 50000000000
};
// TODO this does not work :(
console.dir(rawTx2);
const serializedTx2 = EthCrypto.signTransaction(
rawTx2,
creatorIdentity.privateKey
);
const receipt2 = await web3.eth.sendSignedTransaction(serializedTx2);
// check balance
const balance = await contractInstance.methods.getBalance().call();
console.dir(balance);
});
});

@ -103,7 +103,7 @@ console.log(contractAddress);
// > '0xCF3d784002721227F36575eD051Ea2171a528b7D' <- this is the address of our contract
```
Awesome. The contract is now on the blockchain. To check if it is deployed correclty, lets call a function on it.
Awesome. The contract is now on the blockchain. To check if it is deployed correctly, lets call a function on it.
```javascript
@ -118,4 +118,4 @@ const owner = await contractInstance.methods.owner().call();
console.dir(owner); // same as creatorIdentity.address
```
Before we can TODO
Before we can sign donations, we have to send some value to the contract.

@ -46,7 +46,7 @@ export function signTransaction(
export function txDataByCompiled(
abi: any,
bytecode: string,
args: Array<string | number | BigNumber>
args?: Array<string | number | BigNumber>
): string;
export type TypedValue = {

Loading…
Cancel
Save