Skip to content

Commit

Permalink
check that the buffer has been read before returning contract
Browse files Browse the repository at this point in the history
  • Loading branch information
saibatizoku committed Oct 26, 2021
1 parent c6d06b8 commit db10b94
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions chain-impl-mockchain/src/smartcontract/mod.rs
Expand Up @@ -83,15 +83,19 @@ impl Readable for Contract {
return Err(ReadError::StructureInvalid("Invalid byte sequence".into()))
}
};
let contract = Contract::EVM {
from,
to,
gas,
gas_price,
value,
data,
};
Ok(contract)

if let Err(e) = buf.expect_end() {
Err(e)
} else {
Ok(Contract::EVM {
from,
to,
gas,
gas_price,
value,
data,
})
}
}
}
n => {
Expand Down

0 comments on commit db10b94

Please sign in to comment.