Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: rename blockNum to blknum consistently #581

Merged
merged 1 commit into from
Feb 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ contract BlockController is OnlyFromAddress, VaultRegistry {
mapping (uint256 => BlockModel.Block) public blocks; // block number => Block data

event BlockSubmitted(
uint256 blockNumber
uint256 blknum
);

event ChildChainActivated(
Expand Down
4 changes: 2 additions & 2 deletions plasma_framework/contracts/src/utils/PosLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ pragma solidity 0.5.11;
import "openzeppelin-solidity/contracts/math/SafeMath.sol";

/**
* @dev UTXO position = (blockNumber * BLOCK_OFFSET + txIndex * TX_OFFSET + outputIndex).
* TX position = (blockNumber * BLOCK_OFFSET + txIndex * TX_OFFSET)
* @dev UTXO position = (blknum * BLOCK_OFFSET + txIndex * TX_OFFSET + outputIndex).
* TX position = (blknum * BLOCK_OFFSET + txIndex * TX_OFFSET)
*/
library PosLib {
struct Position {
Expand Down
2 changes: 1 addition & 1 deletion plasma_framework/docs/contracts/BlockController.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ mapping(uint256 => struct BlockModel.Block) public blocks;
**Events**

```js
event BlockSubmitted(uint256 blockNumber);
event BlockSubmitted(uint256 blknum);
event ChildChainActivated(address authority);
```

Expand Down
4 changes: 2 additions & 2 deletions plasma_framework/docs/contracts/PosLib.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ View Source: [contracts/src/utils/PosLib.sol](../../contracts/src/utils/PosLib.s

**PosLib**

UTXO position = (blockNumber * BLOCK_OFFSET + txIndex * TX_OFFSET + outputIndex).
TX position = (blockNumber * BLOCK_OFFSET + txIndex * TX_OFFSET)
UTXO position = (blknum * BLOCK_OFFSET + txIndex * TX_OFFSET + outputIndex).
TX position = (blknum * BLOCK_OFFSET + txIndex * TX_OFFSET)

## Structs
### Position
Expand Down
8 changes: 4 additions & 4 deletions plasma_framework/docs/integration-docs/integration-doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ On success, the PlasmaFramework contract emits a `BlockSubmitted` event:

```
event BlockSubmitted(
uint256 blockNumber
uint256 blknum
);
```

Expand Down Expand Up @@ -84,7 +84,7 @@ Where
txType ::= uint256
input ::= outputId | outputPosition
outputId ::= hash of the transaction that produced the output concatenated with the outputIndex
outputPosition ::= 32 byte string that is (blockNumber * BLOCK_OFFSET + txIndex * TX_OFFSET + outputIndex)
outputPosition ::= 32 byte string that is (blknum * BLOCK_OFFSET + txIndex * TX_OFFSET + outputIndex)
output ::= outputType outputData
outputType ::= uint256
outputData ::= undefined, to be defined by concrete transaction types
Expand Down Expand Up @@ -1269,13 +1269,13 @@ Watchers monitor the network and send alerts so that users know when they need t
A new Plasma Block has been submitted. Watcher should fetch block data from child chain and verify that it matches block data published to the Plasma contract on the root chain.
```
event BlockSubmitted(
uint256 blockNumber
uint256 blknum
);
```

Fetching block data from `PlasmaFramework`:
```
block = PlasmaFramework.blocks(blockNumber)
block = PlasmaFramework.blocks(blknum)
```
where block is:
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ contract('BlockController', ([maintainer, authority, other]) => {

it('emits "BlockSubmitted" event', async () => {
const tx = await this.blockController.submitBlock(this.dummyBlockHash, { from: authority });
await expectEvent.inLogs(tx.logs, 'BlockSubmitted', { blockNumber: new BN(this.childBlockInterval) });
await expectEvent.inLogs(tx.logs, 'BlockSubmitted', { blknum: new BN(this.childBlockInterval) });
});

it('reverts when not called by authority', async () => {
Expand Down