Commit 2e16f392 authored by Victor Shih's avatar Victor Shih Committed by GitHub

rename all instances of push2 to pushTwo and get2 to getTwo (#319)

parent ab7f4c72
...@@ -313,14 +313,14 @@ contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, Lib_Ad ...@@ -313,14 +313,14 @@ contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, Lib_Ad
iOVM_ChainStorageContainer queueRef = queue(); iOVM_ChainStorageContainer queueRef = queue();
queueRef.push2( queueRef.pushTwo(
transactionHash, transactionHash,
timestampAndBlockNumber timestampAndBlockNumber
); );
// The underlying queue data structure stores 2 elements // The underlying queue data structure stores 2 elements
// per insertion, so to get the real queue length we need // per insertion, so to get the real queue length we need
// to divide by 2 and subtract 1. See the usage of `push2(..)`. // to divide by 2 and subtract 1. See the usage of `pushTwo(..)`.
uint256 queueIndex = queueRef.length() / 2 - 1; uint256 queueIndex = queueRef.length() / 2 - 1;
emit TransactionEnqueued( emit TransactionEnqueued(
msg.sender, msg.sender,
...@@ -751,11 +751,11 @@ contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, Lib_Ad ...@@ -751,11 +751,11 @@ contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, Lib_Ad
{ {
// The underlying queue data structure stores 2 elements // The underlying queue data structure stores 2 elements
// per insertion, so to get the actual desired queue index // per insertion, so to get the actual desired queue index
// we need to multiply by 2. See the usage of `push2(..)`. // we need to multiply by 2. See the usage of `pushTwo(..)`.
( (
bytes32 transactionHash, bytes32 transactionHash,
bytes32 timestampAndBlockNumber bytes32 timestampAndBlockNumber
) = _queueRef.get2(uint40(_index * 2)); ) = _queueRef.getTwo(uint40(_index * 2));
uint40 elementTimestamp; uint40 elementTimestamp;
uint40 elementBlockNumber; uint40 elementBlockNumber;
...@@ -786,7 +786,7 @@ contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, Lib_Ad ...@@ -786,7 +786,7 @@ contract OVM_CanonicalTransactionChain is iOVM_CanonicalTransactionChain, Lib_Ad
{ {
// The underlying queue data structure stores 2 elements // The underlying queue data structure stores 2 elements
// per insertion, so to get the real queue length we need // per insertion, so to get the real queue length we need
// to divide by 2. See the usage of `push2(..)`. // to divide by 2. See the usage of `pushTwo(..)`.
return uint40(_queueRef.length() / 2); return uint40(_queueRef.length() / 2);
} }
......
...@@ -145,7 +145,7 @@ contract OVM_ChainStorageContainer is iOVM_ChainStorageContainer, Lib_AddressRes ...@@ -145,7 +145,7 @@ contract OVM_ChainStorageContainer is iOVM_ChainStorageContainer, Lib_AddressRes
/** /**
* @inheritdoc iOVM_ChainStorageContainer * @inheritdoc iOVM_ChainStorageContainer
*/ */
function push2( function pushTwo(
bytes32 _objectA, bytes32 _objectA,
bytes32 _objectB bytes32 _objectB
) )
...@@ -153,13 +153,13 @@ contract OVM_ChainStorageContainer is iOVM_ChainStorageContainer, Lib_AddressRes ...@@ -153,13 +153,13 @@ contract OVM_ChainStorageContainer is iOVM_ChainStorageContainer, Lib_AddressRes
public public
onlyOwner onlyOwner
{ {
buffer.push2(_objectA, _objectB); buffer.pushTwo(_objectA, _objectB);
} }
/** /**
* @inheritdoc iOVM_ChainStorageContainer * @inheritdoc iOVM_ChainStorageContainer
*/ */
function push2( function pushTwo(
bytes32 _objectA, bytes32 _objectA,
bytes32 _objectB, bytes32 _objectB,
bytes27 _globalMetadata bytes27 _globalMetadata
...@@ -168,7 +168,7 @@ contract OVM_ChainStorageContainer is iOVM_ChainStorageContainer, Lib_AddressRes ...@@ -168,7 +168,7 @@ contract OVM_ChainStorageContainer is iOVM_ChainStorageContainer, Lib_AddressRes
public public
onlyOwner onlyOwner
{ {
buffer.push2(_objectA, _objectB, _globalMetadata); buffer.pushTwo(_objectA, _objectB, _globalMetadata);
} }
/** /**
...@@ -190,7 +190,7 @@ contract OVM_ChainStorageContainer is iOVM_ChainStorageContainer, Lib_AddressRes ...@@ -190,7 +190,7 @@ contract OVM_ChainStorageContainer is iOVM_ChainStorageContainer, Lib_AddressRes
/** /**
* @inheritdoc iOVM_ChainStorageContainer * @inheritdoc iOVM_ChainStorageContainer
*/ */
function get2( function getTwo(
uint256 _index uint256 _index
) )
override override
...@@ -201,7 +201,7 @@ contract OVM_ChainStorageContainer is iOVM_ChainStorageContainer, Lib_AddressRes ...@@ -201,7 +201,7 @@ contract OVM_ChainStorageContainer is iOVM_ChainStorageContainer, Lib_AddressRes
bytes32 bytes32
) )
{ {
return buffer.get2(uint40(_index)); return buffer.getTwo(uint40(_index));
} }
/** /**
......
...@@ -70,7 +70,7 @@ interface iOVM_ChainStorageContainer { ...@@ -70,7 +70,7 @@ interface iOVM_ChainStorageContainer {
* @param _objectA First 32 byte value to insert into the container. * @param _objectA First 32 byte value to insert into the container.
* @param _objectB Second 32 byte value to insert into the container. * @param _objectB Second 32 byte value to insert into the container.
*/ */
function push2( function pushTwo(
bytes32 _objectA, bytes32 _objectA,
bytes32 _objectB bytes32 _objectB
) )
...@@ -83,7 +83,7 @@ interface iOVM_ChainStorageContainer { ...@@ -83,7 +83,7 @@ interface iOVM_ChainStorageContainer {
* @param _objectB Second 32 byte value to insert into the container. * @param _objectB Second 32 byte value to insert into the container.
* @param _globalMetadata New global metadata for the container. * @param _globalMetadata New global metadata for the container.
*/ */
function push2( function pushTwo(
bytes32 _objectA, bytes32 _objectA,
bytes32 _objectB, bytes32 _objectB,
bytes27 _globalMetadata bytes27 _globalMetadata
...@@ -110,7 +110,7 @@ interface iOVM_ChainStorageContainer { ...@@ -110,7 +110,7 @@ interface iOVM_ChainStorageContainer {
* @return 32 byte object value at index `_index`. * @return 32 byte object value at index `_index`.
* @return 32 byte object value at index `_index + 1`. * @return 32 byte object value at index `_index + 1`.
*/ */
function get2( function getTwo(
uint256 _index uint256 _index
) )
external external
......
...@@ -118,7 +118,7 @@ library Lib_RingBuffer { ...@@ -118,7 +118,7 @@ library Lib_RingBuffer {
* @param _valueA Second value to push to the buffer. * @param _valueA Second value to push to the buffer.
* @param _extraData Optional global extra data. * @param _extraData Optional global extra data.
*/ */
function push2( function pushTwo(
RingBuffer storage _self, RingBuffer storage _self,
bytes32 _valueA, bytes32 _valueA,
bytes32 _valueB, bytes32 _valueB,
...@@ -136,7 +136,7 @@ library Lib_RingBuffer { ...@@ -136,7 +136,7 @@ library Lib_RingBuffer {
* @param _valueA First value to push to the buffer. * @param _valueA First value to push to the buffer.
* @param _valueA Second value to push to the buffer. * @param _valueA Second value to push to the buffer.
*/ */
function push2( function pushTwo(
RingBuffer storage _self, RingBuffer storage _self,
bytes32 _valueA, bytes32 _valueA,
bytes32 _valueB bytes32 _valueB
...@@ -145,7 +145,7 @@ library Lib_RingBuffer { ...@@ -145,7 +145,7 @@ library Lib_RingBuffer {
{ {
RingBufferContext memory ctx = _self.getContext(); RingBufferContext memory ctx = _self.getContext();
_self.push2( _self.pushTwo(
_valueA, _valueA,
_valueB, _valueB,
ctx.extraData ctx.extraData
...@@ -218,7 +218,7 @@ library Lib_RingBuffer { ...@@ -218,7 +218,7 @@ library Lib_RingBuffer {
* @return Value of the element at index `_index`. * @return Value of the element at index `_index`.
* @return Value of the element at index `_index + 1`. * @return Value of the element at index `_index + 1`.
*/ */
function get2( function getTwo(
RingBuffer storage _self, RingBuffer storage _self,
uint256 _index uint256 _index
) )
......
...@@ -25,14 +25,14 @@ contract TestLib_RingBuffer { ...@@ -25,14 +25,14 @@ contract TestLib_RingBuffer {
); );
} }
function push2( function pushTwo(
bytes32 _valueA, bytes32 _valueA,
bytes32 _valueB, bytes32 _valueB,
bytes27 _extraData bytes27 _extraData
) )
public public
{ {
buf.push2( buf.pushTwo(
_valueA, _valueA,
_valueB, _valueB,
_extraData _extraData
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment