ipld-eth-server/pkg/transformers/test_data/flip_kick.go

99 lines
3.4 KiB
Go
Raw Normal View History

2018-08-07 15:51:34 +00:00
// Copyright 2018 Vulcanize
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package test_data
import (
2018-08-16 21:36:35 +00:00
"encoding/json"
"github.com/vulcanize/vulcanizedb/pkg/fakes"
2018-08-16 21:36:35 +00:00
"math/big"
"time"
2018-08-07 15:51:34 +00:00
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/types"
"github.com/vulcanize/vulcanizedb/pkg/transformers/flip_kick"
2018-08-09 21:55:02 +00:00
)
2018-08-07 15:51:34 +00:00
var (
idString = "1"
id, _ = new(big.Int).SetString(idString, 10)
lotString = "100"
lot, _ = new(big.Int).SetString(lotString, 10)
bidString = "0"
bid = new(big.Int).SetBytes([]byte{0})
gal = "0x07Fa9eF6609cA7921112231F8f195138ebbA2977"
end = int64(1535991025)
urn = [32]byte{115, 64, 224, 6, 244, 19, 91, 166, 151, 13, 67, 191, 67, 216, 141, 202, 212, 231, 168, 202, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
urnString = "0x7340e006f4135BA6970D43bf43d88DCAD4e7a8CA"
tabString = "50"
tab, _ = new(big.Int).SetString(tabString, 10)
rawLog, _ = json.Marshal(EthFlipKickLog)
)
var (
flipKickTransactionHash = "0xd11ab35cfb1ad71f790d3dd488cc1a2046080e765b150e8997aa0200947d4a9b"
flipKickData = "0x0000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007fa9ef6609ca7921112231f8f195138ebba2977000000000000000000000000000000000000000000000000000000005b8d5cf10000000000000000000000000000000000000000000000000000000000000032"
FlipKickBlockNumber = int64(10)
)
2018-08-07 15:51:34 +00:00
var EthFlipKickLog = types.Log{
Address: common.HexToAddress(KovanFlipperContractAddress),
Topics: []common.Hash{
common.HexToHash("0xbac86238bdba81d21995024470425ecb370078fa62b7271b90cf28cbd1e3e87e"),
common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000001"),
common.HexToHash("0x7340e006f4135ba6970d43bf43d88dcad4e7a8ca000000000000000000000000"),
},
Data: hexutil.MustDecode(flipKickData),
2018-08-16 21:36:35 +00:00
BlockNumber: uint64(FlipKickBlockNumber),
TxHash: common.HexToHash(flipKickTransactionHash),
2018-09-10 21:02:11 +00:00
TxIndex: 999,
BlockHash: fakes.FakeHash,
Index: 1,
2018-08-07 15:51:34 +00:00
Removed: false,
}
var FlipKickEntity = flip_kick.FlipKickEntity{
2018-09-10 21:02:11 +00:00
Id: id,
Lot: lot,
Bid: bid,
Gal: common.HexToAddress(gal),
End: big.NewInt(end),
Urn: urn,
Tab: tab,
TransactionIndex: EthFlipKickLog.TxIndex,
LogIndex: EthFlipKickLog.Index,
2018-09-10 21:02:11 +00:00
Raw: EthFlipKickLog,
2018-08-07 15:51:34 +00:00
}
var FlipKickModel = flip_kick.FlipKickModel{
BidId: idString,
2018-09-10 21:02:11 +00:00
Lot: lotString,
Bid: bidString,
Gal: gal,
End: time.Unix(end, 0),
Urn: urnString,
Tab: tabString,
TransactionIndex: EthFlipKickLog.TxIndex,
LogIndex: EthFlipKickLog.Index,
Raw: rawLog,
2018-08-07 15:51:34 +00:00
}
type FlipKickDBRow struct {
ID int64
2018-08-07 15:51:34 +00:00
HeaderId int64 `db:"header_id"`
flip_kick.FlipKickModel
2018-08-07 15:51:34 +00:00
}