trufflesuite / truffle-debugger

Core functionality for debugging Solidity files built with Truffle
67 stars 12 forks source link

Refactor data decoding tests to be data-driven #68

Closed gnidan closed 6 years ago

gnidan commented 6 years ago

Generate the Solidity and expected values from something like...

const FIXTURES = [{
  name: "multipleFullWordArray",
  type: "uint[]",
  value: generateArray(3)  // takes up 3 whole words
}, {
  name: "withinWordArray",
  type: "uint16[]",
  value: generateArray(10)  // takes up >1/2 word
}, {
  name: "multiplePartWordArray",
  type: "uint64[]",
  value: generateArray(9)  // takes up 2.25 words
}, {
  name: "inconvenientlyWordOffsetArray",
  type: "uint240[]",
  value: generateArray(3)  // takes up ~2.8 words
}, {
  name: "shortString",
  type: "string",
  value: "hello world"
}, {
  name: "longString",
  type: "string",
  value: "solidity storage is a fun lesson in endianness"
}];
gnidan commented 6 years ago

Thanks!