Commit 6a32320d authored by clabby's avatar clabby

Update op-challenger tests

parent 38d5af99
...@@ -118,6 +118,7 @@ func (u *cannonUpdater) BuildLocalOracleData(data *types.PreimageOracleData) ([] ...@@ -118,6 +118,7 @@ func (u *cannonUpdater) BuildLocalOracleData(data *types.PreimageOracleData) ([]
return u.fdgAbi.Pack( return u.fdgAbi.Pack(
"addLocalData", "addLocalData",
data.GetIdent(), data.GetIdent(),
big.NewInt(int64(data.LocalContext)),
big.NewInt(int64(data.OracleOffset)), big.NewInt(int64(data.OracleOffset)),
) )
} }
......
...@@ -104,12 +104,13 @@ func TestCannonUpdater_BuildLocalOracleData(t *testing.T) { ...@@ -104,12 +104,13 @@ func TestCannonUpdater_BuildLocalOracleData(t *testing.T) {
txData, err := updater.BuildLocalOracleData(oracleData) txData, err := updater.BuildLocalOracleData(oracleData)
require.NoError(t, err) require.NoError(t, err)
var addLocalDataBytes4 = crypto.Keccak256([]byte("addLocalData(uint256,uint256)"))[:4] var addLocalDataBytes4 = crypto.Keccak256([]byte("addLocalData(uint256,uint256,uint256)"))[:4]
// Pack the tx data manually. // Pack the tx data manually.
var expected []byte var expected []byte
expected = append(expected, addLocalDataBytes4...) expected = append(expected, addLocalDataBytes4...)
expected = append(expected, common.Hex2Bytes("00aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")...) expected = append(expected, common.Hex2Bytes("00aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")...)
expected = append(expected, common.Hex2Bytes("0000000000000000000000000000000000000000000000000000000000000000")...)
expected = append(expected, common.Hex2Bytes("0000000000000000000000000000000000000000000000000000000000000007")...) expected = append(expected, common.Hex2Bytes("0000000000000000000000000000000000000000000000000000000000000007")...)
require.Equal(t, expected, txData) require.Equal(t, expected, txData)
......
...@@ -16,6 +16,7 @@ var ( ...@@ -16,6 +16,7 @@ var (
// to load into the onchain oracle. // to load into the onchain oracle.
type PreimageOracleData struct { type PreimageOracleData struct {
IsLocal bool IsLocal bool
LocalContext uint64
OracleKey []byte OracleKey []byte
OracleData []byte OracleData []byte
OracleOffset uint32 OracleOffset uint32
......
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